Skip to content

Commit

Permalink
Merge pull request #119 from glimchb/patch-1
Browse files Browse the repository at this point in the history
ci: add docker compose auto test
  • Loading branch information
mraineri authored Apr 12, 2024
2 parents e295a04 + 968b945 commit 6b400ec
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 0 deletions.
38 changes: 38 additions & 0 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Docker
on: [push, pull_request]

jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: docker/setup-qemu-action@v3
- uses: docker/[email protected]
- name: Start containers
run: docker-compose up --build --force-recreate --detach
- name: Verify no-ssl success
run: |
set -x
name=$(docker-compose ps | grep test | grep -v ssl | awk '{print $1}')
rc=$(docker wait "${name}")
if [ "${rc}" != "0" ]; then
echo "test failed:"
docker logs "${name}"
exit 1
fi
- name: Verify ssl success
run: |
set -x
name=$(docker-compose ps | grep test-ssl | awk '{print $1}')
rc=$(docker wait "${name}")
if [ "${rc}" != "0" ]; then
echo "test-ssl failed:"
docker logs "${name}"
exit 1
fi
- name: Logs
if: always()
run: docker-compose logs
- name: Stop containers
if: always()
run: docker-compose down --volumes --remove-orphans
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ Copyright 2016-2020 DMTF. All rights reserved.
[![Pulls](https://img.shields.io/docker/pulls/dmtf/redfish-mockup-server?style=flat&logo=docker&label=Pulls)](https://hub.docker.com/r/dmtf/redfish-mockup-server)
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg?style=flat)](https://github.com/psf/black)
[![Linters](https://github.com/DMTF/Redfish-Mockup-Server/actions/workflows/linters.yml/badge.svg)](https://github.com/DMTF/Redfish-Mockup-Server/actions/workflows/linters.yml)
[![Docker](https://github.com/DMTF/Redfish-Mockup-Server/actions/workflows/docker.yml/badge.svg)](https://github.com/DMTF/Redfish-Mockup-Server/actions/workflows/docker.yml)
[![GitHub stars](https://img.shields.io/github/stars/DMTF/Redfish-Mockup-Server.svg?style=flat-square&label=github%20stars)](https://github.com/DMTF/Redfish-Mockup-Server)
[![GitHub Contributors](https://img.shields.io/github/contributors/DMTF/Redfish-Mockup-Server.svg?style=flat-square)](https://github.com/DMTF/Redfish-Mockup-Server/graphs/contributors)

Expand Down

0 comments on commit 6b400ec

Please sign in to comment.