Skip to content

Commit

Permalink
feat(ci): add task to check formatting before building
Browse files Browse the repository at this point in the history
  • Loading branch information
cfcosta committed Jul 21, 2024
1 parent 2a16728 commit 2020b93
Showing 1 changed file with 27 additions and 4 deletions.
31 changes: 27 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,42 @@
name: Build

on:
push:
branches: [ main ]
pull_request:
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

0 comments on commit 2020b93

Please sign in to comment.