-
-
Notifications
You must be signed in to change notification settings - Fork 277
Added GH Action (CI) for Dart #97
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
Merged
Changes from 11 commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
d2a2063
add dart ci
marandaneto 3a3bc33
Merge branch 'main' into enha/dart-ci
marandaneto 75c92cc
changelog
marandaneto baa00a6
rollback pubspec lock
marandaneto 271bc34
fix
marandaneto fd99501
fix dart package analyzer
marandaneto 061eb95
fix analyses
marandaneto 6400f16
fix broken script
marandaneto d82bc16
Merge branch 'main' into enha/dart-ci
bruno-garcia 4c5e61a
to match Flutter
bruno-garcia f196411
Update .github/workflows/flutter.yml
bruno-garcia eb0476d
Update .github/workflows/dart.yml
bruno-garcia 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,73 @@ | ||
| name: Dart | ||
| on: | ||
| push: | ||
| branches: | ||
| - main | ||
| pull_request: | ||
| defaults: | ||
| run: | ||
| shell: bash | ||
| jobs: | ||
| build: | ||
| name: Build ${{matrix.sdk}} on ${{matrix.os}} | ||
| runs-on: ${{ matrix.os }} | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| # TODO: cedx/setup-dart@v2 doesn't work on Windows (doesn't add pub to the PATH?) | ||
| # os: [ubuntu-latest, windows-latest, macos-latest] | ||
| os: [ubuntu-latest, macos-latest] | ||
| sdk: [beta, dev, stable] | ||
| exclude: | ||
| # Bad state: Could not run tests with Observatory enabled. Try setting a different port with --port option. | ||
| - os: ubuntu-latest | ||
| sdk: beta | ||
| # hanging often | ||
| - os: ubuntu-latest | ||
| sdk: dev | ||
| - os: macos-latest | ||
| sdk: beta | ||
| steps: | ||
| - uses: cedx/setup-dart@v2 | ||
| with: | ||
| release-channel: ${{ matrix.sdk }} | ||
| - uses: actions/checkout@v2 | ||
| - run: | | ||
| cd dart | ||
| pub get | ||
| - name: Test on Dart VM and collect code coverage | ||
| run: | | ||
| cd dart | ||
| pub run test_coverage | ||
| - uses: codecov/codecov-action@v1 | ||
| - name: Test on Chrome | ||
| run: | | ||
| cd dart | ||
| pub run test -p vm test/* | ||
| - run: | | ||
| cd dart | ||
| dartanalyzer --fatal-warnings ./ | ||
| - run: | | ||
| cd dart | ||
| dartfmt -n --set-exit-if-changed ./ | ||
| package-analysis: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v2 | ||
| - uses: axel-op/dart-package-analyzer@v3 | ||
| id: analysis | ||
| with: | ||
| githubToken: ${{ secrets.GITHUB_TOKEN }} | ||
| relativePath: dart/ | ||
| - name: Check scores | ||
| env: | ||
| TOTAL: ${{ steps.analysis.outputs.total }} | ||
| TOTAL_MAX: ${{ steps.analysis.outputs.total_max }} | ||
| # TODO: Once 4.0.0 lands, change to 100 | ||
| run: | | ||
| PERCENTAGE=$(( $TOTAL * 100 / $TOTAL_MAX )) | ||
| if (( $PERCENTAGE < 90 )) | ||
| then | ||
| echo Score too low! | ||
| exit 1 | ||
| fi | ||
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 |
|---|---|---|
|
|
@@ -14,3 +14,5 @@ android/ | |
| ios/ | ||
| build/ | ||
| .cxx/ | ||
|
|
||
| .test_coverage.dart | ||
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 |
|---|---|---|
|
|
@@ -19,3 +19,4 @@ dev_dependencies: | |
| pedantic: ^1.9.2 | ||
| test: ^1.15.4 | ||
| yaml: ^2.2.1 | ||
| test_coverage: ^0.4.2 | ||
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.