Skip to content

Commit 566096f

Browse files
committed
Check local Dart packages in the Flutter workflow
Extend check-flutter.yml to analyze and test any local packages under packages/: the lint job runs dart analyze --fatal-infos and the test job runs dart test in each package directory. Repos without local packages are unaffected.
1 parent 258a742 commit 566096f

2 files changed

Lines changed: 22 additions & 1 deletion

File tree

.github/workflows/check-flutter.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,14 @@ jobs:
4848
- name: Check lints
4949
run: flutter analyze
5050

51+
- name: Check local package lints
52+
run: |
53+
set -euo pipefail
54+
for package in packages/*/; do
55+
[ -f "${package}pubspec.yaml" ] || continue
56+
(cd "$package" && dart pub get && dart analyze --fatal-infos)
57+
done
58+
5159
test:
5260
name: test
5361
runs-on: ubuntu-latest
@@ -69,3 +77,15 @@ jobs:
6977

7078
- name: Run tests
7179
run: flutter test
80+
81+
- name: Run local package tests
82+
run: |
83+
set -euo pipefail
84+
for package in packages/*/; do
85+
[ -d "${package}test" ] || continue
86+
if grep -qE '^\s+sdk:\s*flutter\s*$' "${package}pubspec.yaml"; then
87+
(cd "$package" && flutter pub get && flutter test)
88+
else
89+
(cd "$package" && dart pub get && dart test)
90+
fi
91+
done

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,8 @@ Details: [docs/common.md](docs/common.md)
6565

6666
Workflows specific to Flutter projects:
6767

68-
- `check-flutter.yml` – Format, analyze, and test using pinned Flutter
68+
- `check-flutter.yml` – Format, analyze, and test using pinned Flutter,
69+
including any local packages under `packages/`
6970
- `preload-caches-flutter.yml` – Cache pinned Flutter dependencies
7071
- `bump-version-flutter-app.yml` – Bump CalVer version and changelog, open PR
7172
- `bump-version-flutter-lib.yml` – Bump SemVer version and changelog, open PR

0 commit comments

Comments
 (0)