Refactor error handling in hooks to use catch instead of on TestFailure #138
Workflow file for this run
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
| name: Dart | |
| on: | |
| push: | |
| branches: [ master ] | |
| paths-ignore: | |
| - '**/README.md' | |
| pull_request: | |
| branches: [ master ] | |
| paths-ignore: | |
| - '**/README.md' | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: π― Setup Dart SDK | |
| uses: dart-lang/setup-dart@v1 | |
| - name: π Install dependencies | |
| run: dart pub get --no-example | |
| - name: π¨βπ¨ Validate formatting | |
| run: dart format --set-exit-if-changed lib test | |
| - name: π΅οΈββοΈ Analyze project source | |
| run: dart analyze --fatal-infos --format machine lib test | |
| - name: π€ Install coverage | |
| run: dart pub global activate coverage | |
| - name: π§ͺ Run tests | |
| run: dart pub global run coverage:test_with_coverage | |
| - name: π― Check Code Coverage | |
| uses: VeryGoodOpenSource/very_good_coverage@v1 | |
| - name: π₯ Update coverage badge | |
| if: github.event_name != 'pull_request' | |
| uses: coverallsapp/[email protected] | |
| with: | |
| github-token: ${{ secrets.github_token }} | |
| - name: π Check pana | |
| run: | | |
| dart pub global activate pana | |
| 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 |