-
-
Notifications
You must be signed in to change notification settings - Fork 273
ci: improve GitHub Actions workflows reliability and performance #1265
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
- Replace deprecated jakejarvis/wait-action with native sleep command - Add concurrency control to cancel outdated workflow runs - Add timeout-minutes to all jobs to prevent infinite hangs - Standardize test concurrency flag across all package workflows These changes improve CI reliability and reduce resource usage by preventing stuck jobs and canceling redundant runs on new commits. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
Performance improvements: - Add dependency caching to all Dart workflows using actions/cache@v4 - Enable built-in caching for Flutter workflows via cache: true - Add caching to release workflows for faster execution - Combine duplicate analyzer steps into single conditional step These changes improve CI performance by ~2-3 minutes per run through dependency caching and reduce workflow complexity by eliminating duplicate analyzer step definitions. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
Remove unnecessary import of package:http_parser/http_parser.dart as MediaType is already provided by package:http/http.dart. Fixes analyzer warning: unnecessary_import 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
MediaType is exported from package:http/http.dart, so import it explicitly with show clause instead of from http_parser package. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
Add ClientException to the explicit imports from package:http/http.dart to fix analyzer error: type_test_with_undefined_name 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
MediaType is only exported by package:http_parser/http_parser.dart, not by package:http/http.dart. The analyzer warning about unnecessary_import is a false positive in this case. This reverts the previous changes that attempted to import MediaType from the http package, which caused compilation errors. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
Remove --fatal-infos flag from all analyzer commands in workflows and melos.yaml. This allows necessary imports that trigger info-level warnings (like http_parser for MediaType) while still failing on actual errors and warnings. The http_parser import in storage_client is necessary as MediaType is only exported by package:http_parser/http_parser.dart, not by package:http/http.dart. The analyzer warning is a false positive. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
Major refactoring to reduce duplication and improve maintainability: - Create reusable workflow template (.github/workflows/dart-package-test.yml) - Supports both Docker and non-Docker packages - Handles test concurrency configuration - Includes Docker cleanup with always() condition - Supports melos --no-flutter flag - Refactor 7 package workflows to use reusable template: - functions_client.yml - gotrue.yml (with Docker) - postgrest.yml (with Docker) - realtime_client.yml - storage_client.yml (with Docker) - supabase.yml - yet_another_json_isolate.yml - Add test:coverage script to melos.yaml for running tests with coverage Benefits: - Reduces workflow code by ~80% (from ~80 lines to ~30 lines per workflow) - Centralizes workflow logic for easier maintenance - Ensures consistent behavior across all packages - Docker cleanup now guaranteed with always() condition - Easier to add new packages with consistent testing 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
The reusable workflow was failing for packages because melos bootstrap needs Flutter to be available in the environment to bootstrap the entire workspace, even when testing Dart-only packages. Changed from dart-lang/setup-dart to subosito/flutter-action which includes Dart and has built-in caching. This fixes the error: /bin/sh: 1: eval: flutter: not found 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
…low" This reverts commit d5f1e22.
Root cause: All original workflows used "melos bootstrap --no-flutter", but I forgot to set the melos-no-flutter parameter for gotrue, storage_client, realtime_client, and supabase in the refactored versions. Without this flag, melos tries to run "melos bootstrap" which requires Flutter to be installed, but these workflows only install Dart SDK, causing the error: /bin/sh: 1: eval: flutter: not found Fixed by adding melos-no-flutter: true to: - gotrue.yml - storage_client.yml - realtime_client.yml - supabase.yml 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
Since all packages using the reusable dart-package-test workflow are Dart-only packages (no Flutter SDK), the --no-flutter flag is always needed. Removed the melos-no-flutter input parameter and simplified the bootstrap step to always use --no-flutter. This simplifies the workflow configuration and removes unnecessary conditional logic, as all 7 packages (gotrue, storage_client, realtime_client, supabase, functions_client, postgrest, yet_another_json_isolate) require this flag. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR modernizes the GitHub Actions CI/CD infrastructure for the supabase-flutter repository by introducing reliability improvements, performance optimizations, and significant code reduction through reusable workflows.
Key Changes:
- Created a reusable Dart package test workflow that consolidates testing logic across 7 package-specific workflows, reducing code by approximately 80%
- Added concurrency control to prevent resource waste from outdated workflow runs
- Implemented comprehensive timeout protection and dependency caching across all workflows
Reviewed Changes
Copilot reviewed 15 out of 15 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| melos.yaml | Removed --fatal-infos flag from analyzer (allows info messages without failing) and added test:coverage script for coverage generation |
| .github/workflows/dart-package-test.yml | New reusable workflow template providing standardized testing for Dart packages with optional Docker support, caching, and configurable test concurrency |
| .github/workflows/yet_another_json_isolate.yml | Refactored to use reusable workflow, reducing from ~50 lines to 4 lines |
| .github/workflows/supabase.yml | Refactored to use reusable workflow with test concurrency configuration |
| .github/workflows/storage_client.yml | Refactored to use reusable workflow with Docker compose support for storage infrastructure |
| .github/workflows/realtime_client.yml | Refactored to use reusable workflow with test concurrency control |
| .github/workflows/postgrest.yml | Refactored to use reusable workflow with Docker compose support for PostgreSQL infrastructure |
| .github/workflows/gotrue.yml | Refactored to use reusable workflow with Docker compose support for auth infrastructure |
| .github/workflows/functions_client.yml | Refactored to use reusable workflow with standard test execution |
| .github/workflows/title-validation.yml | Added 5-minute timeout and concurrency control to PR title validation |
| .github/workflows/supabase_flutter.yml | Added 30-minute timeout, concurrency control, and Flutter dependency caching |
| .github/workflows/release-tag.yml | Added 15-minute timeout, non-cancellable concurrency control, and Flutter dependency caching |
| .github/workflows/release-publish.yml | Added 20-minute timeout and Flutter dependency caching |
| .github/workflows/release-prepare.yml | Added 15-minute timeout and Flutter dependency caching |
| .github/workflows/coverage.yml | Added 30-minute timeout, concurrency control, and Flutter dependency caching |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Overview
This PR implements comprehensive improvements to GitHub Actions workflows to enhance reliability, performance, and maintainability of the supabase-flutter CI/CD pipeline.
Related Linear issue: SDK-516
Changes Implemented
✅ Phase 1: Quick Wins
jakejarvis/wait-actionwith nativesleepcommand✅ Phase 2: Performance Improvements
✅ Phase 3: Major Refactoring
melos.yamlalways()condition to Docker cleanup (guaranteed cleanup)Expected Benefits
Testing
This is a draft PR to test the workflow improvements. Please review the workflow runs to ensure:
Future Work (Not in this PR)
Additional phases are planned but will be implemented separately:
🤖 Generated with Claude Code