screen-locker/.github/workflows/pre-commit.yml
Krzysztof kuhy Rudnicki d35097f461
Some checks failed
dependency freshness / dependencies on newest stable (push) Has been cancelled
md-naming / markdown naming convention (push) Has been cancelled
pre-commit / pre-commit (push) Has been cancelled
Tests / test (push) Has been cancelled
Tests / lock-popup-safety (push) Has been cancelled
release-apk / release (APK) (push) Has been cancelled
Give CI the node packages its web hooks have always needed
The pre-commit workflow has been red since 8f91158 added the status UI: it
installs Python and Flutter deps but never node ones, so `tsc --build` could
not find the 'vite/client' and 'node' type libraries and failed TS2688 on
every run. Nothing was wrong with the code; the job simply could not build it.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BJUtseRczWVBJW8LvL1aQH
2026-08-30 15:32:51 +02:00

58 lines
2.1 KiB
YAML

name: pre-commit
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
pre-commit:
runs-on: ubuntu-latest
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/..." -- which is what this workflow was doing on
# every run since those hooks were added.
- 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"
# The flutter-analyze pre-commit hook shells out to `flutter analyze` in
# stronglift_replacement/workout_app. Pin to the version the app is
# developed against (Dart SDK ^3.12.2) so CI's analyzer matches local.
- uses: subosito/flutter-action@v2
with:
flutter-version: 3.47.2
channel: stable
cache: true
# The web-lint / web-typecheck / web-coverage hooks run npm inside web/.
# Without its installed packages `tsc --build` cannot find the
# 'vite/client' and 'node' type libraries and fails with TS2688 -- which
# is what this workflow had been doing on every run since the status UI
# landed in 8f91158.
- uses: actions/setup-node@v4
with:
node-version: "24.20.0"
cache: npm
cache-dependency-path: web/package-lock.json
- name: Install status-UI packages
run: npm ci
working-directory: web
- name: Install dependencies
run: pip install -r requirements.txt
# analyze needs resolved packages (.dart_tool); the hook runs analyze
# only, so fetch deps here first.
- name: Resolve Flutter packages
run: flutter pub get
working-directory: stronglift_replacement/workout_app
- uses: pre-commit/action@v3.0.1