forked from hoangnguyen92dn/survey-flutter-ic
-
Notifications
You must be signed in to change notification settings - Fork 0
49 lines (42 loc) · 1.42 KB
/
test.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
name: CI
on:
# Trigger the workflow on push or pull request,
# but push action is only for the feature branch
pull_request:
types: [ opened, synchronize, edited, reopened ]
push:
branches-ignore:
- develop
- 'release/**'
jobs:
lint_and_test:
name: Static code analyze & Unit test
runs-on: ubuntu-latest
environment: staging
steps:
- uses: actions/[email protected]
# Setup the flutter environment.
- name: Setup Flutter environment
uses: subosito/flutter-action@v2
with:
channel: 'stable'
flutter-version: '3.7.7'
- name: Get flutter dependencies.
run: flutter pub get
- name: Run code generator
run: flutter packages pub run build_runner build --delete-conflicting-outputs
- name: Check for any formatting issues in the code.
run: flutter format --set-exit-if-changed .
- name: Statically analyze the Dart code for any errors.
run: flutter analyze .
- name: Run widget tests, unit tests.
run: flutter test --machine --coverage
- name: Upload coverage to codecov
uses: codecov/codecov-action@v2
with:
name: Upload coverage to codecov
files: ./coverage/lcov.info
flags: unittests # optional
token: ${{ secrets.CODECOV_TOKEN }} # not required for public repos
fail_ci_if_error: false
verbose: true