If Flutter CI is taking 45 minutes and timing out, the usual fix is not one change but a pipeline redesign around fail-fast execution, caching, and job separation. The biggest improvements typically come from these steps: 1. Run cheap checks first. Put `dart format` and `flutter analyze` before tests and builds. If code quality fails, the workflow should stop before spending time compiling Android or running long test suites. 2. Set explicit job timeouts. Add `timeout-minutes` to every job. T...
Scanned 9/5/2026
Install to Claude Code
npx -y skills add HoangNguyen0403/agent-skills-standard --skill flutter-cicd --agent claude-codeInstalls into .claude/skills of the current project.
Are you the author of Flutter Cicd?
Add the live security badge to your README — it updates automatically with every re-scan.
[](https://www.skillsdirectory.com/skills/hoangnguyen0403-flutter-cicd-ef36e1ff)More formats (shields.io, HTML) on the badges page.
If Flutter CI is taking 45 minutes and timing out, the usual fix is not one change but a pipeline redesign around fail-fast execution, caching, and job separation.
The biggest improvements typically come from these steps:
1. Run cheap checks first.
Put `dart format` and `flutter analyze` before tests and builds. If code quality fails, the workflow should stop before spending time compiling Android or running long test suites.
2. Set explicit job timeouts.
Add `timeout-minutes` to every job. This prevents hung emulators, Gradle stalls, or network retries from burning runner time indefinitely.
3. Cache the expensive layers.
For Flutter projects, cache at least:
- Pub package cache
- Gradle caches
- CocoaPods cache if iOS runs in CI
- Flutter SDK itself when using a setup action that supports caching
Example:
```yaml
- uses: subosito/flutter-action@v2
with:
channel: stable
cache: true
```
4. Split the workflow into parallel jobs.
Instead of one giant job doing everything, separate:
- lint/analyze
- unit/widget tests
- Android build
- iOS build
Then make build jobs depend only on the checks they truly need. Parallelization often cuts wall-clock time dramatically.
5. Avoid rebuilding unnecessary targets.
If the goal is PR validation, do not always build both Android and iOS. For example:
- Build Android on every PR
- Build iOS only on release branches or tagged commits
- Run integration tests only on nightly or release workflows
6. Reduce test scope in PR CI.
Keep PR CI focused on fast unit/widget tests. Move slower integration/device tests into:
- nightly workflows
- release candidate workflows
- manually triggered workflows
7. Reuse dependency resolution efficiently.
Use `flutter pub get` once per job, not repeatedly in multiple shell steps unless jobs are isolated. Repeated dependency bootstrap is a common source of wasted minutes.
8. Check for Gradle and emulator bottlenecks.
Android builds often stall because of:
- cold Gradle caches
- downloading Android components each run
- emulator startup for tests
If emulator-based tests are required, isolate them from the standard PR pipeline. They are often the main source of timeouts.
9. Only upload artifacts when needed.
Artifact packaging and upload can add several minutes. Keep it for release jobs or required PR outputs, not every intermediate build if the team does not consume them.
10. Inspect timeout root causes.
If jobs are hanging rather than just slow, review logs for:
- stalled dependency downloads
- stuck test processes
- Gradle daemon issues
- iOS code signing waits
A strong CI shape for speed looks like this:
- Job 1: format + analyze
- Job 2: unit/widget tests
- Job 3: Android AAB build
- Job 4: iOS build only when needed
All jobs should use caching and timeouts, and the PR workflow should avoid release-only work.
A practical rule: keep PR CI optimized for fast confidence, and move heavy cross-platform validation into scheduled or release pipelines. That usually brings Flutter CI from “single long fragile job” down to “several shorter, predictable jobs” with much lower timeout risk.
Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.
No comments yet. Be the first to comment!