Files
headscale/.github/workflows/nix-module-test.yml
T
Kristoffer Dalby 4185b2481c nix: check the policy at build time and the config before a switch
Store-path policy: check policy -f in system.checks.
Pre-switch: check all as the headscale user.
Adapted: no file: secret warning; groups as after activation; a new primary
group skips; the policy the unit's env selects; docs say which check covers
the policy; VM case for the unit's env.

(cherry picked from commit b6ba6e42ee)

Fixes #2898
Updates #1926
2026-11-11 12:19:29 +01:00

53 lines
1.5 KiB
YAML

name: NixOS Module Tests
on:
push:
branches:
- main
pull_request:
branches:
- main
concurrency:
group: ${{ github.workflow }}-$${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
nix-module-check:
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
fetch-depth: 2
- name: Get changed files
id: changed-files
uses: dorny/paths-filter@ceb8a2b8f2d89434be7ff52d3de7ec3738c5cc9d # v4.0.3
with:
filters: |
nix:
- 'nix/**'
- 'flake.nix'
- 'flake.lock'
- 'flakehashes.json'
go:
- 'go.*'
- '**/*.go'
- 'cmd/**'
- 'hscontrol/**'
- uses: NixOS/nix-installer-action@62c1943b776c509394b550f3f983adc14e9212d6 # main
if: steps.changed-files.outputs.nix == 'true' || steps.changed-files.outputs.go == 'true'
- uses: Mic92/hestia@dfed9ced335d28978ba74e513939a10db1f71025 # v3.1.0
if: steps.changed-files.outputs.nix == 'true' || steps.changed-files.outputs.go == 'true'
- name: Run NixOS module tests
if: steps.changed-files.outputs.nix == 'true' || steps.changed-files.outputs.go == 'true'
run: |
echo "Running NixOS module integration test..."
nix build .#checks.x86_64-linux.headscale .#checks.x86_64-linux.headscale-checks -L --fallback