-
-
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
Merged
+225
−338
Merged
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
0ceed55
ci: improve workflow reliability and performance (Phase 1)
grdsdev 36ead56
ci: add caching and simplify analyzer steps (Phase 2)
grdsdev 45cda5a
fix(storage): remove unnecessary http_parser import
grdsdev 102ffac
fix(storage): import MediaType from http package
grdsdev 5229d2b
fix(storage): add ClientException to imports
grdsdev e81e600
fix(storage): revert to http_parser import for MediaType
grdsdev fb41fc5
ci: remove --fatal-infos from analyzer to allow necessary imports
grdsdev b0294c5
ci: create reusable workflow and refactor package tests (Phase 3)
grdsdev d5f1e22
fix(ci): use Flutter action instead of Dart in reusable workflow
grdsdev aa4dbf2
Revert "fix(ci): use Flutter action instead of Dart in reusable workf…
grdsdev 861d9d3
fix(ci): add missing melos-no-flutter flag to failing workflows
grdsdev dbca138
refactor(ci): always use --no-flutter in reusable workflow
grdsdev File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,105 @@ | ||
| name: Dart Package Test (Reusable) | ||
|
|
||
| on: | ||
| workflow_call: | ||
| inputs: | ||
| package-name: | ||
| required: true | ||
| type: string | ||
| description: 'The name of the package to test (e.g., gotrue, postgrest)' | ||
| working-directory: | ||
| required: true | ||
| type: string | ||
| description: 'The working directory for the package (e.g., packages/gotrue)' | ||
| needs-docker: | ||
| required: false | ||
| type: boolean | ||
| default: false | ||
| description: 'Whether this package needs Docker services to run tests' | ||
| docker-compose-dir: | ||
| required: false | ||
| type: string | ||
| description: 'The directory containing docker-compose.yml (e.g., infra/gotrue)' | ||
| test-concurrency: | ||
| required: false | ||
| type: number | ||
| default: 0 | ||
| description: 'Test concurrency level (0 means no flag, 1 means --concurrency=1)' | ||
|
|
||
| jobs: | ||
| test: | ||
| name: Test SDK ${{ matrix.sdk }} | ||
| timeout-minutes: 20 | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| os: [ubuntu-latest] | ||
| sdk: [stable, beta, dev] | ||
|
|
||
| defaults: | ||
| run: | ||
| working-directory: ${{ inputs.working-directory }} | ||
|
|
||
| runs-on: ${{ matrix.os }} | ||
|
|
||
| steps: | ||
| - name: Checkout repository | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Setup Dart | ||
| uses: dart-lang/setup-dart@v1 | ||
| with: | ||
| sdk: ${{ matrix.sdk }} | ||
|
|
||
| - name: Cache pub dependencies | ||
| uses: actions/cache@v4 | ||
| with: | ||
| path: | | ||
| ${{ env.PUB_CACHE }} | ||
| ~/.pub-cache | ||
grdsdev marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| key: ${{ runner.os }}-pub-${{ matrix.sdk }}-${{ hashFiles('**/pubspec.lock') }} | ||
| restore-keys: | | ||
| ${{ runner.os }}-pub-${{ matrix.sdk }}- | ||
| ${{ runner.os }}-pub- | ||
|
|
||
| - name: Bootstrap workspace | ||
| run: | | ||
| cd ../../ | ||
| dart pub global activate melos | ||
| melos bootstrap --no-flutter | ||
|
|
||
| - name: dartfmt | ||
| if: ${{ matrix.sdk == 'stable'}} | ||
| run: dart format lib test -l 80 --set-exit-if-changed | ||
|
|
||
| - name: analyzer | ||
| run: | | ||
| if [ "${{ matrix.sdk }}" == "stable" ]; then | ||
| dart analyze --fatal-warnings . | ||
| else | ||
| dart analyze | ||
| fi | ||
|
|
||
| - name: Start Docker services | ||
| if: ${{ inputs.needs-docker }} | ||
| run: | | ||
| cd ../../${{ inputs.docker-compose-dir }} | ||
| docker compose up -d | ||
|
|
||
| - name: Wait for services to be ready | ||
| if: ${{ inputs.needs-docker }} | ||
| run: sleep 5 | ||
|
|
||
| - name: Run tests | ||
| run: | | ||
| if [ "${{ inputs.test-concurrency }}" == "1" ]; then | ||
| dart test --concurrency=1 | ||
grdsdev marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| else | ||
| dart test | ||
| fi | ||
|
|
||
| - name: Stop Docker services | ||
| if: ${{ inputs.needs-docker && always() }} | ||
| run: | | ||
| cd ../../${{ inputs.docker-compose-dir }} | ||
| docker compose down | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.