-
Notifications
You must be signed in to change notification settings - Fork 3
111 lines (91 loc) · 3.4 KB
/
Copy pathdart.yml
File metadata and controls
111 lines (91 loc) · 3.4 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
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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
# cspell:words subosito
name: Dart
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
on:
push:
branches: [ 'main' ]
pull_request:
branches: [ 'main' ]
jobs:
cspell:
name: 🔤 Check Spelling
uses: VeryGoodOpenSource/very_good_workflows/.github/workflows/spell_check.yml@v1
with:
config: cspell.config.yaml
build_dart_packages:
name: 🏗️ Build & Test
runs-on: ubuntu-latest
strategy:
matrix:
package: ['cli', 'cli_client', 'client', 'db', 'gen', 'protocol', 'server', 'types']
steps:
- uses: actions/checkout@v4
# Note: This workflow uses the latest stable version of the Dart SDK.
# You can specify other versions if desired, see documentation here:
# https://github.com/dart-lang/setup-dart/blob/main/README.md
- uses: dart-lang/setup-dart@v1
# Install dependencies for all packages since some import each other.
- name: Install dependencies
run: dart pub get
working-directory: packages/${{ matrix.package }}
- name: Verify formatting
run: dart format --output=none --set-exit-if-changed .
working-directory: packages/${{ matrix.package }}
# Consider passing '--fatal-infos' for slightly stricter analysis.
- name: Analyze project source
run: dart analyze
working-directory: packages/${{ matrix.package }}
- name: Run tests with coverage
run: dart test --coverage=coverage
working-directory: packages/${{ matrix.package }}
- name: Convert coverage to lcov
# Intentionally excluding openapi generated code from coverage for now.
run: >
dart run coverage:format_coverage
--lcov
--in=coverage
--out=coverage.lcov
--packages=.dart_tool/package_config.json
--report-on=../cli/lib/
--report-on=../cli_client/lib/
--report-on=../client/lib/
--report-on=../db/lib/
--report-on=../gen/lib/
--report-on=../protocol/lib/
--report-on=../server/lib/
--report-on=../types/lib/
working-directory: packages/${{ matrix.package }}
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v5
with:
fail_ci_if_error: true
token: ${{ secrets.CODECOV_TOKEN }}
files: packages/${{ matrix.package }}/coverage.lcov
# build_flutter_packages:
# name: 🏗️ Build & Test
# runs-on: ubuntu-latest
# strategy:
# matrix:
# package: ['ui']
# steps:
# - uses: actions/checkout@v4
# - uses: subosito/flutter-action@v2
# - name: Install dependencies
# run: flutter pub get
# working-directory: packages/${{ matrix.package }}
# - name: Verify formatting
# run: dart format --output=none --set-exit-if-changed .
# working-directory: packages/${{ matrix.package }}
# - name: Analyze project source
# run: dart analyze
# working-directory: packages/${{ matrix.package }}
# - name: Run tests with coverage
# run: flutter test --coverage
# working-directory: packages/${{ matrix.package }}
# - name: Upload coverage reports to Codecov
# uses: codecov/codecov-action@v5
# with:
# fail_ci_if_error: true
# token: ${{ secrets.CODECOV_TOKEN }}