-
-
Notifications
You must be signed in to change notification settings - Fork 0
83 lines (68 loc) · 1.92 KB
/
test.yml
File metadata and controls
83 lines (68 loc) · 1.92 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
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
endpoint_port: 1234
- mode: restrict
proxy_mode: restrict
test_dockerfile: test/Dockerfile.restrict
assert_script: ./test/assert-restrict-mode.sh
endpoint_port: 1235
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 }}
PORT: ${{ matrix.endpoint_port }}
run: docker compose up -d --wait
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
with:
driver: remote
endpoint: tcp://localhost:${{ matrix.endpoint_port }}
- name: Build test image
uses: docker/build-push-action@v6
env:
DOCKER_BUILD_CHECKS_ANNOTATIONS: false
DOCKER_BUILD_SUMMARY: false
DOCKER_BUILD_RECORD_UPLOAD: false
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