Run tests #312
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: Run tests | |
on: | |
pull_request: | |
types: | |
- opened | |
- synchronize | |
- reopened | |
push: | |
branches: | |
- main | |
schedule: | |
- cron: "0 0 * * 0" # Run on Sundays | |
concurrency: | |
group: ${{ github.repository }}-${{ github.workflow }}-${{ github.ref }}-${{ github.ref == 'refs/heads/main' && github.sha || ''}} | |
cancel-in-progress: true | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install Flutter | |
uses: subosito/flutter-action@v2 | |
with: | |
channel: 'stable' | |
cache: true | |
- name: Restore Dart cache | |
id: restore-dart-cache | |
uses: actions/cache/restore@v3 | |
with: | |
path: .dart_tool | |
key: ${{ runner.os }}-dart-${{ hashFiles('**/pubspec.lock') }}- | |
- run: flutter pub get --enforce-lockfile | |
- run: dart format --set-exit-if-changed . | |
- run: dart run build_runner build --delete-conflicting-outputs # Generate mocks | |
- run: flutter analyze . | |
- run: flutter test --test-randomize-ordering-seed=random --coverage | |
- name: Upload coverage reports to Codecov | |
uses: codecov/[email protected] | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
slug: chill-chinese/stroke-order-animator | |
- name: Save Dart cache | |
uses: actions/cache/save@v3 | |
with: | |
path: .dart_tool | |
key: ${{ runner.os }}-dart-${{ hashFiles('**/pubspec.lock') }}-${{ github.run_id }} |