Repository navigation
112 lines (90 loc) · 4.26 KB
/
Copy pathci.yml
File metadata and controls
112 lines (90 loc) · 4.26 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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
name: ci
# Manual dispatch only. No other trigger.
on:
workflow_dispatch:
permissions:
contents: read
jobs:
check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Assert python3 and openssl exist (the matrix must not skip silently)
run: |
command -v python3
command -v openssl
python3 --version
openssl version
- name: Kubernetes manifest validator and its mutation tests
run: |
python3 -c 'import yaml' 2>/dev/null || python3 -m pip install --user pyyaml
python3 deploy/k8s/validate_manifests.py
python3 deploy/k8s/test_validate_manifests.py
- uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt, clippy
- name: Format
run: cargo fmt --all --check
- name: Clippy
run: cargo clippy --workspace --all-targets -- -D warnings
- name: Clippy (stage1-probe)
run: cargo clippy -p ap-proxy --all-targets --features stage1-probe -- -D warnings
- name: Clippy (matrix-upstream)
run: cargo clippy -p ap-proxy --all-targets --features matrix-upstream,stage1-probe -- -D warnings
- name: Unit and integration tests
run: cargo test --workspace
- name: Unit tests (stage1-probe)
run: cargo test -p ap-proxy --features stage1-probe --lib
- name: Release build (default features; the matrix-upstream feature stays off)
run: cargo build --release -p ap-proxy -p ap-egress -p ap-runtime-shim -p ap-netprobe
- name: Release binaries carry no test hooks
run: |
if grep -q __ap_probe target/release/auth-proxy; then
echo "probe route string found in the release auth-proxy"; exit 1
fi
if grep -q __ap_test_panic target/release/auth-proxy; then
echo "panic-injection string found in the release auth-proxy"; exit 1
fi
if grep -q AP_TEST_HOLD_PAUSE target/release/auth-proxy; then
echo "hold-pause test hook string found in the release auth-proxy"; exit 1
fi
if grep -q AP_TEST_UPSTREAM_CA target/release/auth-proxy; then
echo "test hook strings found in the release auth-proxy"; exit 1
fi
if grep -q AP_TEST_EGRESS_RESOLVE target/release/ap-egress; then
echo "test hook strings found in the release ap-egress"; exit 1
fi
if grep -q AP_TEST_UPSTREAM_CA target/release/ap-runtime-shim; then
echo "test hook strings found in the release ap-runtime-shim"; exit 1
fi
- name: ap-egress does not depend on ap-broker
run: |
if cargo tree -p ap-egress -i ap-broker >/dev/null 2>&1; then
echo "ap-broker is in the ap-egress dependency graph"; exit 1
fi
- name: Build test binaries (matrix-upstream feature; debug profile, default target dir)
run: cargo build -p ap-proxy -p ap-egress --features ap-proxy/matrix-upstream,ap-proxy/stage1-probe,ap-egress/matrix-upstream
- name: Matrix cargo target (fails unless every row is PASS)
run: cargo test -p ap-proxy --features matrix-upstream --test matrix
- name: Fail-closed matrix driver (writes matrix.json and matrix.txt)
run: |
set -o pipefail
python3 tests/matrix/matrix.py --bin target/debug --json matrix.json | tee matrix.txt
- name: Build the matrix binary without stage1-probe (separate target dir)
run: CARGO_TARGET_DIR=target/noprobe cargo build -p ap-proxy --features matrix-upstream
- name: Passthrough matrix cargo target (Muse gate; both builds)
run: AP_MATRIX_NOPROBE_BIN="$PWD/target/noprobe/debug" cargo test -p ap-proxy --features matrix-upstream,stage1-probe --test matrix_passthrough
- name: Passthrough matrix driver (writes matrix-pt.json and matrix-pt.txt)
run: |
set -o pipefail
python3 tests/matrix/passthrough.py --bin target/debug --noprobe-bin target/noprobe/debug --json matrix-pt.json | tee matrix-pt.txt
- name: Upload matrix results
if: always()
uses: actions/upload-artifact@v4
with:
name: matrix
path: |
matrix.json
matrix.txt
matrix-pt.json
matrix-pt.txt