-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
26 additions
and
19 deletions.
There are no files selected for viewing
This file contains 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 |
---|---|---|
@@ -1,27 +1,32 @@ | ||
name: Dart/Flutter Package Analyzer | ||
name: pub score | ||
on: | ||
pull_request: | ||
branches: | ||
- master | ||
- develop | ||
|
||
- master | ||
|
||
jobs: | ||
package-analysis: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Install Flutter | ||
uses: subosito/flutter-action@v2 | ||
- uses: actions/checkout@v2 | ||
- uses: axel-op/dart-package-analyzer@v3 | ||
# set an id for the current step | ||
id: analysis | ||
with: | ||
channel: stable | ||
|
||
- name: Install dependencies | ||
run: flutter pub get | ||
|
||
- name: Format code | ||
run: flutter format --set-exit-if-changed . | ||
githubToken: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Analyze code | ||
run: flutter analyze --fatal-infos . | ||
# You can then use this id to retrieve the outputs in the next steps. | ||
# The following step shows how to exit the workflow with an error if the total score in percentage is below 50: | ||
- name: check scores | ||
env: | ||
# NB: "analysis" is the id set above. Replace it with the one you used if different. | ||
TOTAL: ${{ steps.analysis.outputs.total }} | ||
TOTAL_MAX: ${{ steps.analysis.outputs.total_max }} | ||
run: | | ||
PERCENTAGE=$(( $TOTAL * 100 / $TOTAL_MAX )) | ||
if (( $PERCENTAGE < 100 )) | ||
then | ||
echo Score too low! | ||
exit 1 | ||
fi |
This file contains 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 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