From 5026cd31619c009dd39ee1cec78709cd71a2eb84 Mon Sep 17 00:00:00 2001 From: Jordan Dominion Date: Sat, 26 Jul 2025 10:47:20 -0400 Subject: [PATCH] Update nix setup, add flake validation job --- .github/workflows/ci-pipeline.yml | 26 ++++++++++++++++++++++++++ .github/workflows/nix-deployment.yml | 2 +- build/package/nix/flake.nix | 1 + 3 files changed, 28 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci-pipeline.yml b/.github/workflows/ci-pipeline.yml index 19794e284a..cd6ce47071 100644 --- a/.github/workflows/ci-pipeline.yml +++ b/.github/workflows/ci-pipeline.yml @@ -93,6 +93,31 @@ jobs: name: release_notes_bins path: ./release_notes_bins/ + validate-nix-flake: + name: Validate Nix Flake + needs: start-gate + runs-on: ubuntu-latest + steps: + - name: Setup Nix + uses: cachix/install-nix-action@v31 + with: + nix_path: nixpkgs=channel:nixos-unstable + + - name: Checkout (Branch) + uses: actions/checkout@v4 + if: github.event_name == 'push' || github.event_name == 'schedule' + + - name: Checkout (PR Merge) + uses: actions/checkout@v4 + if: github.event_name != 'push' && github.event_name != 'schedule' + with: + ref: "refs/pull/${{ inputs.pull_request_number }}/merge" + + - name: Check Flake + run: | + cd build/package/nix + nix flake check + code-scanning: name: Run CodeQL needs: start-gate @@ -1695,6 +1720,7 @@ jobs: check-winget-pr-template, efcore-version-match, code-scanning, + validate-nix-flake, ] runs-on: ubuntu-latest steps: diff --git a/.github/workflows/nix-deployment.yml b/.github/workflows/nix-deployment.yml index 16c62fe453..470913346e 100644 --- a/.github/workflows/nix-deployment.yml +++ b/.github/workflows/nix-deployment.yml @@ -15,7 +15,7 @@ jobs: sudo apt-get install -y xmlstarlet - name: Setup Nix - uses: cachix/install-nix-action@v30 + uses: cachix/install-nix-action@v31 with: nix_path: nixpkgs=channel:nixos-unstable diff --git a/build/package/nix/flake.nix b/build/package/nix/flake.nix index f2bf8c14a9..16c7c70a89 100644 --- a/build/package/nix/flake.nix +++ b/build/package/nix/flake.nix @@ -9,5 +9,6 @@ imports = [ ./tgstation-server.nix ]; }; }; + checks.x86_64-linux.flake-build = self.packages.x86_64-linux.default; }; }