Skip to content

Commit

Permalink
.github/workflows: Improve pipeline with some parallel steps
Browse files Browse the repository at this point in the history
In order to speed up the CI pipeline, we are parallelizing the builds. This does unfortunately re-perform a lot of the tasks, specifically the disk space free, which is arguably the second most lengthy step after the build itself. I cannot find out how to avoid this so at the moment this will be the best change we can do. If there are ways to "snapshot" an action's state and allow parallelization from that snapshot forwards, that could be cool. I know a VM/Container could do this, but I've no idea how to do that using GitHub Actions yaml logic.
  • Loading branch information
Frontear committed Nov 26, 2024
1 parent a46dc2e commit df7b1eb
Showing 1 changed file with 16 additions and 12 deletions.
28 changes: 16 additions & 12 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,28 +7,32 @@ on:
- staging

jobs:
tests:
test:
name: Test
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'
]
steps:
- uses: actions/checkout@v4.2.2

- name: Free Disk Space
uses: jlumbroso/free-disk-space@v1.3.1
with:
tool-cache: true

- name: Checkout Repository
uses: actions/checkout@v4.2.2

- 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
- 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'
- run:
nix build '.#${{ matrix.outputs }}'

0 comments on commit df7b1eb

Please sign in to comment.