Skip to content

fix(k8s-watcher): detect in-place Ingress changes (hash content, not … #66

fix(k8s-watcher): detect in-place Ingress changes (hash content, not …

fix(k8s-watcher): detect in-place Ingress changes (hash content, not … #66

Workflow file for this run

name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
env:
CARGO_TERM_COLOR: always
# Treat all warnings as errors — no silent issues
RUSTFLAGS: "-D warnings"
jobs:
check:
name: Lint
runs-on: ubuntu-latest
steps:
- name: Checkout gateway
uses: actions/checkout@v4
with:
path: gateway
- name: Checkout monorepo (path dependencies)
env:
GH_TOKEN: ${{ github.token }}
run: |
git clone --depth=1 https://x-access-token:${GH_TOKEN}@github.com/A3S-Lab/ACL.git acl
git clone --depth=1 --filter=blob:none --sparse https://x-access-token:${GH_TOKEN}@github.com/A3S-Lab/a3s.git _monorepo
cd _monorepo && git sparse-checkout set crates/updater && cd ..
cp -a _monorepo/crates/updater updater
rm -rf _monorepo
- uses: dtolnay/rust-toolchain@stable
with:
components: clippy, rustfmt
- uses: Swatinem/rust-cache@v2
with:
workspaces: gateway
- name: Check formatting
working-directory: gateway
run: cargo fmt --all -- --check
- name: Clippy (default features)
working-directory: gateway
run: cargo clippy --lib --bins --tests -- -D warnings
- name: Clippy (all features)
working-directory: gateway
run: cargo clippy --all-features --lib --bins --tests -- -D warnings
test:
name: Test
runs-on: ubuntu-latest
needs: check
steps:
- name: Checkout gateway
uses: actions/checkout@v4
with:
path: gateway
- name: Checkout monorepo (path dependencies)
env:
GH_TOKEN: ${{ github.token }}
run: |
git clone --depth=1 https://x-access-token:${GH_TOKEN}@github.com/A3S-Lab/ACL.git acl
git clone --depth=1 --filter=blob:none --sparse https://x-access-token:${GH_TOKEN}@github.com/A3S-Lab/a3s.git _monorepo
cd _monorepo && git sparse-checkout set crates/updater && cd ..
cp -a _monorepo/crates/updater updater
rm -rf _monorepo
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
with:
workspaces: gateway
- name: Build (default features)
working-directory: gateway
run: cargo build --lib --bins
- name: Build (all features)
working-directory: gateway
run: cargo build --all-features --lib --bins
- name: Test (default features)
working-directory: gateway
run: |
set -euo pipefail
output=$(cargo test --lib 2>&1)
echo "$output"
# Refuse silent zero-test passes
if ! echo "$output" | grep -q "test result: ok"; then
echo "::error::No 'test result: ok' found. Tests may not have run."
exit 1
fi
# Verify tests actually executed (not all 0)
total_passed=$(echo "$output" | grep -oE '[0-9]+ passed' | awk '{s+=$1} END {print s+0}')
if [ "$total_passed" -eq 0 ]; then
echo "::error::Zero tests passed. Refusing silent success."
exit 1
fi
echo "Default feature tests passed ($total_passed tests)."
- name: Test (all features)
working-directory: gateway
run: |
set -euo pipefail
output=$(cargo test --all-features --lib 2>&1)
echo "$output"
if ! echo "$output" | grep -q "test result: ok"; then
echo "::error::No 'test result: ok' found. Tests may not have run."
exit 1
fi
total_passed=$(echo "$output" | grep -oE '[0-9]+ passed' | awk '{s+=$1} END {print s+0}')
if [ "$total_passed" -eq 0 ]; then
echo "::error::Zero tests passed. Refusing silent success."
exit 1
fi
echo "All-features tests passed ($total_passed tests)."
build-release:
name: Release Build
runs-on: ubuntu-latest
needs: test
steps:
- name: Checkout gateway
uses: actions/checkout@v4
with:
path: gateway
- name: Checkout monorepo (path dependencies)
env:
GH_TOKEN: ${{ github.token }}
run: |
git clone --depth=1 https://x-access-token:${GH_TOKEN}@github.com/A3S-Lab/ACL.git acl
git clone --depth=1 --filter=blob:none --sparse https://x-access-token:${GH_TOKEN}@github.com/A3S-Lab/a3s.git _monorepo
cd _monorepo && git sparse-checkout set crates/updater && cd ..
cp -a _monorepo/crates/updater updater
rm -rf _monorepo
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
with:
workspaces: gateway
- name: Build release binary
working-directory: gateway
run: cargo build --release --all-features
msrv:
name: MSRV Check
runs-on: ubuntu-latest
steps:
- name: Checkout gateway
uses: actions/checkout@v4
with:
path: gateway
- name: Checkout monorepo (path dependencies)
env:
GH_TOKEN: ${{ github.token }}
run: |
git clone --depth=1 https://x-access-token:${GH_TOKEN}@github.com/A3S-Lab/ACL.git acl
git clone --depth=1 --filter=blob:none --sparse https://x-access-token:${GH_TOKEN}@github.com/A3S-Lab/a3s.git _monorepo
cd _monorepo && git sparse-checkout set crates/updater && cd ..
cp -a _monorepo/crates/updater updater
rm -rf _monorepo
- uses: dtolnay/rust-toolchain@1.88
- uses: Swatinem/rust-cache@v2
with:
workspaces: gateway
- name: Check MSRV (1.88)
working-directory: gateway
run: cargo check --all-features
bench-check:
name: Benchmark Compile
runs-on: ubuntu-latest
needs: check
steps:
- name: Checkout gateway
uses: actions/checkout@v4
with:
path: gateway
- name: Checkout monorepo (path dependencies)
env:
GH_TOKEN: ${{ github.token }}
run: |
git clone --depth=1 https://x-access-token:${GH_TOKEN}@github.com/A3S-Lab/ACL.git acl
git clone --depth=1 --filter=blob:none --sparse https://x-access-token:${GH_TOKEN}@github.com/A3S-Lab/a3s.git _monorepo
cd _monorepo && git sparse-checkout set crates/updater && cd ..
cp -a _monorepo/crates/updater updater
rm -rf _monorepo
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
with:
workspaces: gateway
- name: Compile benchmarks (no run)
working-directory: gateway
run: cargo bench --no-run --all-features
doc-check:
name: Documentation
runs-on: ubuntu-latest
needs: check
steps:
- name: Checkout gateway
uses: actions/checkout@v4
with:
path: gateway
- name: Checkout monorepo (path dependencies)
env:
GH_TOKEN: ${{ github.token }}
run: |
git clone --depth=1 https://x-access-token:${GH_TOKEN}@github.com/A3S-Lab/ACL.git acl
git clone --depth=1 --filter=blob:none --sparse https://x-access-token:${GH_TOKEN}@github.com/A3S-Lab/a3s.git _monorepo
cd _monorepo && git sparse-checkout set crates/updater && cd ..
cp -a _monorepo/crates/updater updater
rm -rf _monorepo
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
with:
workspaces: gateway
- name: Build docs (fail on warnings)
working-directory: gateway
env:
RUSTDOCFLAGS: "-D warnings"
run: cargo doc --all-features --no-deps