Skip to content

Commit

Permalink
ci: add test for attach-dependencies
Browse files Browse the repository at this point in the history
Signed-off-by: Emilien Escalle <emilien.escalle@escemi.com>
  • Loading branch information
neilime committed Jun 18, 2024
1 parent e5813a5 commit f7ac24c
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 6 deletions.
17 changes: 17 additions & 0 deletions .github/workflows/__check-action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -138,3 +138,20 @@ jobs:
with:
compose-file: "test/docker-compose-web-mysql.yml"
up-flags: "--build --abort-on-container-exit --exit-code-from=web"

test-attach-dependencies-failure:
runs-on: ubuntu-latest
name: Test with --attach-dependencies and service failure
steps:
- uses: actions/checkout@v4

- name: Act
uses: ./
with:
compose-file: "test/docker-compose-fail.yml"
up-flags: "--attach-dependencies"

- name: Assert
run: |
EXIT_CODE=$(docker compose -f ./test/docker-compose-fail.yml ps service-a --all --format json | jq ".ExitCode")
[ "$EXIT_CODE" == "1" ] || (echo "Service service-a did not exit with code 1" && exit 1)
4 changes: 4 additions & 0 deletions test/docker-compose-fail.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
services:
service-a:
image: busybox
command: ["sh", "-c", "exit 1"]
2 changes: 0 additions & 2 deletions test/docker-compose-with-env.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
version: "3.8"

volumes:
test_volume: {}

Expand Down
2 changes: 0 additions & 2 deletions test/docker-compose.ci.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
version: "3.8"

services:
service-d:
image: busybox
Expand Down
2 changes: 0 additions & 2 deletions test/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
version: "3.8"

services:
service-a:
image: busybox
Expand Down

0 comments on commit f7ac24c

Please sign in to comment.