Made build job dependent on pre-commit hooks

This commit is contained in:
Alejandro Angulo 2024-04-24 20:47:49 -07:00
parent d7569ea6e8
commit 61f3801647
Signed by: alejandro-angulo
GPG key ID: 75579581C74554B6

View file

@ -1,19 +1,6 @@
name: "Build" name: "Build"
on: [pull_request, push] on: [pull_request, push]
jobs: jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: cachix/install-nix-action@v25
- uses: cachix/cachix-action@v14
with:
name: alejandr0angul0-resume
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
- run: nix build
- run: nix flake check
- run: nix run
pre-commit-hooks: pre-commit-hooks:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
@ -33,3 +20,17 @@ jobs:
- name: Run pre-commit hooks - name: Run pre-commit hooks
run: nix develop --command -- pre-commit run --show-diff-on-failure --color=always --from-ref origin/main --to-ref "$GITHUB_SHA" run: nix develop --command -- pre-commit run --show-diff-on-failure --color=always --from-ref origin/main --to-ref "$GITHUB_SHA"
build:
needs: pre-commit-hooks
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: cachix/install-nix-action@v25
- uses: cachix/cachix-action@v14
with:
name: alejandr0angul0-resume
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
- run: nix build
- run: nix flake check
- run: nix run