ci: update workflow to use Very Good Dart Package (#133) #225
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
name: build | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
jobs: | |
semantic-pull-request: | |
uses: VeryGoodOpenSource/very_good_workflows/.github/workflows/semantic_pull_request.yml@v1 | |
build: | |
uses: VeryGoodOpenSource/very_good_workflows/.github/workflows/dart_package.yml@v1 | |
with: | |
dart_sdk: '3.5.0' # The minimum Dart SDK version supported by the package. | |
format_directories: 'lib test' | |
check_ignore: true | |
report_on: 'lib,test' | |
no_example: true | |
spell-check: | |
uses: VeryGoodOpenSource/very_good_workflows/.github/workflows/[email protected] | |
with: | |
includes: | | |
**/*.{dart,md,yaml} | |
!.dart_tool/**/*.{dart,yaml} | |
.*/**/*.yml | |
modified_files_only: false | |
pana: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/[email protected] | |
- uses: subosito/flutter-action@v2 | |
with: | |
flutter-version: "3.24.0" #Forcing to 3.24.0 for right now as pana has an issue with Dart 3.6 https://github.com/dart-lang/dartdoc/issues/3947 | |
- name: Install Dependencies | |
run: | | |
flutter packages get | |
flutter pub global activate pana | |
- name: Verify Pub Score | |
run: | | |
PANA=$(pana . --no-warning); PANA_SCORE=$(echo $PANA | sed -n "s/.*Points: \([0-9]*\)\/\([0-9]*\)./\1\/\2/p") | |
echo "score: $PANA_SCORE" | |
IFS='/'; read -a SCORE_ARR <<< "$PANA_SCORE"; SCORE=SCORE_ARR[0]; TOTAL=SCORE_ARR[1] | |
if (( $SCORE < $TOTAL )); then echo "minimum score not met!"; exit 1; fi |