feat: add CI workflow and integration test stub
Some checks failed
Build and test NixOS config / build (pull_request) Has been cancelled
Some checks failed
Build and test NixOS config / build (pull_request) Has been cancelled
This commit is contained in:
41
.gitea/workflows/build-nixos.yml
Normal file
41
.gitea/workflows/build-nixos.yml
Normal file
@@ -0,0 +1,41 @@
|
||||
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 "==> Deploying PR config to staging VM..."
|
||||
# TODO: pr-test-vm build && pr-test-vm start
|
||||
# TODO: scp test suite to VM, docker compose up, run tests
|
||||
# TODO: pr-test-vm destroy
|
||||
echo "Staging VM integration tests not yet implemented."
|
||||
Reference in New Issue
Block a user