Skip to content

Commit a4604fa

Browse files
committed
Enable Windows bots
1 parent 451d918 commit a4604fa

File tree

7 files changed

+64
-28
lines changed

7 files changed

+64
-28
lines changed

.github/workflows/build.yaml

Lines changed: 27 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -13,18 +13,27 @@ on:
1313
# Declare default permissions as read only.
1414
permissions: read-all
1515

16+
defaults:
17+
run:
18+
# Use Bash on all platforms including Windows to avoid
19+
# two copies of bot scripts.
20+
shell: bash
21+
1622
env:
1723
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
1824
jobs:
1925
flutter-prep:
2026
uses: ./.github/workflows/flutter-prep.yaml
2127

2228
main:
23-
name: main
29+
name: ${{ matrix.os }} main
2430
needs: flutter-prep
25-
runs-on: ubuntu-latest
31+
runs-on: ${{ matrix.os }}
32+
2633
strategy:
2734
fail-fast: false
35+
matrix:
36+
os: [ubuntu-latest, windows-latest]
2837
steps:
2938
- name: git clone
3039
uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac
@@ -75,16 +84,17 @@ jobs:
7584
dcm analyze packages/devtools_app packages/devtools_app_shared packages/devtools_extensions packages/devtools_shared packages/devtools_test
7685
7786
test-packages:
78-
name: ${{ matrix.package }} test
87+
name: ${{ matrix.os }} ${{ matrix.package }} test
7988
needs: flutter-prep
80-
runs-on: ubuntu-latest
89+
runs-on: ${{ matrix.os }}
8190
strategy:
8291
fail-fast: false
8392
matrix:
8493
package:
8594
- devtools_app_shared
8695
- devtools_extensions
8796
- devtools_shared
97+
os: [ubuntu-latest, windows-latest]
8898
steps:
8999
- name: git clone
90100
uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac
@@ -100,11 +110,13 @@ jobs:
100110
run: ./tool/ci/package_tests.sh
101111

102112
test-tool:
103-
name: Tool test
113+
name: ${{ matrix.os }} Tool test
104114
needs: flutter-prep
105-
runs-on: ubuntu-latest
115+
runs-on: ${{ matrix.os }}
106116
strategy:
107117
fail-fast: false
118+
matrix:
119+
os: [ubuntu-latest, windows-latest]
108120
steps:
109121
- name: git clone
110122
uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac
@@ -118,9 +130,9 @@ jobs:
118130
run: ./tool/ci/tool_tests.sh
119131

