Skip to content

Commit 197c4c2

Browse files
ci: reduce test matrix and eliminate redundant runs
1 parent dcc7ba7 commit 197c4c2

File tree

1 file changed

+30
-97
lines changed

1 file changed

+30
-97
lines changed

.github/workflows/test.yml

Lines changed: 30 additions & 97 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ on:
55
pull_request:
66
branches: [master]
77

8+
concurrency:
9+
group: ${{ github.workflow }}-${{ github.ref }}
10+
cancel-in-progress: true
11+
812
env:
913
PUB_ENVIRONMENT: bot.github
1014

@@ -39,9 +43,10 @@ jobs:
3943
flutter config --no-analytics
4044
- run: flutter pub get
4145
- run: flutter pub run webcrypto:setup
42-
- run: flutter test
46+
- run: flutter test --coverage ./coverage
4347
- run: flutter test --platform chrome
4448
- run: flutter test --platform chrome --wasm
49+
- run: xvfb-run flutter pub run test -p firefox
4550
- run: xvfb-run flutter test integration_test/webcrypto_test.dart -d linux
4651
working-directory: ./example
4752
- uses: nanasess/setup-chromedriver@v2
@@ -52,46 +57,15 @@ jobs:
5257
--driver=test_driver/integration_test.dart \
5358
--target=integration_test/webcrypto_test.dart \
5459
-d chrome
55-
- run: xvfb-run flutter pub run test -p vm,chrome,firefox
56-
macos-14:
57-
name: MacOS 14 desktop / Chrome / Firefox
58-
runs-on: macos-14 # Test with xcode 15
59-
timeout-minutes: 15
60-
steps:
61-
- uses: actions/checkout@v4
62-
- uses: subosito/flutter-action@v2
60+
# Report collected coverage
61+
- name: Convert coverage to lcov
62+
run: dart run coverage:format_coverage -i ./coverage -o ./coverage/lcov.info --lcov --report-on lib/
63+
- uses: coverallsapp/github-action@v2
6364
with:
64-
channel: 'stable'
65-
cache: true
66-
- name: Configure Flutter
67-
run: |
68-
flutter config --no-analytics
69-
- run: flutter pub get
70-
- run: flutter pub run webcrypto:setup
71-
- run: flutter test
72-
- run: flutter test --platform chrome
73-
- run: flutter test --platform chrome --wasm
74-
- run: flutter test integration_test/webcrypto_test.dart -d macos
75-
working-directory: ./example
76-
# TODO: Enable chromedriver testing on MacOS when it works reliably
77-
#- uses: nanasess/setup-chromedriver@v2
78-
#- name: Run integration_test with chromedriver
79-
# working-directory: ./example
80-
# run: |
81-
# ../tool/with-chromedriver.sh flutter drive \
82-
# --driver=test_driver/integration_test.dart \
83-
# --target=integration_test/webcrypto_test.dart \
84-
# -d chrome
85-
- uses: browser-actions/setup-firefox@v1
86-
- name: flutter pub run test -p vm,chrome,firefox
87-
shell: bash
88-
# Remove FIREFOX_EXECUTABLE override when flutter upgrades past package:test 1.25.8
89-
# Issue is fixed in https://github.com/dart-lang/test/pull/2276
90-
run: |
91-
export FIREFOX_EXECUTABLE="$(which firefox)"
92-
flutter pub run test -p vm,chrome,firefox
93-
macos-15:
94-
name: MacOS 15 desktop / Chrome / Firefox
65+
flag-name: linux
66+
parallel: true
67+
macos:
68+
name: MacOS desktop / Chrome / Firefox
9569
runs-on: macos-15 # Test with xcode 16
9670
timeout-minutes: 15
9771
steps:
@@ -112,13 +86,13 @@ jobs:
11286
working-directory: ./example
11387
# TODO: Enable chromedriver testing on MacOS when it works reliably
11488
- uses: browser-actions/setup-firefox@v1
115-
- name: flutter pub run test -p vm,chrome,firefox
89+
- name: Run Firefox tests
11690
shell: bash
11791
# Remove FIREFOX_EXECUTABLE override when flutter upgrades past package:test 1.25.8
11892
# Issue is fixed in https://github.com/dart-lang/test/pull/2276
11993
run: |
12094
export FIREFOX_EXECUTABLE="$(which firefox)"
121-
flutter pub run test -p vm,chrome,firefox
95+
flutter pub run test -p firefox
12296
windows:
12397
name: Windows desktop / Chrome / Firefox
12498
runs-on: windows-latest
@@ -135,9 +109,9 @@ jobs:
135109
flutter config --no-analytics
136110
- run: flutter pub get
137111
- run: flutter pub run webcrypto:setup
138-
- run: flutter test
139-
#- run: flutter test --platform chrome
140-
#- run: flutter test --platform chrome --wasm
112+
- run: flutter test --coverage ./coverage
113+
- run: flutter pub run test -p chrome
114+
- run: flutter pub run test -p firefox
141115
- run: flutter test integration_test/webcrypto_test.dart -d windows
142116
working-directory: ./example
143117
- uses: nanasess/setup-chromedriver@v2
@@ -149,11 +123,18 @@ jobs:
149123
--driver=test_driver/integration_test.dart \
150124
--target=integration_test/webcrypto_test.dart \
151125
-d chrome
152-
- run: flutter pub run test -p vm,chrome,firefox
126+
# Report collected coverage
127+
- name: Convert coverage to lcov
128+
run: dart run coverage:format_coverage -i ./coverage -o ./coverage/lcov.info --lcov --report-on lib/
129+
- uses: coverallsapp/github-action@v2
130+
with:
131+
flag-name: windows
132+
parallel: true
153133
ios:
154134
name: iOS emulator (iPhone)
155135
runs-on: macos-14
156136
timeout-minutes: 15
137+
continue-on-error: true
157138
steps:
158139
- uses: actions/checkout@v4
159140
- uses: subosito/flutter-action@v2
@@ -173,6 +154,7 @@ jobs:
173154
name: Android emulator
174155
runs-on: ubuntu-latest
175156
timeout-minutes: 15
157+
continue-on-error: true
176158
steps:
177159
- uses: actions/checkout@v4
178160
- uses: subosito/flutter-action@v2
@@ -202,62 +184,13 @@ jobs:
202184
arch: x86_64
203185
working-directory: ./example
204186
script: flutter test integration_test/webcrypto_test.dart -d emulator
205-
linux-coverage:
206-
name: Linux desktop / Chrome / Firefox (coverage)
207-
runs-on: ubuntu-latest
208-
timeout-minutes: 15
209-
steps:
210-
- uses: actions/checkout@v4
211-
- uses: subosito/flutter-action@v2
212-
with:
213-
channel: 'stable'
214-
cache: true
215-
- name: Configure Flutter
216-
run: |
217-
sudo apt-get update -y
218-
sudo apt-get install -y ninja-build libgtk-3-dev
219-
flutter config --no-analytics
220-
- run: flutter pub get
221-
- run: flutter pub run webcrypto:setup
222-
- run: xvfb-run flutter pub run test -p vm,chrome,firefox -c dart2js,dart2wasm --coverage ./coverage
223-
# Report collected coverage
224-
- name: Convert coverage to lcov
225-
run: dart run coverage:format_coverage -i ./coverage -o ./coverage/lcov.info --lcov --report-on lib/
226-
- uses: coverallsapp/github-action@v2
227-
with:
228-
flag-name: linux
229-
parallel: true
230-
windows-coverage:
231-
name: Windows desktop / Chrome / Firefox (coverage)
232-
runs-on: windows-latest
233-
timeout-minutes: 15
234-
steps:
235-
- uses: ilammy/setup-nasm@v1
236-
- uses: actions/checkout@v4
237-
- uses: subosito/flutter-action@v2
238-
with:
239-
channel: 'stable'
240-
cache: true
241-
- name: Configure Flutter
242-
run: |
243-
flutter config --no-analytics
244-
- run: flutter pub get
245-
- run: flutter pub run webcrypto:setup
246-
- run: flutter pub run test -p vm,chrome,firefox --coverage ./coverage
247-
# Report collected coverage
248-
- name: Convert coverage to lcov
249-
run: dart run coverage:format_coverage -i ./coverage -o ./coverage/lcov.info --lcov --report-on lib/
250-
- uses: coverallsapp/github-action@v2
251-
with:
252-
flag-name: windows
253-
parallel: true
254187
coverage:
255188
name: Report to coveralls
256189
runs-on: ubuntu-latest
257190
timeout-minutes: 15
258191
needs:
259-
- linux-coverage
260-
- windows-coverage
192+
- linux
193+
- windows
261194
steps:
262195
- uses: coverallsapp/github-action@v2
263196
with:

0 commit comments

Comments
 (0)