feat: Configure CI to run on self-hosted nix-builder runner

Co-authored-by: Jyumpp <11142390+Jyumpp@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot]
2025-12-17 15:14:34 +00:00
committed by Hunter Halloran
parent 631e1a4037
commit be575d4898
2 changed files with 12 additions and 47 deletions

View File

@@ -14,41 +14,21 @@ permissions:
jobs: jobs:
flake-check: flake-check:
name: Flake Check name: Flake Check
runs-on: ubuntu-latest runs-on: [self-hosted, nix-builder]
steps: steps:
- name: Checkout repository - name: Checkout repository
uses: actions/checkout@v4 uses: actions/checkout@v4
- name: Install Nix
uses: DeterminateSystems/nix-installer-action@main
with:
extra-conf: |
experimental-features = nix-command flakes
accept-flake-config = true
- name: Setup Nix cache
uses: DeterminateSystems/magic-nix-cache-action@main
- name: Check flake - name: Check flake
run: nix flake check --show-trace --print-build-logs run: nix flake check --show-trace --print-build-logs
format-check: format-check:
name: Format Check name: Format Check
runs-on: ubuntu-latest runs-on: [self-hosted, nix-builder]
steps: steps:
- name: Checkout repository - name: Checkout repository
uses: actions/checkout@v4 uses: actions/checkout@v4
- name: Install Nix
uses: DeterminateSystems/nix-installer-action@main
with:
extra-conf: |
experimental-features = nix-command flakes
accept-flake-config = true
- name: Setup Nix cache
uses: DeterminateSystems/magic-nix-cache-action@main
- name: Check formatting - name: Check formatting
run: | run: |
nix fmt **/*.nix nix fmt **/*.nix
@@ -60,7 +40,7 @@ jobs:
build-configs: build-configs:
name: Build Key Configurations name: Build Key Configurations
runs-on: ubuntu-latest runs-on: [self-hosted, nix-builder]
strategy: strategy:
matrix: matrix:
config: config:
@@ -72,16 +52,6 @@ jobs:
- name: Checkout repository - name: Checkout repository
uses: actions/checkout@v4 uses: actions/checkout@v4
- name: Install Nix
uses: DeterminateSystems/nix-installer-action@main
with:
extra-conf: |
experimental-features = nix-command flakes
accept-flake-config = true
- name: Setup Nix cache
uses: DeterminateSystems/magic-nix-cache-action@main
- name: Build configuration - name: Build configuration
run: | run: |
echo "Building configuration for ${{ matrix.config }}" echo "Building configuration for ${{ matrix.config }}"
@@ -91,7 +61,7 @@ jobs:
build-artifacts: build-artifacts:
name: Build Artifacts name: Build Artifacts
runs-on: ubuntu-latest runs-on: [self-hosted, nix-builder]
strategy: strategy:
matrix: matrix:
artifact: artifact:
@@ -102,16 +72,6 @@ jobs:
- name: Checkout repository - name: Checkout repository
uses: actions/checkout@v4 uses: actions/checkout@v4
- name: Install Nix
uses: DeterminateSystems/nix-installer-action@main
with:
extra-conf: |
experimental-features = nix-command flakes
accept-flake-config = true
- name: Setup Nix cache
uses: DeterminateSystems/magic-nix-cache-action@main
- name: Build artifact - name: Build artifact
run: | run: |
echo "Building artifact ${{ matrix.artifact }}" echo "Building artifact ${{ matrix.artifact }}"

View File

@@ -66,7 +66,7 @@ sudo nixos-rebuild build --flake .
## Continuous Integration ## Continuous Integration
The repository uses GitHub Actions for automated testing and validation. The repository uses GitHub Actions for automated testing and validation. CI jobs run on the self-hosted `nix-builder` machine via SSH.
### CI Workflow ### CI Workflow
@@ -116,9 +116,14 @@ nix build .#nixosConfigurations.nix-builder.config.system.build.toplevel
nix build .#lxc-nix-builder nix build .#lxc-nix-builder
``` ```
### CI Caching ### Self-Hosted Runner
The CI workflow uses [Magic Nix Cache](https://github.com/DeterminateSystems/magic-nix-cache-action) to speed up builds by caching Nix store paths between runs. This significantly reduces build times for repeated builds. CI jobs run on the `nix-builder` host as a self-hosted GitHub Actions runner. This provides:
- Native Nix environment without installation overhead
- Access to local Nix store for faster builds
- Consistent build environment matching deployment targets
- Direct access to build caching infrastructure
### Troubleshooting CI Failures ### Troubleshooting CI Failures