120132
test:
121-
name: ${{ matrix.bot }}
133+
name: ${{ matrix.os }} ${{ matrix.bot }}
122134
needs: flutter-prep
123-
runs-on: ubuntu-latest
135+
runs-on: ${{ matrix.os }}
124136
strategy:
125137
fail-fast: false
126138
matrix:
@@ -129,6 +141,7 @@ jobs:
129141
- build_dart2js
130142
- test_ddc
131143
- test_dart2js
144+
os: [ubuntu-latest, windows-latest]
132145
steps:
133146
- name: git clone
134147
uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac
@@ -186,12 +199,13 @@ jobs:
186199
echo "::notice title=To Quickly Fix Goldens:: Run \`dt fix-goldens --run-id=$WORKFLOW_ID\` on your local branch."
187200
188201
devtools-app-integration-test:
189-
name: devtools_app integration-test ${{ matrix.bot }} - ${{ matrix.device }} - shard ${{ matrix.shard }}
202+
name: ${{ matrix.os }} devtools_app integration-test ${{ matrix.bot }} - ${{ matrix.device }} - shard ${{ matrix.shard }}
190203
needs: flutter-prep
191-
runs-on: macos-latest
204+
runs-on: ${{ matrix.os }}
192205
strategy:
193206
fail-fast: false
194207
matrix:
208+
os: [macos-latest, windows-latest]
195209
# Consider running integration tests in ddc mode, too.
196210
bot: [integration_dart2js]
197211
device: [flutter, flutter-web, dart-cli]
@@ -251,14 +265,15 @@ jobs:
251265
path: packages/devtools_app/integration_test/**/failures/*.png
252266

253267
devtools-extensions-integration-test:
254-
name: devtools_extensions integration-test ${{ matrix.bot }}
268+
name: ${{ matrix.os }} devtools_extensions integration-test ${{ matrix.bot }}
255269
needs: flutter-prep
256-
runs-on: ubuntu-latest
270+
runs-on: ${{ matrix.os }}
257271
strategy:
258272
fail-fast: false
259273
matrix:
260274
# Consider running integration tests in ddc mode, too.
261275
bot: [integration_dart2js]
276+
os: [ubuntu-latest, windows-latest]
262277
steps:
263278
- name: git clone
264279
uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac

.github/workflows/flutter-prep.yaml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,17 @@
44

55
name: Flutter SDK prep
66

7+
defaults:
8+
run:
9+
# Use Bash on all platforms including Windows to avoid
10+
# two copies of bot scripts.
11+
shell: bash
12+
713
on:
814
workflow_call:
915
inputs:
1016
os-name:
11-
description: 'The OS to run against, either "macos" or "ubuntu". If neither is provided, will run against both.'
17+
description: 'The OS to run against, either "macos", "ubuntu" or "windows". If none is provided, will run against all.'
1218
type: string
1319

1420
outputs:
@@ -23,7 +29,7 @@ jobs:
2329
latest_flutter_candidate: ${{ steps.flutter-candidate.outputs.FLUTTER_CANDIDATE }}
2430
strategy:
2531
matrix:
26-
os: ${{ (inputs.os-name == 'macos' && fromJSON('[ "macos-latest"]')) || (inputs.os-name == 'ubuntu' && fromJSON('[ "ubuntu-latest"]')) || fromJSON('["ubuntu-latest", "macos-latest"]') }}
32+
os: ${{ (inputs.os-name == 'macos' && fromJSON('[ "macos-latest"]')) || (inputs.os-name == 'ubuntu' && fromJSON('[ "ubuntu-latest"]')) || (inputs.os-name == 'windows' && fromJSON('[ "windows-latest"]')) || fromJSON('["ubuntu-latest", "macos-latest", "windows-latest"]') }}
2733
runs-on: ${{ matrix.os }}
2834
steps:
2935
# TODO(https://github.com/flutter/devtools/issues/5729) Consider caching DevTools so that we

packages/devtools_app/integration_test/test_infra/run/_test_app_driver.dart

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,18 @@ class TestFlutterApp extends IntegrationTestApp {
2121

2222
@override
2323
Future<void> startProcess() async {
24-
runProcess = await Process.start('flutter', [
25-
'run',
26-
'--machine',
27-
'-d',
28-
testAppDevice.argName,
29-
// Do not serve DevTools from Flutter Tools.
30-
'--no-devtools',
31-
], workingDirectory: testAppPath);
24+
runProcess = await Process.start(
25+
Platform.isWindows ? 'flutter.bat' : 'flutter',
26+
[
27+
'run',
28+
'--machine',
29+
'-d',
30+
testAppDevice.argName,
31+
// Do not serve DevTools from Flutter Tools.
32+
'--no-devtools',
33+
],
34+
workingDirectory: testAppPath,
35+
);
3236
}
3337

3438
@override

packages/devtools_app/test/screens/memory/diff/controller/memory_footprint_test.dart

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,5 +40,12 @@ void main() {
4040
expect(delta, greaterThan(lowerThreshold));
4141
expect(delta, lessThan(upperThreshold));
4242
},
43+
// TODO(dantup): Understand why this fails on Windows. The delta is smaller
44+
// than expected.
45+
//
46+
// Expected: a value greater than <322122547.2>
47+
// Actual: <320659456>
48+
// Which: is not a value greater than <322122547.2>
49+
skip: Platform.isWindows,
4350
);
4451
}

packages/devtools_shared/lib/src/test/integration_test_runner.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,8 @@ class IntegrationTestRunner with IOMixin {
6262
];
6363

6464
debugLog('> flutter ${flutterDriveArgs.join(' ')}');
65-
final process = await Process.start('flutter', flutterDriveArgs);
65+
final process = await Process.start(
66+
Platform.isWindows ? 'flutter.bat' : 'flutter', flutterDriveArgs);
6667

6768
bool stdOutWriteInProgress = false;
6869
bool stdErrWriteInProgress = false;

tool/ci/package_tests.sh

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,20 @@ if [ "$PACKAGE" = "devtools_app_shared" ]; then
1616
flutter test test/
1717
popd
1818

19-
elif [ "$PACKAGE" = "devtools_extensions" ]; then
19+
elif [ "$PACKAGE" = "devtools_extensions" ]; then
2020

2121
pushd $DEVTOOLS_DIR/packages/devtools_extensions
2222
echo `pwd`
2323
flutter test test/*_test.dart
24-
flutter test test/web --platform chrome
24+
# Skip this on Windows because `flutter test --platform chrome`
25+
# appears to hand there.
26+
# https://github.com/flutter/flutter/issues/162798
27+
if [[ $RUNNER_OS != "Windows" ]]; then
28+
flutter test test/web --platform chrome
29+
fi
2530
popd
2631

27-
elif [ "$PACKAGE" = "devtools_shared" ]; then
32+
elif [ "$PACKAGE" = "devtools_shared" ]; then
2833

2934
pushd $DEVTOOLS_DIR/packages/devtools_shared
3035
echo `pwd`

tool/ci/setup.sh

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ export DEVTOOLS_DIR=$SCRIPT_DIR/../..
1313
# In GitBash on Windows, we have to call flutter.bat so we alias them in this
1414
# script to call the correct one based on the OS.
1515
function flutter {
16-
# TODO: Also support windows on github actions.
1716
if [[ $RUNNER_OS == "Windows" ]]; then
1817
command flutter.bat "$@"
1918
else
@@ -22,7 +21,6 @@ function flutter {
2221
}
2322
export -f flutter
2423

25-
# TODO: Also support windows on github actions.
2624
if [[ $RUNNER_OS == "Windows" ]]; then
2725
echo Installing Google Chrome Stable...
2826
# Install Chrome via Chocolatey while `addons: chrome` doesn't seem to work on Windows yet

0 commit comments

Comments
 (0)