Skip to content

Commit

Permalink
Split build steps
Browse files Browse the repository at this point in the history
  • Loading branch information
ThetaSinner committed Jun 4, 2024
1 parent 4cd4b43 commit c8cc54b
Showing 1 changed file with 22 additions and 10 deletions.
32 changes: 22 additions & 10 deletions .github/workflows/build-and-cache.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,24 @@ concurrency:
cancel-in-progress: true

jobs:
nix:
runs-on: ubuntu-latest

steps:
- name: Check out source code
uses: actions/checkout@v4

- name: Install nix
uses: cachix/install-nix-action@v27
with:
install_url: https://releases.nixos.org/nix/nix-2.22.1/install

- name: Check Nix formatting
run: nix fmt . -- --check

- name: Check Nix flake
run: nix flake check --all-systems

build:
strategy:
matrix:
Expand All @@ -24,27 +42,21 @@ jobs:
uses: actions/checkout@v4

- name: Install nix
uses: cachix/install-nix-action@v25
uses: cachix/install-nix-action@v27
with:
install_url: https://releases.nixos.org/nix/nix-2.18.0/install
install_url: https://releases.nixos.org/nix/nix-2.22.1/install

- name: Use GitHub cache
uses: DeterminateSystems/magic-nix-cache-action@main

- name: Check Nix formatting
run: nix fmt . -- --check

- name: Check Nix flake
run: nix flake check --all-systems

- name: Build nix package
run: nix build -L .#${{ matrix.package }}

- run: result/bin/${{ matrix.package }} --version

- name: Run nix app
run: nix run .#${{ matrix.package }} -- --version

- run: result/bin/${{ matrix.package }} --version

# - name: Setup tmate session
# if: failure()
# uses: mxschmitt/action-tmate@v3

0 comments on commit c8cc54b

Please sign in to comment.