Changed lint job to use nix develop

Since the pre-commit hooks are managed by devenv, the
`.pre-commit-config.yaml` file isn't part of the repo anymore (it's
generated by devenv).
This commit is contained in:
Alejandro Angulo 2024-04-27 22:23:09 -07:00
parent 8a676ecdd8
commit 88637aaae4
Signed by: alejandro-angulo
GPG key ID: 75579581C74554B6

View file

@ -5,21 +5,19 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
- uses: cachix/install-nix-action@v22
- uses: cachix/cachix-action@v12
with: with:
fetch-depth: 0 name: devenv
- uses: cachix/cachix-action@v12
- uses: cachix/install-nix-action@v25
- run: echo "PY=$(python -VV | sha256sum | cut -d' ' -f1)" >> $GITHUB_ENV
- name: Cache pre-commit environment
uses: actions/cache@v3
with: with:
path: ~/.cache/pre-commit name: alejandr0angul0-dev
key: pre-commit-${{ env.PY }}-${{ hashFiles('.pre-commit-config.yaml') }} authToken: "${{ secrets.CACHIX_AUTH_TOKEN }}"
- 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: |
git fetch origin
nix develop --accept-flake-config --impure --command bash -c \
"pre-commit run --from-ref origin/main --to-ref $GITHUB_SHA"
build: build:
needs: pre-commit-hooks needs: pre-commit-hooks