Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Honor docker-compose exit codes #252

Merged
merged 8 commits into from
Oct 6, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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]
mamercad marked this conversation as resolved.
Show resolved Hide resolved
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 \
mamercad marked this conversation as resolved.
Show resolved Hide resolved
| 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