diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..4f3169c --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,52 @@ +name: Flake Check CI +on: + workflow_dispatch: + push: + branches: [main] + paths-ignore: + - ".github/**" + - "*.md" + - justfile + pull_request: + branches: [main] + paths-ignore: + - ".github/**" + - "*.md" + - justfile +jobs: + check-eval: + name: Eval / Get Checks + runs-on: ubuntu-latest + outputs: + matrix: ${{ steps.checks-matrix.outputs.matrix }} + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + ref: ${{ github.head_ref }} + - name: Setup Nix + uses: DeterminateSystems/nix-installer-action@v16 + - name: Show Flake + run: nix flake show + - name: Output Checks Matrix + id: checks-matrix + run: | + echo "matrix=$(nix eval --json .#checks.x86_64-linux --apply "c: {check = (builtins.attrNames c);}")" >> $GITHUB_OUTPUT + run-checks: + name: Run Check + needs: check-eval + runs-on: ubuntu-latest + strategy: + matrix: ${{fromJSON(needs.check-eval.outputs.matrix)}} + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + ref: ${{ github.head_ref }} + - name: Setup Nix + uses: DeterminateSystems/nix-installer-action@v16 + - name: Run Check ${{matrix.check}} + run: nix build .#checks.x86_64-linux.${{matrix.check}} +