mirror of
https://github.com/kuhyx/screen-locker.git
synced 2026-11-24 18:46:24 +01:00
Shard ci-precommit into four gate steps
Some checks are pending
dependency freshness / dependencies on newest stable (push) Waiting to run
md-naming / markdown naming convention (push) Waiting to run
pre-commit / pre-commit (${{ matrix.group }}) (flutter, flutter-analyze, ) (push) Waiting to run
pre-commit / pre-commit (${{ matrix.group }}) (mypy, mypy, ) (push) Waiting to run
pre-commit / pre-commit (${{ matrix.group }}) (pylint, pylint, ) (push) Waiting to run
pre-commit / pre-commit (${{ matrix.group }}) (rest, , mypy,pylint,flutter-analyze) (push) Waiting to run
Tests / test (push) Waiting to run
Tests / lock-popup-safety (push) Waiting to run
Tests / flutter test (shard ${{ matrix.shard }}) (0) (push) Waiting to run
Tests / flutter test (shard ${{ matrix.shard }}) (1) (push) Waiting to run
Tests / flutter test (shard ${{ matrix.shard }}) (2) (push) Waiting to run
Tests / flutter test (shard ${{ matrix.shard }}) (3) (push) Waiting to run
Tests / flutter test (shard ${{ matrix.shard }}) (4) (push) Waiting to run
Tests / flutter test (shard ${{ matrix.shard }}) (5) (push) Waiting to run
Tests / flutter test (shard ${{ matrix.shard }}) (6) (push) Waiting to run
Tests / flutter test (shard ${{ matrix.shard }}) (7) (push) Waiting to run
Tests / flutter test (shard ${{ matrix.shard }}) (8) (push) Waiting to run
Tests / flutter test (shard ${{ matrix.shard }}) (9) (push) Waiting to run
Tests / flutter-coverage (push) Blocked by required conditions
Tests / web-coverage (push) Waiting to run
release-apk / release (APK) (push) Waiting to run
repo-contract / repo contract (push) Waiting to run
Some checks are pending
dependency freshness / dependencies on newest stable (push) Waiting to run
md-naming / markdown naming convention (push) Waiting to run
pre-commit / pre-commit (${{ matrix.group }}) (flutter, flutter-analyze, ) (push) Waiting to run
pre-commit / pre-commit (${{ matrix.group }}) (mypy, mypy, ) (push) Waiting to run
pre-commit / pre-commit (${{ matrix.group }}) (pylint, pylint, ) (push) Waiting to run
pre-commit / pre-commit (${{ matrix.group }}) (rest, , mypy,pylint,flutter-analyze) (push) Waiting to run
Tests / test (push) Waiting to run
Tests / lock-popup-safety (push) Waiting to run
Tests / flutter test (shard ${{ matrix.shard }}) (0) (push) Waiting to run
Tests / flutter test (shard ${{ matrix.shard }}) (1) (push) Waiting to run
Tests / flutter test (shard ${{ matrix.shard }}) (2) (push) Waiting to run
Tests / flutter test (shard ${{ matrix.shard }}) (3) (push) Waiting to run
Tests / flutter test (shard ${{ matrix.shard }}) (4) (push) Waiting to run
Tests / flutter test (shard ${{ matrix.shard }}) (5) (push) Waiting to run
Tests / flutter test (shard ${{ matrix.shard }}) (6) (push) Waiting to run
Tests / flutter test (shard ${{ matrix.shard }}) (7) (push) Waiting to run
Tests / flutter test (shard ${{ matrix.shard }}) (8) (push) Waiting to run
Tests / flutter test (shard ${{ matrix.shard }}) (9) (push) Waiting to run
Tests / flutter-coverage (push) Blocked by required conditions
Tests / web-coverage (push) Waiting to run
release-apk / release (APK) (push) Waiting to run
repo-contract / repo contract (push) Waiting to run
Each slice runs under 30 s; together they run all 35 default-stage hooks once. CI (pre-commit.yml) is unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WzxdWZ9CKZsNxtD5Jr9bYD
This commit is contained in:
parent
2998bd5353
commit
1475ab913b
@ -130,6 +130,7 @@ repos:
|
|||||||
# what else happened to be staged alongside. Both are a hard 10.00.
|
# what else happened to be staged alongside. Both are a hard 10.00.
|
||||||
- id: pylint
|
- id: pylint
|
||||||
name: pylint (source, 10.00)
|
name: pylint (source, 10.00)
|
||||||
|
alias: pylint-source
|
||||||
exclude: ^screen_locker/tests/
|
exclude: ^screen_locker/tests/
|
||||||
args:
|
args:
|
||||||
- --rcfile=pyproject.toml
|
- --rcfile=pyproject.toml
|
||||||
@ -189,6 +190,9 @@ repos:
|
|||||||
# The CI mirror, one step per hook so each call stays under the 60 s
|
# The CI mirror, one step per hook so each call stays under the 60 s
|
||||||
# action cap. Order matters: ci-venv (re)builds .ci-mirror-venv from
|
# action cap. Order matters: ci-venv (re)builds .ci-mirror-venv from
|
||||||
# requirements.txt when it changed, so ci-pytest only reuses it.
|
# requirements.txt when it changed, so ci-pytest only reuses it.
|
||||||
|
# `pre-commit run --all-files` is split into four ci-precommit-* steps
|
||||||
|
# (each well under the cap); together they run every default-stage hook
|
||||||
|
# exactly once -- see run_precommit_group in scripts/ci_mirror.sh.
|
||||||
- id: ci-venv
|
- id: ci-venv
|
||||||
name: CI mirror (clean requirements.txt venv)
|
name: CI mirror (clean requirements.txt venv)
|
||||||
entry: bash scripts/ci_mirror.sh venv
|
entry: bash scripts/ci_mirror.sh venv
|
||||||
@ -197,9 +201,33 @@ repos:
|
|||||||
always_run: true
|
always_run: true
|
||||||
require_serial: true
|
require_serial: true
|
||||||
stages: [manual]
|
stages: [manual]
|
||||||
- id: ci-precommit
|
- id: ci-precommit-pylint-source
|
||||||
name: CI mirror (pre-commit --all-files)
|
name: "CI mirror (pre-commit --all-files: pylint source)"
|
||||||
entry: bash scripts/ci_mirror.sh precommit
|
entry: bash scripts/ci_mirror.sh precommit pylint-source
|
||||||
|
language: system
|
||||||
|
pass_filenames: false
|
||||||
|
always_run: true
|
||||||
|
require_serial: true
|
||||||
|
stages: [manual]
|
||||||
|
- id: ci-precommit-pylint-tests
|
||||||
|
name: "CI mirror (pre-commit --all-files: pylint tests)"
|
||||||
|
entry: bash scripts/ci_mirror.sh precommit pylint-tests
|
||||||
|
language: system
|
||||||
|
pass_filenames: false
|
||||||
|
always_run: true
|
||||||
|
require_serial: true
|
||||||
|
stages: [manual]
|
||||||
|
- id: ci-precommit-flutter-web
|
||||||
|
name: "CI mirror (pre-commit --all-files: flutter analyze + web lint/typecheck)"
|
||||||
|
entry: bash scripts/ci_mirror.sh precommit flutter-web
|
||||||
|
language: system
|
||||||
|
pass_filenames: false
|
||||||
|
always_run: true
|
||||||
|
require_serial: true
|
||||||
|
stages: [manual]
|
||||||
|
- id: ci-precommit-rest
|
||||||
|
name: "CI mirror (pre-commit --all-files: every other hook)"
|
||||||
|
entry: bash scripts/ci_mirror.sh precommit rest
|
||||||
language: system
|
language: system
|
||||||
pass_filenames: false
|
pass_filenames: false
|
||||||
always_run: true
|
always_run: true
|
||||||
|
|||||||
@ -20,7 +20,7 @@
|
|||||||
# per push under the resource cap, for work finish_auto.sh had just done.
|
# per push under the resource cap, for work finish_auto.sh had just done.
|
||||||
#
|
#
|
||||||
# Usage: ci_mirror.sh [venv|precommit|pytest|all] [pytest args...]
|
# Usage: ci_mirror.sh [venv|precommit|pytest|all] [pytest args...]
|
||||||
# Each step is its own manual hook (ci-venv, ci-precommit, ci-pytest) so no
|
# Each step is its own manual hook (ci-venv, ci-precommit-*, ci-pytest) so no
|
||||||
# single call outlives the 60 s action cap; `all` (the default) is the old
|
# single call outlives the 60 s action cap; `all` (the default) is the old
|
||||||
# one-shot behaviour. pytest runs under xdist (-n auto --dist worksteal):
|
# one-shot behaviour. pytest runs under xdist (-n auto --dist worksteal):
|
||||||
# serial it was ~85 s, and pytest-cov merges the workers' coverage.
|
# serial it was ~85 s, and pytest-cov merges the workers' coverage.
|
||||||
@ -79,9 +79,28 @@ ensure_venv() {
|
|||||||
log "clean venv ready"
|
log "clean venv ready"
|
||||||
}
|
}
|
||||||
|
|
||||||
run_precommit_all_files() {
|
# Hooks that get their own group because they dominate the run time. `rest`
|
||||||
log "pre-commit run --all-files (mirrors the pre-commit workflow)"
|
# skips them by id (SKIP matches the id, so `pylint` covers both pylint hooks).
|
||||||
pre-commit run --all-files || fail "pre-commit --all-files"
|
readonly HEAVY_IDS="pylint,flutter-analyze,web-lint,web-typecheck"
|
||||||
|
|
||||||
|
# One slice of `pre-commit run --all-files`, small enough for the 60 s action
|
||||||
|
# cap. The groups partition the default-stage hooks: pylint-source and
|
||||||
|
# pylint-tests (the aliases of the two `pylint` hooks), flutter-web, and rest
|
||||||
|
# (everything else). With no group, all of it runs in one go, as CI does.
|
||||||
|
run_precommit_group() {
|
||||||
|
local group="${1:-all}"
|
||||||
|
log "pre-commit run --all-files [$group] (mirrors the pre-commit workflow)"
|
||||||
|
case "$group" in
|
||||||
|
all) pre-commit run --all-files ;;
|
||||||
|
pylint-source | pylint-tests) pre-commit run "$group" --all-files ;;
|
||||||
|
flutter-web)
|
||||||
|
pre-commit run flutter-analyze --all-files \
|
||||||
|
&& pre-commit run web-lint --all-files \
|
||||||
|
&& pre-commit run web-typecheck --all-files
|
||||||
|
;;
|
||||||
|
rest) SKIP="$HEAVY_IDS" pre-commit run --all-files ;;
|
||||||
|
*) fail "unknown pre-commit group '$group'" ;;
|
||||||
|
esac || fail "pre-commit --all-files [$group]"
|
||||||
}
|
}
|
||||||
|
|
||||||
run_pytest_clean_venv() {
|
run_pytest_clean_venv() {
|
||||||
@ -98,7 +117,7 @@ main() {
|
|||||||
esac
|
esac
|
||||||
|
|
||||||
case "$mode" in
|
case "$mode" in
|
||||||
precommit) run_precommit_all_files; return ;;
|
precommit) run_precommit_group "${1:-all}"; return ;;
|
||||||
*) ;;
|
*) ;;
|
||||||
esac
|
esac
|
||||||
require_file
|
require_file
|
||||||
@ -107,7 +126,7 @@ main() {
|
|||||||
venv) ;;
|
venv) ;;
|
||||||
pytest) run_pytest_clean_venv "$@" ;;
|
pytest) run_pytest_clean_venv "$@" ;;
|
||||||
*)
|
*)
|
||||||
run_precommit_all_files
|
run_precommit_group all
|
||||||
run_pytest_clean_venv "$@"
|
run_pytest_clean_venv "$@"
|
||||||
log "all CI gates passed locally — safe to push"
|
log "all CI gates passed locally — safe to push"
|
||||||
;;
|
;;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user