Skip to content

Commit

Permalink
Honor docker-compose exit codes
Browse files Browse the repository at this point in the history
  • Loading branch information
mamercad committed Oct 5, 2022
1 parent 9609a00 commit 51f5d92
Showing 1 changed file with 18 additions and 2 deletions.
20 changes: 18 additions & 2 deletions .github/workflows/st2-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ jobs:

docker-compose-up:
runs-on: ubuntu-latest
needs: [docker-compose-lint]
steps:
- uses: actions/checkout@v3

Expand All @@ -32,14 +33,29 @@ jobs:
run: |
docker-compose up --detach
- name: Run st2 smoke-tests
- name: Sleep
run: |
sleep 60
docker-compose -f tests/st2tests.yaml up
- name: Run st2 smoke-tests
run: |
docker-compose --file tests/st2tests.yaml up --no-color 2>&1 \
| tee /tmp/compose.log
rc="$(grep -q 'tests_st2test-tools_1 exited with code 0' /tmp/compose.log 2>/dev/null; echo $?)"
if [[ $rc -ne 0 ]]; then
exit 1
fi
rc="$(grep -q 'tests_st2test_1 exited with code 0' /tmp/compose.log 2>/dev/null; echo $?)"
if [[ $rc -ne 0 ]]; then
exit 1
fi
- name: Troubleshooting the build failure
if: ${{ failure() }}
run: |
docker-compose ps
# Display logs to help troubleshoot build failures, etc
docker-compose logs --tail="500" st2api
exit 1

0 comments on commit 51f5d92

Please sign in to comment.