From be575d489884225d114e284101ee8b4195b2fb33 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 17 Dec 2025 15:14:34 +0000 Subject: [PATCH] feat: Configure CI to run on self-hosted nix-builder runner Co-authored-by: Jyumpp <11142390+Jyumpp@users.noreply.github.com> --- .github/workflows/ci.yml | 48 ++++------------------------------------ docs/DEVELOPMENT.md | 11 ++++++--- 2 files changed, 12 insertions(+), 47 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4b3b2f2..b5244f7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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 }}" diff --git a/docs/DEVELOPMENT.md b/docs/DEVELOPMENT.md index 0b7d946..31f7655 100644 --- a/docs/DEVELOPMENT.md +++ b/docs/DEVELOPMENT.md @@ -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