Skip to content

Fix failure exit code regression #138

Fix failure exit code regression

Fix failure exit code regression #138

Workflow file for this run

name: Push
on:
push: {}
pull_request:
branches: [ main ]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch: {}
jobs:
cljs-tests:
name: Run CLJS tests
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4
with: { submodules: 'recursive', fetch-depth: 0 }
- name: Install NPM
run: npm install
- name: Run Tests
run: ./test/runtests
test-examples:
name: Test Examples
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4
with: { submodules: 'recursive', fetch-depth: 0 }
- name: Build Image
run: |
docker build -t dctest .
- name: Setup Fixtures
run: |
docker compose -f examples/docker-compose.yaml up -d
- name: Install NPM (for schema validation)
run: npm install
- name: Run Intro Examples
run: |
docker run --rm \
-v /var/run/docker.sock:/var/run/docker.sock \
-v $(pwd)/examples:/app/examples \
dctest --results-file /app/examples/results.json examples /app/examples/00-intro.yaml
jq --exit-status '[.summary.passed == 5, .summary.failed == 0] | all' examples/results.json
node ./scripts/validateSchema.js examples/results.json schemas/results-file.yaml
- name: Run Intro + Fail Examples with --continue-on-error
run: |
exitcode=$(docker run --rm \
-v /var/run/docker.sock:/var/run/docker.sock \
-v $(pwd)/examples:/app/examples \
dctest --continue-on-error --results-file /app/examples/results.json examples /app/examples/00-intro.yaml /app/examples/01-fails.yaml \
&& echo "$?" || echo "$?")
if [ "${exitcode}" != "1" ]; then
echo "dctest exited ${exitcode} instead of code 1 on failure"
exit 1
fi
jq --exit-status '[.summary.passed == 6, .summary.failed == 4] | all' examples/results.json
node ./scripts/validateSchema.js examples/results.json schemas/results-file.yaml
- name: Run Dependency Examples
run: |
docker run --rm \
-v /var/run/docker.sock:/var/run/docker.sock \
-v $(pwd)/examples:/app/examples \
dctest --results-file /app/examples/results.json examples /app/examples/02-deps.yaml
jq --exit-status '[.summary.passed == 12, .summary.failed == 0] | all' examples/results.json
node ./scripts/validateSchema.js examples/results.json schemas/results-file.yaml
- name: Setup Fixtures
if: always()
run: |
docker compose -f examples/docker-compose.yaml down -t 1 --remove-orphans