mirror of
https://github.com/kuhyx/steam-backlog-enforcer.git
synced 2026-11-21 18:12:19 +01:00
Some checks failed
md-naming / markdown naming convention (push) Has been cancelled
pre-commit / pre-commit (${{ matrix.group }}) (mypy, mypy, ) (push) Has been cancelled
pre-commit / pre-commit (${{ matrix.group }}) (pylint, pylint, ) (push) Has been cancelled
pre-commit / pre-commit (${{ matrix.group }}) (rest, , mypy,pylint,dependency-freshness) (push) Has been cancelled
Tests / test (push) Has been cancelled
Tests / web-coverage (push) Has been cancelled
repo-contract / repo contract (push) Has been cancelled
Todo: 2556952d
65 lines
2.3 KiB
YAML
65 lines
2.3 KiB
YAML
name: pre-commit
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
pull_request:
|
|
branches: [main]
|
|
|
|
jobs:
|
|
# mypy and pylint check the whole repo and dominated a single ~50 s job, so
|
|
# each gets its own runner and the other hooks share a third; the workflow
|
|
# takes as long as the slowest group rather than the sum.
|
|
pre-commit:
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
include:
|
|
- group: mypy
|
|
hooks: mypy
|
|
skip: ""
|
|
- group: pylint
|
|
hooks: pylint
|
|
skip: ""
|
|
- group: rest
|
|
hooks: ""
|
|
# dependency-freshness is local only (pre-commit hook), never in CI.
|
|
skip: mypy,pylint,dependency-freshness
|
|
name: pre-commit (${{ matrix.group }})
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
# Hooks here delegate to the shared gates in kuhyx/utils. Without this
|
|
# checkout they exit 1 with "shared gate not found at
|
|
# /home/runner/utils/..." -- green locally, red on every runner.
|
|
- name: Check out the shared gates
|
|
uses: actions/checkout@v4
|
|
with:
|
|
repository: kuhyx/utils
|
|
path: .utils
|
|
- name: Point the delegates at that checkout
|
|
run: echo "UTILS_ROOT=$GITHUB_WORKSPACE/.utils" >> "$GITHUB_ENV"
|
|
- uses: actions/setup-python@v5
|
|
with:
|
|
python-version: "3.x"
|
|
- uses: astral-sh/setup-uv@v10.2.0
|
|
|
|
# Every hook brings its own environment except the language: system
|
|
# ones; of those none import third-party code. The whole requirements.txt
|
|
# used to be installed here for nothing.
|
|
- name: Install pre-commit and the system hooks' imports
|
|
run: uv pip install --system pre-commit pyyaml packaging
|
|
|
|
# One cache per group: a shared key would hold whichever group saved
|
|
# first, and the others would rebuild their hook envs on every run.
|
|
- uses: actions/cache@v4
|
|
with:
|
|
path: ~/.cache/pre-commit
|
|
key: pre-commit-${{ matrix.group }}-${{ env.pythonLocation }}-${{ hashFiles('.pre-commit-config.yaml') }}
|
|
|
|
- name: pre-commit run (${{ matrix.group }})
|
|
env:
|
|
SKIP: ${{ matrix.skip }}
|
|
run: pre-commit run ${{ matrix.hooks }} --all-files --show-diff-on-failure --color=always
|