Skip to content

Test (main)

Test (main) #4

Workflow file for this run

name: Test
run-name: Test (${{ github.ref_name }})
on:
workflow_dispatch:
# push:
# branches:
# - main
# pull_request:
# branches:
# - main
jobs:
test:
runs-on: ubuntu-latest
permissions:
contents: read
strategy:
fail-fast: false
matrix:
include:
- mode: audit
proxy_mode: audit
test_dockerfile: test/Dockerfile.audit
assert_script: ./test/assert-audit-mode.sh
- mode: restrict
proxy_mode: restrict
test_dockerfile: test/Dockerfile.restrict
assert_script: ./test/assert-restrict-mode.sh
name: test (${{ matrix.mode }})
env:
COMPOSE_FILE: compose.yml:compose.test.yml
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Build containers
run: docker compose build
- name: Start containers
env:
PROXY_MODE: ${{ matrix.proxy_mode }}
run: docker compose up -d --wait
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
with:
driver: remote
endpoint: tcp://localhost:1234
- name: Build test image
uses: docker/build-push-action@v6
with:
context: test
file: ${{ matrix.test_dockerfile }}
push: false
no-cache: true
load: true
tags: buildcage-test
- name: Show logs
if: always()
run: ./report/report.sh || true
- name: Run assertions
run: ${{ matrix.assert_script }}
- name: Cleanup
if: always()
run: docker compose down -v --rmi all 2>/dev/null || true