Skip to content

Commit fcac94a

Browse files
enedclaude
andcommitted
ci: add generated files check workflow and improve melos generate command
- Add new GitHub Actions workflow to ensure generated files are up-to-date - Create parent 'generate' command that runs both pigeon and dart generation - Update generate:pigeon to use --depends-on filter for consistency - Workflow fails PR builds if generated files are not committed This ensures the repository always contains current generated files. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 5d7c824 commit fcac94a

2 files changed

Lines changed: 45 additions & 4 deletions

File tree

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: generated-files
2+
3+
on:
4+
pull_request:
5+
branches: [ main ]
6+
7+
jobs:
8+
check-generated-files:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v4
12+
- uses: subosito/flutter-action@v2
13+
with:
14+
channel: 'stable'
15+
cache: true
16+
- uses: bluefireteam/melos-action@v3
17+
18+
- name: Generate files
19+
run: melos run generate
20+
21+
- name: Check for uncommitted changes
22+
run: |
23+
if ! git diff --quiet; then
24+
echo "❌ Generated files are not up-to-date!"
25+
echo "The following files have uncommitted changes after generation:"
26+
git diff --name-only
27+
echo ""
28+
echo "Please run 'melos run generate' locally and commit the updated files."
29+
echo ""
30+
echo "Changes detected:"
31+
git diff
32+
exit 1
33+
else
34+
echo "✅ All generated files are up-to-date"
35+
fi

melos.yaml

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,19 @@ scripts:
99
get: melos exec -- dart pub get
1010

1111
test:
12-
run: melos exec --depends-on="flutter_test" -- "flutter test"
12+
run: melos exec -c 1 --depends-on="flutter_test" -- "flutter test"
1313
description: Run tests for all packages with flutter_test dependency.
1414

15+
generate:
16+
run: |
17+
melos run generate:pigeon
18+
melos run generate:dart
19+
description: Generate all code (Pigeon files and Dart mocks/generated files).
20+
1521
generate:dart:
16-
run: melos exec -c 1 --depends-on="build_runner" --no-flutter -- "dart run build_runner build --delete-conflicting-outputs"
22+
run: melos exec -c 1 --depends-on="build_runner" -- "dart run build_runner build --delete-conflicting-outputs"
1723
description: Build all generated files for Dart packages in this project.
1824

1925
generate:pigeon:
20-
run: cd workmanager_platform_interface && dart run pigeon --input pigeons/workmanager_api.dart
21-
description: Generate Pigeon type-safe platform channel code for workmanager_platform_interface.
26+
run: melos exec -c 1 --depends-on="pigeon" -- "dart run pigeon --input pigeons/workmanager_api.dart"
27+
description: Generate Pigeon type-safe platform channel code for packages with pigeon dependency.

0 commit comments

Comments
 (0)