From 15496fbc43f533b4b92ccac767e07cc3004c150f Mon Sep 17 00:00:00 2001 From: Ali Rizvi Date: Tue, 26 Nov 2024 15:45:51 -0500 Subject: [PATCH] .github/workflows: Improve pipeline with some parallel steps In order to speed up the CI pipeline, we are parallelizing the builds. --- .github/workflows/build.yml | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 77021d2..34dfbf2 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -7,16 +7,23 @@ on: - staging jobs: - tests: + test: + name: Check + Build 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: @@ -24,11 +31,8 @@ jobs: 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 }}'