-
-
Notifications
You must be signed in to change notification settings - Fork 2
82 lines (80 loc) · 2.61 KB
/
test-coverage.yml
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
name: test-coverage
run-name: Test the project coverage and upload to codecov
permissions:
contents: write
packages: write
deployments: write
issues: write
pull-requests: write
repository-projects: write
security-events: write
statuses: write
on: push
jobs:
check_changes:
outputs:
run_build: ${{ steps.verify-changed-files.outputs.any_changed }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Verify Changed files
uses: tj-actions/changed-files@v42
id: verify-changed-files
with:
files: |
.github/workflows/test-coverage.yml
pubspec.yaml
pubspec.lock
l10n.yaml
lib/**
android/**
test/**
integration_test/**
build:
runs-on: ubuntu-latest
needs: check_changes
if: needs.check_changes.outputs.run_build == 'true'
steps:
- name: Enable KVM group perms
run: |
echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules
sudo udevadm control --reload-rules
sudo udevadm trigger --name-match=kvm
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/setup-java@v2
with:
distribution: 'zulu'
java-version: '11'
- uses: subosito/flutter-action@v2
with:
channel: 'stable'
cache: true
cache-key: 'flutter-:os:-:channel:-:version:' # optional, change this to force refresh cache
architecture: x64
- run: flutter pub get
- run: dart pub global activate full_coverage
- run: flutter analyze .
- run: flutter gen-l10n
- run: dart pub global run full_coverage
- run: flutter test --coverage
- name: run integration tests
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: 31
arch: x86_64
profile: pixel_6_pro
avd-name: Pixel_6_Pro_API_31
force-avd-creation: false
ram-size: 4096M
emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
disable-animations: true
script: flutter test integration_test/app_test.dart --coverage --dart-define=USERNAME=${{ secrets.USERNAME }} --dart-define=PASSWORD=${{ secrets.PASSWORD }} --dart-define=NAME="${{ secrets.NAME }}"
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: true