headscale/.github/workflows/check-tests.yaml
Kristoffer Dalby 4e5e538903 ci: replace the integration workflow with the flake checks and a legacy pipeline
CI runs nix build .#checks.<system>.integration-* instead of the bespoke docker
matrix — the generated checks are the matrix. The tests the hermetic VM can't
run (real-internet DERP, docker cable-pull) run via cmd/hi in a slim legacy
workflow, which also keeps cmd/hi and the integration Dockerfiles exercised.
check-tests guards the pinned versions against capver drift.
2026-07-01 12:13:04 +00:00

59 lines
2.3 KiB
YAML

name: Check integration tests workflow
on: [pull_request]
concurrency:
group: ${{ github.workflow }}-$${{ github.head_ref || github.run_id }}
cancel-in-progress: true
defaults:
run:
shell: nix develop --fallback --command bash -e {0}
jobs:
check-tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
with:
fetch-depth: 2
- name: Get changed files
id: changed-files
uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2
with:
filters: |
files:
- '*.nix'
- 'go.*'
- '**/*.go'
- 'integration_test/'
- 'config-example.yaml'
- uses: NixOS/nix-installer-action@6b8548fe06acfb0155a50ab5d561accb215764cc # main
if: steps.changed-files.outputs.files == 'true'
- uses: Mic92/hestia/action@ff07bb902a9968ac0c3d0e51d90a606662a375d8 # main
if: steps.changed-files.outputs.files == 'true'
- name: Generate and check integration tests
if: steps.changed-files.outputs.files == 'true'
run: |
(cd .github/workflows && go generate)
git diff --exit-code integration/tests.nix integration/postgres-tests.nix integration/excluded-tests.json
- name: Show missing tests
if: failure()
run: |
git diff integration/tests.nix integration/postgres-tests.nix integration/excluded-tests.json
# The pinned tailscale images must match the versions the suite requests
# (MustTestVersions); a capver bump that isn't mirrored here makes the
# offline integration checks fail at runtime.
- name: Check tailscale version pins match capver
if: steps.changed-files.outputs.files == 'true'
run: |
want=$(nix develop --command go run ./cmd/hi list-versions --set=must --exclude=head | tr ' ' '\n' | sort)
have=$(jq -r '.images | keys[]' integration/tailscale-versions.json | sort)
if [ "$want" != "$have" ]; then
echo "::error::integration/tailscale-versions.json is stale vs capver; run 'update-integration-images' in the dev shell"
diff <(echo "$want") <(echo "$have") || true
exit 1
fi