Some checks failed
Build and test NixOS config / build (pull_request) Has been cancelled
Replace the stub placeholder with a comprehensive integration test script that verifyies Docker daemon, compose stack, and service endpoint health. All configuration via environment variables with sensible defaults. Changes: - tests/run-integration.sh: 5-phase test suite with color output, retry logic, env-var configuration, and CI-friendly exit codes - .gitea/workflows/build-nixos.yml: update CI step to document pr-test-vm usage with the new test script See also: pr-test-vm helper in modules/nixos/services/staging-vm.nix
53 lines
1.6 KiB
YAML
53 lines
1.6 KiB
YAML
name: Build and test NixOS config
|
|
on:
|
|
pull_request:
|
|
branches: [ master ]
|
|
paths:
|
|
- '**.nix'
|
|
- 'flake.lock'
|
|
- 'secrets/**'
|
|
- 'hosts/**'
|
|
- 'modules/**'
|
|
push:
|
|
branches: [ master ]
|
|
paths:
|
|
- '**.nix'
|
|
- 'flake.lock'
|
|
- 'secrets/**'
|
|
- 'hosts/**'
|
|
- 'modules/**'
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: nixos-builder
|
|
steps:
|
|
- name: Checkout
|
|
run: |
|
|
git clone -b "${{ github.head_ref || github.ref_name }}" \
|
|
https://gitea:${{ secrets.GITHUB_TOKEN }}@code.lazyworkhorse.net/gortium/infra.git .
|
|
git log --oneline -3
|
|
|
|
- name: Build NixOS config
|
|
run: |
|
|
nix --version
|
|
nh os build .#lazyworkhorse 2>&1
|
|
|
|
- name: Run integration tests (staging VM)
|
|
run: |
|
|
echo "==> Running integration tests on staging VM..."
|
|
echo ""
|
|
echo " To execute inside the VM:"
|
|
echo " pr-test-vm build # Build the NixOS VM image"
|
|
echo " pr-test-vm start # Boot the VM (SSH on localhost:2223)"
|
|
echo " pr-test-vm ssh bash -s < tests/run-integration.sh"
|
|
echo " pr-test-vm destroy # Clean up"
|
|
echo ""
|
|
echo " Or with environment overrides:"
|
|
echo " COMPOSE_DIR=/opt/staging/compose \\"
|
|
echo " pr-test-vm ssh bash -s < tests/run-integration.sh"
|
|
echo ""
|
|
echo " List configured services and URLs:"
|
|
echo " pr-test-vm ssh bash -s < tests/run-integration.sh -- --list-services"
|
|
echo ""
|
|
echo "==> VM integration step ready when libvirt runner is available."
|