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 0cbd747
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 18 deletions.
35 changes: 17 additions & 18 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,28 +7,27 @@ on:
- staging

jobs:
tests:
check:
name: Check Flake Outputs
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4.2.2
- uses: ./.github/workflows/setup-env.yml

- name: Free Disk Space
uses: jlumbroso/free-disk-space@v1.3.1
with:
tool-cache: true
- name: Flake Check
run: nix flake check

- name: Install Nix
uses: cachix/install-nix-action@v30
with:
extra_nix_config: |
allow-import-from-derivation = false
eval-cache = false
build:
name: Build Flake Outputs
runs-on: ubuntu-latest
strategy:
matrix:
outputs: ['nixosConfigurations.LAPTOP-3DT4F02.config.system.build.toplevel',
'nixosConfigurations.DESKTOP-3DT4F02.config.system.build.toplevel',
'nixosConfigurations.ISO-3DT4F02.config.system.build.isoImage']

- name: Run Flake Check
run: nix flake check
steps:
- uses: ./.github/workflows/setup-env.yml

- name: Build NixOS Configurations
- name: Flake Build
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'
nix build '.#${{ matrix.outputs }}'
24 changes: 24 additions & 0 deletions .github/workflows/setup-env.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Setup Nix Environment

on:
workflow_call:

jobs:
setup:
name: Prepare Environment
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4.2.2

- name: Free Disk Space
uses: jlumbroso/free-disk-space@v1.3.1
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

0 comments on commit 0cbd747

Please sign in to comment.