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:
committed by
Hunter Halloran
parent
631e1a4037
commit
be575d4898
48
.github/workflows/ci.yml
vendored
48
.github/workflows/ci.yml
vendored
@@ -14,41 +14,21 @@ permissions:
|
||||
jobs:
|
||||
flake-check:
|
||||
name: Flake Check
|
||||
runs-on: ubuntu-latest
|
||||
runs-on: [self-hosted, nix-builder]
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
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
|
||||
run: nix flake check --show-trace --print-build-logs
|
||||
|
||||
format-check:
|
||||
name: Format Check
|
||||
runs-on: ubuntu-latest
|
||||
runs-on: [self-hosted, nix-builder]
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
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
|
||||
run: |
|
||||
nix fmt **/*.nix
|
||||
@@ -60,7 +40,7 @@ jobs:
|
||||
|
||||
build-configs:
|
||||
name: Build Key Configurations
|
||||
runs-on: ubuntu-latest
|
||||
runs-on: [self-hosted, nix-builder]
|
||||
strategy:
|
||||
matrix:
|
||||
config:
|
||||
@@ -72,16 +52,6 @@ jobs:
|
||||
- name: Checkout repository
|
||||
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
|
||||
run: |
|
||||
echo "Building configuration for ${{ matrix.config }}"
|
||||
@@ -91,7 +61,7 @@ jobs:
|
||||
|
||||
build-artifacts:
|
||||
name: Build Artifacts
|
||||
runs-on: ubuntu-latest
|
||||
runs-on: [self-hosted, nix-builder]
|
||||
strategy:
|
||||
matrix:
|
||||
artifact:
|
||||
@@ -102,16 +72,6 @@ jobs:
|
||||
- name: Checkout repository
|
||||
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
|
||||
run: |
|
||||
echo "Building artifact ${{ matrix.artifact }}"
|
||||
|
||||
@@ -66,7 +66,7 @@ sudo nixos-rebuild build --flake .
|
||||
|
||||
## 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
|
||||
|
||||
@@ -116,9 +116,14 @@ nix build .#nixosConfigurations.nix-builder.config.system.build.toplevel
|
||||
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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user