mirror of
https://gitea.wildfiregames.com/0ad/0ad
synced 2026-08-15 14:43:32 -07:00
As the latest version of pre-commit is broken right now (https://github.com/pre-commit/pre-commit/issues/3737) and the official pre-commit Github action doesn't allow specifying an older pre-commit version to use, this inlines the logic of the pre-commit action into our action.
29 lines
874 B
YAML
29 lines
874 B
YAML
---
|
|
name: pre-commit
|
|
on:
|
|
- push
|
|
- pull_request
|
|
env:
|
|
PRE_COMMIT_VERSION: 4.6.0
|
|
jobs:
|
|
pre-commit:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v7
|
|
- uses: actions/setup-python@v7
|
|
with:
|
|
python-version: "3.11"
|
|
- uses: actions/cache@v6
|
|
with:
|
|
key: pip-cache-v1-${{github.workflow}}-${{env.pythonLocation}}-${{env.PRE_COMMIT_VERSION}}
|
|
path: ~/.cache/pip
|
|
- run: python -m pip install pre-commit=="${{ env.PRE_COMMIT_VERSION }}"
|
|
shell: bash
|
|
- run: python -m pip freeze --local
|
|
shell: bash
|
|
- uses: actions/cache@v6
|
|
with:
|
|
path: ~/.cache/pre-commit
|
|
key: pre-commit-3|${{ env.pythonLocation }}|${{ hashFiles('.pre-commit-config.yaml') }}
|
|
- run: pre-commit run --show-diff-on-failure --color=always --all-files
|
|
shell: bash
|