Skip to content

Run tests

Run tests #259

Workflow file for this run

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/codecov-action@v4.0.1
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 }}