diff --git a/.github/workflows/check-pre-commit-hooks.yml b/.github/workflows/check-pre-commit-hooks.yml index 444070e..6d5141f 100644 --- a/.github/workflows/check-pre-commit-hooks.yml +++ b/.github/workflows/check-pre-commit-hooks.yml @@ -9,7 +9,9 @@ jobs: steps: - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 - uses: cachix/install-nix-action@8aa03977d8d733052d78f4e008a241fd1dbf36b3 - - name: Run pre-commit hooks + - env: + TREEFMT_NO_CACHE: "1" + name: Run pre-commit hooks run: prek --all-files --show-diff-on-failure shell: nix develop .#standards --command bash {0} name: Make sure all pre-commit hooks pass diff --git a/nix/general/workflows/check-pre-commit-hooks.nix b/nix/general/workflows/check-pre-commit-hooks.nix index 28b887e..7fc79e9 100644 --- a/nix/general/workflows/check-pre-commit-hooks.nix +++ b/nix/general/workflows/check-pre-commit-hooks.nix @@ -39,6 +39,14 @@ in name = "Run pre-commit hooks"; shell = "nix develop .#standards --command bash {0}"; run = "prek --all-files --show-diff-on-failure"; + env = { + # On some CI runners, the cache would time out, causing the pipeline to fail. + # Since the official documentation (https://treefmt.com/usage/#ci-integration) + # recommends using `----no-cache` anyway, we add it here. + # + # We do not add `--fail-on-change`, since prek takes care of that + TREEFMT_NO_CACHE = "1"; + }; } ]; };