From 0bef3ee0d8d18ce09084a778805c613cecace427 Mon Sep 17 00:00:00 2001 From: Jonathan Coates Date: Fri, 11 Oct 2024 20:27:15 +0200 Subject: [PATCH] Install/run pre-commit directly The update to Python 3.12 has broken the pre-commit action (as it installs via pip rather than pipx). The maintainer seems unwilling to fix it (to put it diplomatically), so let's just stop using the action and imlement it ourselves. --- .github/workflows/main-ci.yml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/.github/workflows/main-ci.yml b/.github/workflows/main-ci.yml index 013ec2ad5..4bc762c80 100644 --- a/.github/workflows/main-ci.yml +++ b/.github/workflows/main-ci.yml @@ -30,8 +30,16 @@ jobs: - name: ⚒️ Build run: ./gradlew assemble || ./gradlew assemble + - name: Cache pre-commit + uses: actions/cache@v4 + with: + path: ~/.cache/pre-commit + key: pre-commit-3|${{ env.pythonLocation }}|${{ hashFiles('.pre-commit-config.yaml') }} + - name: 💡 Lint - uses: pre-commit/action@v3.0.0 + run: | + pipx install pre-commit + pre-commit run --show-diff-on-failure --color=always - name: 🧪 Run tests run: ./gradlew test validateMixinNames checkChangelog