-
Notifications
You must be signed in to change notification settings - Fork 55
78 lines (61 loc) · 2.09 KB
/
dart.yaml
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
name: Dart-CI-Pipeline
on:
push:
branches: [ '**' ]
pull_request:
branches: [ '**' ]
env:
flutter_version: 3.19.6
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Cache Flutter dependencies
uses: actions/cache@v3
with:
path: /opt/hostedtoolcache/flutter
key: ${{ runner.OS }}-flutter-install-cache-${{ env.flutter_version }}
restore-keys: ${{ runner.OS }}-flutter-install-cache
- uses: subosito/flutter-action@v2
with:
flutter-version: ${{ env.flutter_version }}
- run: flutter --version
- run: flutter clean
- name: Install Dependencies
run: flutter pub get
- run: flutter pub outdated
- name: Analyze
run: dart analyze --fatal-infos
- name: Format
run: dart format --output=none --set-exit-if-changed .
- name: Create helper file for coverage results
run: |
file=test/coverage_helper_test.dart
echo "// Helper file to make coverage work for all dart files\n" > $file
echo "// ignore_for_file: unused_import, directives_ordering" >> $file
find lib ! -name '*_web.dart' -name '*dart' | \
cut -c4- | \
awk -v package=$1 '{printf "import '\''package:flutter_code_editor%s%s'\'';\n", package, $1}' >> $file
echo "void main(){}" >> $file
echo "\n"
cat $file
echo "\n"
- name: Test
run: flutter test --coverage
# As we don't use file generation, it is fine to include everything.
# - name: Install lcov
# run: sudo apt-get install -y lcov
#
# - name: Remove generated files from coverage results
# run: |
# lcov --remove coverage/lcov.info \
# 'lib/*/*freezed.dart' \
# 'lib/*/*.g.dart' \
# 'lib/*/*.part.dart' \
# 'lib/generated/*.dart' \
# 'lib/generated/*/*.dart' -o coverage/lcov.info
- name: Codecov
uses: codecov/codecov-action@v3
with:
file: coverage/lcov.info