mirror of
https://github.com/kuhyx/screen-locker.git
synced 2026-11-24 20:06:24 +01:00
Compare commits
2 Commits
ac65def3ef
...
9e23ebae4f
| Author | SHA1 | Date | |
|---|---|---|---|
| 9e23ebae4f | |||
| 67f942284e |
@ -136,7 +136,7 @@ repos:
|
||||
# than merely an old one.
|
||||
- gatelock @ git+https://github.com/kuhyx/utils@gatelock-v0.9.0#subdirectory=gatelock
|
||||
- crdt-sync @ git+https://github.com/kuhyx/utils@crdt-sync-v0.9.2#subdirectory=crdt-sync
|
||||
- earned-time @ git+https://github.com/kuhyx/utils@earned-time-v0.11.0#subdirectory=earned_time
|
||||
- earned-time @ git+https://github.com/kuhyx/utils@earned-time-v0.12.0#subdirectory=earned_time
|
||||
- freedays @ git+https://github.com/kuhyx/utils@freedays-v0.4.0#subdirectory=freedays
|
||||
- sickdays @ git+https://github.com/kuhyx/utils@sickdays-v0.3.0#subdirectory=sickdays
|
||||
- mcp>=2,<3
|
||||
@ -158,7 +158,7 @@ repos:
|
||||
# than merely an old one.
|
||||
- gatelock @ git+https://github.com/kuhyx/utils@gatelock-v0.9.0#subdirectory=gatelock
|
||||
- crdt-sync @ git+https://github.com/kuhyx/utils@crdt-sync-v0.9.2#subdirectory=crdt-sync
|
||||
- earned-time @ git+https://github.com/kuhyx/utils@earned-time-v0.11.0#subdirectory=earned_time
|
||||
- earned-time @ git+https://github.com/kuhyx/utils@earned-time-v0.12.0#subdirectory=earned_time
|
||||
- freedays @ git+https://github.com/kuhyx/utils@freedays-v0.4.0#subdirectory=freedays
|
||||
- sickdays @ git+https://github.com/kuhyx/utils@sickdays-v0.3.0#subdirectory=sickdays
|
||||
- mcp>=2,<3
|
||||
@ -179,9 +179,28 @@ repos:
|
||||
|
||||
- repo: local
|
||||
hooks:
|
||||
- id: ci-mirror
|
||||
name: CI mirror (clean-venv pytest + pre-commit --all-files)
|
||||
entry: bash scripts/ci_mirror.sh
|
||||
# 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
|
||||
# requirements.txt when it changed, so ci-pytest only reuses it.
|
||||
- id: ci-venv
|
||||
name: CI mirror (clean requirements.txt venv)
|
||||
entry: bash scripts/ci_mirror.sh venv
|
||||
language: system
|
||||
pass_filenames: false
|
||||
always_run: true
|
||||
require_serial: true
|
||||
stages: [manual]
|
||||
- id: ci-precommit
|
||||
name: CI mirror (pre-commit --all-files)
|
||||
entry: bash scripts/ci_mirror.sh precommit
|
||||
language: system
|
||||
pass_filenames: false
|
||||
always_run: true
|
||||
require_serial: true
|
||||
stages: [manual]
|
||||
- id: ci-pytest
|
||||
name: CI mirror (clean-venv pytest, xdist)
|
||||
entry: bash scripts/ci_mirror.sh pytest
|
||||
language: system
|
||||
pass_filenames: false
|
||||
always_run: true
|
||||
|
||||
@ -10,7 +10,7 @@ dependencies = [
|
||||
"gatelock @ git+https://github.com/kuhyx/utils@gatelock-v0.9.0#subdirectory=gatelock",
|
||||
"crdt-sync @ git+https://github.com/kuhyx/utils@crdt-sync-v0.9.2#subdirectory=crdt-sync",
|
||||
"freedays @ git+https://github.com/kuhyx/utils@freedays-v0.4.0#subdirectory=freedays",
|
||||
"earned-time @ git+https://github.com/kuhyx/utils@earned-time-v0.11.0#subdirectory=earned_time",
|
||||
"earned-time @ git+https://github.com/kuhyx/utils@earned-time-v0.12.0#subdirectory=earned_time",
|
||||
"sickdays @ git+https://github.com/kuhyx/utils@sickdays-v0.3.0#subdirectory=sickdays",
|
||||
]
|
||||
|
||||
|
||||
@ -4,7 +4,7 @@ bandit==1.9.4
|
||||
codespell==2.4.3
|
||||
coverage==7.16.2
|
||||
crdt-sync @ git+https://github.com/kuhyx/utils@crdt-sync-v0.9.2#subdirectory=crdt-sync
|
||||
earned-time @ git+https://github.com/kuhyx/utils@earned-time-v0.11.0#subdirectory=earned_time
|
||||
earned-time @ git+https://github.com/kuhyx/utils@earned-time-v0.12.0#subdirectory=earned_time
|
||||
freedays @ git+https://github.com/kuhyx/utils@freedays-v0.4.0#subdirectory=freedays
|
||||
gatelock @ git+https://github.com/kuhyx/utils@gatelock-v0.9.0#subdirectory=gatelock
|
||||
mcp==2.3.0
|
||||
|
||||
@ -18,6 +18,12 @@
|
||||
# Runs on demand (`scripts/check_gate_stamp.sh full`, pre-commit's manual
|
||||
# stage) and in CI. It left the pre-push path on 2026-09-20: 10+ minutes
|
||||
# per push under the resource cap, for work finish_auto.sh had just done.
|
||||
#
|
||||
# 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
|
||||
# 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):
|
||||
# serial it was ~85 s, and pytest-cov merges the workers' coverage.
|
||||
# ============================================================================
|
||||
|
||||
set -euo pipefail
|
||||
@ -80,15 +86,32 @@ run_precommit_all_files() {
|
||||
|
||||
run_pytest_clean_venv() {
|
||||
log "pytest in the clean venv (mirrors the Tests workflow)"
|
||||
"$VENV_DIR/bin/python" -m pytest "$@" || fail "pytest (clean requirements.txt venv)"
|
||||
"$VENV_DIR/bin/python" -m pytest -n auto --dist worksteal "$@" \
|
||||
|| fail "pytest (clean requirements.txt venv)"
|
||||
}
|
||||
|
||||
main() {
|
||||
local mode="all"
|
||||
case "${1:-}" in
|
||||
venv | precommit | pytest | all) mode="$1"; shift ;;
|
||||
*) ;;
|
||||
esac
|
||||
|
||||
case "$mode" in
|
||||
precommit) run_precommit_all_files; return ;;
|
||||
*) ;;
|
||||
esac
|
||||
require_file
|
||||
ensure_venv
|
||||
run_precommit_all_files
|
||||
run_pytest_clean_venv "$@"
|
||||
log "all CI gates passed locally — safe to push"
|
||||
case "$mode" in
|
||||
venv) ;;
|
||||
pytest) run_pytest_clean_venv "$@" ;;
|
||||
*)
|
||||
run_precommit_all_files
|
||||
run_pytest_clean_venv "$@"
|
||||
log "all CI gates passed locally — safe to push"
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
main "$@"
|
||||
|
||||
Loading…
Reference in New Issue
Block a user