v0.25.9 #3943
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: Run tests | |
on: | |
workflow_dispatch: | |
pull_request: | |
push: | |
branches: | |
- main | |
jobs: | |
run-tests: | |
name: Run Flutter tests | |
runs-on: ubuntu-latest | |
timeout-minutes: 10 | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- uses: "./.github/shared_workflows/install_apt_dependencies" | |
- name: Setup cache | |
uses: actions/cache@v4 | |
with: | |
path: | | |
.dart_tool/ | |
build/ | |
.flutter-plugins | |
.flutter-plugins-dependencies | |
pubspec.lock | |
key: ${{ runner.OS }}-saber-${{ hashFiles('**/pubspec.lock') }}-${{ hashFiles('**/*.dart') }} | |
restore-keys: | | |
${{ runner.OS }}-saber- | |
- name: Setup Flutter | |
uses: subosito/flutter-action@v2 | |
with: | |
channel: stable | |
cache: true | |
cache-key: 'flutter-:os:-:channel:-:version:-:arch:' | |
- name: Disable Flutter CLI animations | |
run: flutter config --no-cli-animations | |
- run: flutter pub get | |
- name: Run tests | |
id: tests | |
run: flutter test --coverage | |
- name: Upload to Codecov | |
if: success() | |
uses: codecov/codecov-action@v4 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
files: coverage/lcov.info | |
- name: Ensure test failures directory exists | |
if: failure() | |
run: mkdir -p test/failures | |
- name: Upload test failures | |
if: failure() | |
uses: actions/upload-artifact@v4 | |
with: | |
name: Saber-test-failures | |
path: test/failures | |
- name: Lints | |
uses: invertase/github-action-dart-analyzer@v3 |