- add `flutter: 3.44.2` to environment so `flutter pub get` fails locally the moment the SDK drifts (was already drifting: local 3.44.2 vs the 3.44.1 pinned in CI) - point all 8 workflow pins at `flutter-version-file: pubspec.yaml` so CI reads the same field; bumping Flutter is now a one-line pubspec edit instead of editing 5 workflow files Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
59 lines
2.2 KiB
YAML
59 lines
2.2 KiB
YAML
name: CI
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
jobs:
|
|
# Linux runner: analyze + test once (both are OS-independent) and compile a
|
|
# release APK to catch release-only breakage. Debug-signed via the build.gradle
|
|
# fallback (ALLOW_DEBUG_SIGNED_RELEASE) — no signing secrets needed.
|
|
android:
|
|
name: Analyze, test, and build Android
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v6
|
|
# Match the JDK the release workflows build with, so this compile check
|
|
# faithfully catches what would break a real release.
|
|
- uses: actions/setup-java@v5
|
|
with:
|
|
distribution: temurin
|
|
java-version: 21
|
|
- uses: subosito/flutter-action@v2
|
|
with:
|
|
flutter-version-file: pubspec.yaml
|
|
cache: true
|
|
- run: flutter doctor -v
|
|
- run: flutter pub get
|
|
# Fail if committed generated files (*.g.dart) are stale — CI never runs
|
|
# build_runner otherwise, so forgetting to regenerate after editing a MobX
|
|
# store or @JsonSerializable model slips past analyze/test/build.
|
|
- run: dart run build_runner build --delete-conflicting-outputs
|
|
- name: Verify generated files are up to date
|
|
run: |
|
|
if [ -n "$(git status --porcelain)" ]; then
|
|
echo '::error::Generated files are out of date. Run `dart run build_runner build --delete-conflicting-outputs` and commit the result.'
|
|
git status --porcelain
|
|
git diff
|
|
exit 1
|
|
fi
|
|
- run: flutter analyze
|
|
- run: flutter test
|
|
- run: flutter build apk --release
|
|
env:
|
|
ALLOW_DEBUG_SIGNED_RELEASE: '1'
|
|
# macOS runner: release-compile iOS (no codesign, no secrets) — the only thing
|
|
# that must run on macOS. analyze/test already covered on the Linux job.
|
|
ios:
|
|
name: Build iOS
|
|
runs-on: macos-latest
|
|
steps:
|
|
- uses: actions/checkout@v6
|
|
# Match release workflows and avoid GitHub's lagging default Xcode.
|
|
- uses: maxim-lobanov/setup-xcode@v1
|
|
with:
|
|
xcode-version: latest-stable
|
|
- uses: subosito/flutter-action@v2
|
|
with:
|
|
flutter-version-file: pubspec.yaml
|
|
cache: true
|
|
- run: flutter pub get
|
|
- run: flutter build ios --release --no-codesign
|