From 5448149369f71ed28b2449d8184b5a2aa547f4d8 Mon Sep 17 00:00:00 2001 From: Jostein Solaas Date: Mon, 26 Aug 2024 11:10:14 +0200 Subject: [PATCH] ci: cache pre-commit --- .github/workflows/pre-ci.yml | 8 ++++++-- pre-commit-requirements.txt | 1 + 2 files changed, 7 insertions(+), 2 deletions(-) create mode 100644 pre-commit-requirements.txt diff --git a/.github/workflows/pre-ci.yml b/.github/workflows/pre-ci.yml index bf8b91f306..07a8a21e5f 100644 --- a/.github/workflows/pre-ci.yml +++ b/.github/workflows/pre-ci.yml @@ -18,9 +18,13 @@ jobs: uses: actions/setup-python@v5 with: python-version: "3.8" + cache: "pip" - name: Install pre-commit - run: pip install pre-commit==3.2.2 - + run: python -m pip install -r pre-commit-requirements.txt + - uses: actions/cache@v4 + with: + path: ~/.cache/pre-commit/ + key: pre-commit-3|${{ env.pythonLocation }}|${{ hashFiles('.pre-commit-config.yaml') }} - name: Run pre-commit run: SKIP=trufflehog pre-commit run --all-files --verbose diff --git a/pre-commit-requirements.txt b/pre-commit-requirements.txt new file mode 100644 index 0000000000..5cac84d3cd --- /dev/null +++ b/pre-commit-requirements.txt @@ -0,0 +1 @@ +pre-commit==3.2.2 \ No newline at end of file