mirror of
https://github.com/hoverkraft-tech/compose-action.git
synced 2026-01-08 21:53:06 +08:00
ci: add test for attach-dependencies
Signed-off-by: Emilien Escalle <emilien.escalle@escemi.com>
This commit is contained in:
parent
e5813a5909
commit
f7ac24c0d1
17
.github/workflows/__check-action.yml
vendored
17
.github/workflows/__check-action.yml
vendored
@ -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
test/docker-compose-fail.yml
Normal file
4
test/docker-compose-fail.yml
Normal file
@ -0,0 +1,4 @@
|
||||
services:
|
||||
service-a:
|
||||
image: busybox
|
||||
command: ["sh", "-c", "exit 1"]
|
||||
@ -1,5 +1,3 @@
|
||||
version: "3.8"
|
||||
|
||||
volumes:
|
||||
test_volume: {}
|
||||
|
||||
|
||||
@ -1,5 +1,3 @@
|
||||
version: "3.8"
|
||||
|
||||
services:
|
||||
service-d:
|
||||
image: busybox
|
||||
|
||||
@ -1,5 +1,3 @@
|
||||
version: "3.8"
|
||||
|
||||
services:
|
||||
service-a:
|
||||
image: busybox
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user