From 88637aaae43fcdf4b89a036da4714ee0d998f4ac Mon Sep 17 00:00:00 2001 From: Alejandro Angulo Date: Sat, 27 Apr 2024 22:23:09 -0700 Subject: [PATCH] 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). --- .github/workflows/build.yml | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c5c898c..309adfd 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -5,21 +5,19 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 + - uses: cachix/install-nix-action@v22 + - uses: cachix/cachix-action@v12 with: - fetch-depth: 0 - - - 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 + name: devenv + - uses: cachix/cachix-action@v12 with: - path: ~/.cache/pre-commit - key: pre-commit-${{ env.PY }}-${{ hashFiles('.pre-commit-config.yaml') }} - + name: alejandr0angul0-dev + authToken: "${{ secrets.CACHIX_AUTH_TOKEN }}" - 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: needs: pre-commit-hooks