Install Flutter in pre-commit CI so flutter-analyze can run
Some checks are pending
pre-commit / pre-commit (push) Waiting to run
Tests / test (3.10) (push) Waiting to run
Tests / test (3.11) (push) Waiting to run
Tests / test (3.12) (push) Waiting to run

The pre-commit workflow has been red on every run since 2026-07-04: it
executes the flutter-analyze hook but never installed Flutter, so the
hook failed command-not-found each time (Dart was never actually
analyzed in CI). Add subosito/flutter-action pinned to 3.44.6 (matching
the version the app is developed against, Dart SDK ^3.12.2) plus a
`flutter pub get` step so `flutter analyze` resolves packages. The
sibling flutter-test-coverage hook is pre-push-only and does not run in
this default-stage CI job, so analyze is the only Flutter dependency
here.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018PMRRVVkeRyrSaaqueMZKG
This commit is contained in:
Krzysztof Rudnicki 2026-07-11 17:23:42 +02:00
parent 8429cf04d5
commit 23b9bd5cde

View File

@ -14,6 +14,19 @@ jobs:
- uses: actions/setup-python@v5
with:
python-version: "3.12"
# 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.44.6"
channel: stable
cache: true
- 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