summaryrefslogtreecommitdiff
path: root/.github/workflows/nix.yaml
diff options
context:
space:
mode:
Diffstat (limited to '.github/workflows/nix.yaml')
-rw-r--r--.github/workflows/nix.yaml64
1 files changed, 64 insertions, 0 deletions
diff --git a/.github/workflows/nix.yaml b/.github/workflows/nix.yaml
new file mode 100644
index 0000000..4427afa
--- /dev/null
+++ b/.github/workflows/nix.yaml
@@ -0,0 +1,64 @@
+name: Nix
+
+on:
+ push:
+ branches: [main]
+ pull_request:
+ workflow_dispatch:
+
+jobs:
+ build:
+ name: Build
+
+ strategy:
+ fail-fast: false
+ matrix:
+ os: [ubuntu-latest, macos-latest]
+
+ runs-on: ${{ matrix.os }}
+
+ steps:
+ - name: Checkout repository
+ uses: actions/checkout@v4
+
+ - name: Install Nix
+ uses: DeterminateSystems/nix-installer-action@v10
+
+ - name: Setup Nix cache
+ uses: DeterminateSystems/magic-nix-cache-action@v4
+
+ - name: Run build
+ run: nix build --fallback --print-build-logs
+
+ check:
+ name: Check flake
+
+ runs-on: ubuntu-latest
+
+ steps:
+ - name: Checkout repository
+ uses: actions/checkout@v4
+
+ - name: Install Nix
+ uses: DeterminateSystems/nix-installer-action@v10
+
+ - name: Setup Nix cache
+ uses: DeterminateSystems/magic-nix-cache-action@v4
+
+ - name: Run nix flake check
+ run: |
+ nix flake check \
+ --all-systems \
+ --fallback \
+ --print-build-logs \
+ --show-trace
+
+ release-gate:
+ name: Nix Release Gate
+ needs: [build, check]
+
+ runs-on: ubuntu-latest
+
+ steps:
+ - name: Exit with result
+ run: echo "We're good to go!"