-
-
Notifications
You must be signed in to change notification settings - Fork 216
180 lines (180 loc) · 6.8 KB
/
ci.yml
File metadata and controls
180 lines (180 loc) · 6.8 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
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
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
name: ci
on:
push:
branches:
- "master"
paths-ignore:
- "**/README.md"
pull_request:
branches:
- "**"
jobs:
check-dart:
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
# Version Support Policy: 6 months after next significant version release
# See VERSIONING_POLICY.md for full details
#
# 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.10, Ubuntu
os: ubuntu-latest
sdk: 3.10.0
- name: Dart 3.10, macOS
os: macos-latest
sdk: 3.10.0
- name: Dart 3.10, Windows
os: windows-latest
sdk: 3.10.0
# Beta channel helps identify breaking changes early
- name: Dart beta
os: ubuntu-latest
sdk: beta
fail-fast: false
name: Test ${{ matrix.name }}
steps:
- name: Checkout code
uses: actions/checkout@v6
- name: Configure git for line endings (Windows)
if: matrix.os == 'windows-latest'
run: |
git config core.autocrlf false
git rm --cached -r .
git reset --hard
- 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@v5
# 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: false
token: ${{ secrets.CODECOV_TOKEN }}
check-flutter:
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
# Version Support Policy: 6 months after next significant version release
# See VERSIONING_POLICY.md for full details
#
# 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.38, Ubuntu
os: ubuntu-latest
sdk: 3.38.1
- name: Flutter 3.38, macOS
os: macos-latest
sdk: 3.38.1
- name: Flutter 3.38, Windows
os: windows-latest
sdk: 3.38.1
# Beta channel helps identify breaking changes early
- name: Flutter beta
os: ubuntu-latest
sdk: beta
# WASM support
- name: Flutter 3.38, Ubuntu, WASM
os: ubuntu-latest
sdk: 3.38.1
wasm: true
fail-fast: false
name: Test ${{ matrix.name }}
steps:
- name: Checkout code
uses: actions/checkout@v6
- name: Setup flutter (beta)
if: ${{ matrix.sdk == 'beta' }}
uses: subosito/flutter-action@v2
with:
channel: "beta"
- name: Setup flutter
if: ${{ matrix.sdk != 'beta' }}
uses: subosito/flutter-action@v2
with:
flutter-version: ${{ matrix.sdk }}
- 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
if: ${{ !matrix.wasm }}
run: (cd packages/flutter && flutter test --coverage)
- name: Run tests (WASM)
if: ${{ matrix.wasm }}
run: (cd packages/flutter && flutter test --platform chrome --wasm)
- 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' && !matrix.wasm }}
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@v5
# Needs to be adapted to collect the coverage at all platforms if platform specific code is added.
if: ${{ always() && matrix.os == 'ubuntu-latest' && !matrix.wasm }}
with:
files: packages/flutter/coverage/lcov-full.info
fail_ci_if_error: false
token: ${{ secrets.CODECOV_TOKEN }}
auto-release-dry-run:
runs-on: ubuntu-latest
timeout-minutes: 10
name: Auto-Release Dry Run
steps:
- name: Checkout code
uses: actions/checkout@v6
with:
fetch-depth: 0 # Required for semantic-release to analyze commit history
- name: Setup Node.js
uses: actions/setup-node@v6
with:
node-version: 24
- name: Install dependencies
run: npm ci
- name: Dry run semantic-release for dart package
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PKG_NAME: dart
run: npx semantic-release --dry-run
- name: Dry run semantic-release for flutter package
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PKG_NAME: flutter
run: npx semantic-release --dry-run
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true