From 2020b93866e72d74456190a65d0890902263ddfa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cain=C3=A3=20Costa?= Date: Sun, 21 Jul 2024 16:03:35 -0300 Subject: [PATCH] feat(ci): add task to check formatting before building --- .github/workflows/build.yml | 31 +++++++++++++++++++++++++++---- 1 file changed, 27 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 6f66e62..8e7cea4 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,5 +1,4 @@ name: Build - on: push: branches: [ main ] @@ -7,13 +6,37 @@ on: branches: [ main ] jobs: + matrix-setup: + runs-on: ubuntu-latest + outputs: + matrix: ${{ steps.set-matrix.outputs.matrix }} + steps: + - id: set-matrix + run: | + echo "matrix=$(jq -c . << EOF + { + "os": ["ubuntu-latest", "macos-latest"] + } + EOF)" >> $GITHUB_OUTPUT + + check: + needs: matrix-setup + runs-on: ${{ matrix.os }} + strategy: + matrix: ${{fromJson(needs.matrix-setup.outputs.matrix)}} + steps: + - uses: actions/checkout@v3 + - uses: DeterminateSystems/nix-installer-action@main + - uses: DeterminateSystems/magic-nix-cache-action@main + - run: nix flake check + build: + needs: [matrix-setup, check] runs-on: ${{ matrix.os }} strategy: - matrix: - os: [ubuntu-latest, macos-latest] + matrix: ${{fromJson(needs.matrix-setup.outputs.matrix)}} steps: - uses: actions/checkout@v3 - uses: DeterminateSystems/nix-installer-action@main - uses: DeterminateSystems/magic-nix-cache-action@main - - run: nix build .#mugraph-node + - run: nix build .#mugraph-node \ No newline at end of file