forked from ionicfirebaseapp/getwidget
-
Notifications
You must be signed in to change notification settings - Fork 0
53 lines (47 loc) · 1.51 KB
/
flutter_test.yml
File metadata and controls
53 lines (47 loc) · 1.51 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
name: Flutter Test
on:
# Run tests on PRs to verify code doesn't break before merge
pull_request:
types: [opened, synchronize]
# Your production branch. If not the default, update here and set Target Branch at https://gitauto.ai/settings/rules to match
branches: [master]
paths:
- '**/*.dart'
- pubspec.yaml
- pubspec.lock
# Run tests after merge and collect coverage as canonical source of truth
push:
# Your production branch. If not the default, update here and set Target Branch at https://gitauto.ai/settings/rules to match
branches: [master]
paths:
- '**/*.dart'
- pubspec.yaml
- pubspec.lock
# Allow manual trigger for debugging
workflow_dispatch:
# Cancel older runs when new commits are pushed to the same PR/branch
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Flutter
uses: subosito/flutter-action@v2
with:
flutter-version: "3.29.0"
- name: Run Flutter Tests
run: |
if [ "${{ github.event_name }}" = "pull_request" ]; then
flutter test
else
flutter test --coverage
fi
- name: Upload coverage report
if: github.event_name != 'pull_request'
uses: actions/upload-artifact@v4
with:
name: coverage-report
path: coverage/lcov.info