Skip to content

Commit

Permalink
.github/workflows: Improve pipeline with some parallel steps
Browse files Browse the repository at this point in the history
TODO
  • Loading branch information
Frontear committed Nov 26, 2024
1 parent a46dc2e commit d8b59d1
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 24 deletions.
30 changes: 30 additions & 0 deletions .github/workflows/.call-nix.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Call Nix

on:
workflow_call:
inputs:
cmd:
description: Command to invoke post-setup
required: true
type: string

jobs:
setup:
name: ${{ inputs.cmd }}
runs-on: ubuntu-latest
steps:
- name: Free Disk Space
uses: jlumbroso/[email protected]

- name: Checkout Repository
uses: actions/[email protected]

- name: Install Nix
uses: cachix/install-nix-action@v30
with:
extra_nix_config: |
allow-import-from-derivation = false
eval-cache = false
- name: Invoke Command
run: ${{ inputs.cmd }}
39 changes: 15 additions & 24 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,28 +7,19 @@ on:
- staging

jobs:
tests:
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]
check:
name: Check Flake Outputs
uses: ./.github/workflows/.call-nix.yml
with:
cmd: nix flake check

- name: Free Disk Space
uses: jlumbroso/[email protected]
with:
tool-cache: true

- name: Install Nix
uses: cachix/install-nix-action@v30
with:
extra_nix_config: |
allow-import-from-derivation = false
eval-cache = false
- name: Run Flake Check
run: nix flake check

- name: Build NixOS Configurations
run: |
nix build '.#nixosConfigurations.LAPTOP-3DT4F02.config.system.build.toplevel'
nix build '.#nixosConfigurations.DESKTOP-3DT4F02.config.system.build.toplevel'
nix build '.#nixosConfigurations.ISO-3DT4F02.config.system.build.isoImage'
build:
name: Build Flake Outputs
strategy:
matrix:
outputs: ['nixosConfigurations.LAPTOP-3DT4F02.config.system.build.toplevel',
'nixosConfigurations.DESKTOP-3DT4F02.config.system.build.toplevel',
'nixosConfigurations.ISO-3DT4F02.config.system.build.isoImage']
uses: ./.github/workflows/.call-nix.yml
with:
cmd: nix build '.#${{ matrix.outputs }}'

0 comments on commit d8b59d1

Please sign in to comment.