-
-
Notifications
You must be signed in to change notification settings - Fork 195
154 lines (154 loc) · 5.77 KB
/
ci.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
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
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
name: ci
on:
push:
branches:
- "master"
paths-ignore:
- "**/README.md"
pull_request:
branches:
- "**"
jobs:
check-dart:
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
# Dart framework may contain breaking changes in minor version releases, not following semver.
# The latest Dart framework (below) is tested on all architectures (Ubuntu, macOS, Windows).
- name: Dart 3.3, Ubuntu
os: ubuntu-latest
sdk: 3.3.3
- name: Dart 3.3, macOS
os: macos-latest
sdk: 3.3.3
- name: Dart 3.3, Windows
os: windows-latest
sdk: 3.3.3
# Older Dart framework versions (below) are only tested with Ubuntu to reduce CI resource usage.
- name: Dart 3.2
os: ubuntu-latest
sdk: 3.2.6
- name: Dart 3.1
os: ubuntu-latest
sdk: 3.1.5
- name: Dart 3.0
os: ubuntu-latest
sdk: 3.0.7
- name: Dart beta
os: ubuntu-latest
sdk: beta
fail-fast: false
name: Test ${{ matrix.name }}
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup dart
uses: dart-lang/setup-dart@v1.5.0
with:
sdk: ${{ matrix.sdk }}
- name: Install dependencies
run: dart pub get --directory packages/dart
- name: Run build_runner
run: (cd packages/dart && dart run build_runner build --delete-conflicting-outputs)
- name: Analyze code
run: dart analyze packages/dart --fatal-infos
- name: Lint
run: dart format --output=none --set-exit-if-changed packages/dart
- name: Publish dry run
run: cd packages/dart && dart pub publish --dry-run
- name: Run tests
run: (cd packages/dart && dart test --coverage=coverage)
- name: Convert code coverage
# Needs to be adapted to collect the coverage at all platforms if platform specific code is added.
if: ${{ always() && matrix.os == 'ubuntu-latest' }}
working-directory: packages/dart
run: |
dart pub global activate coverage
dart pub global run coverage:format_coverage -i coverage/test -o coverage/lcov.info --lcov --packages=.dart_tool/package_config.json --report-on=lib
- name: Upload code coverage
uses: codecov/codecov-action@v4
# Needs to be adapted to collect the coverage at all platforms if platform specific code is added.
if: ${{ always() && matrix.os == 'ubuntu-latest' }}
with:
files: packages/dart/coverage/lcov.info
fail_ci_if_error: true
token: ${{ secrets.CODECOV_TOKEN }}
check-flutter:
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
# Flutter framework may contain breaking changes in minor version releases, not following semver.
# The latest Flutter framework (below) is tested on all architectures (Ubuntu, macOS, Windows).
- name: Flutter 3.24, Ubuntu
os: ubuntu-latest
sdk: 3.24.3
- name: Flutter 3.24, macOS
os: macos-latest
sdk: 3.24.3
- name: Flutter 3.24, Windows
os: windows-latest
sdk: 3.24.3
# Older Flutter framework versions (below) are only tested with Ubuntu to reduce CI resource usage.
- name: Flutter 3.22
os: ubuntu-latest
sdk: 3.22.3
- name: Flutter 3.19
os: ubuntu-latest
sdk: 3.19.6
- name: Flutter 3.16
os: ubuntu-latest
sdk: 3.16.9
- name: Flutter beta
os: ubuntu-latest
sdk: beta
fail-fast: false
name: Test ${{ matrix.name }}
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup flutter (beta)
if: ${{ matrix.sdk == 'beta' }}
uses: subosito/flutter-action@v2
with:
channel: "beta"
cache: true
- name: Setup flutter
if: ${{ matrix.sdk != 'beta' }}
uses: subosito/flutter-action@v2
with:
flutter-version: ${{ matrix.sdk }}
cache: true
- name: Install dependencies on Ubuntu and MacOS
if: matrix.os == 'ubuntu-latest' || matrix.os == 'macos-latest'
run: (cd packages/flutter && flutter pub get)
- name: Install dependencies on Windows
if: matrix.os == 'windows-latest'
run: cmd /c "cd packages\flutter && flutter pub get"
- name: Analyze code
run: flutter analyze packages/flutter --fatal-infos
- name: Lint
run: dart format --output=none --set-exit-if-changed packages/flutter
- name: Publish dry run
run: cd packages/flutter && dart pub publish --dry-run
- name: Run tests
run: (cd packages/flutter && flutter test --coverage)
- name: Convert code coverage
# Needs to be adapted to collect the coverage at all platforms if platform specific code is added.
if: ${{ always() && matrix.os == 'ubuntu-latest' }}
working-directory: packages/flutter
run: |
escapedPath="$(echo `pwd` | sed 's/\//\\\//g')"
sed "s/^SF:lib/SF:$escapedPath\/lib/g" coverage/lcov.info > coverage/lcov-full.info
- name: Upload code coverage
uses: codecov/codecov-action@v4
# Needs to be adapted to collect the coverage at all platforms if platform specific code is added.
if: ${{ always() && matrix.os == 'ubuntu-latest' }}
with:
files: packages/flutter/coverage/lcov-full.info
fail_ci_if_error: true
token: ${{ secrets.CODECOV_TOKEN }}
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true