-
-
Notifications
You must be signed in to change notification settings - Fork 440
262 lines (210 loc) · 8.19 KB
/
Copy pathrun-tests.yml
File metadata and controls
262 lines (210 loc) · 8.19 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
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
# Uncommment this to replace the rest of the file when you want to debug stuff in CI
#name: Run Debug
#
#on:
# push:
# pull_request:
# workflow_dispatch:
#
#jobs:
# debug:
# runs-on: ubuntu-latest
## runs-on: windows-latest
# steps:
# - uses: actions/checkout@v5
# with: { fetch-depth: 1 }
#
# - run: "echo temurin:11 > .mill-jvm-version"
#
# - uses: sbt/setup-sbt@v1
#
#
# - run: ./mill 'integration.migrating[init].shared.daemon.testOnly' mill.integration.MillInitSbtGatlingTests
#
# We run full CI on push builds to main and a subset via selective execution on all pull requests
#
# We run most tests on the same version to maximize cache compatibility with the
# build-linux/build-windows jobs, but a few are run on other JVM versions to
# verify cross-version compatibility
name: Run Tests
on:
push:
branches-ignore:
- '**-patch-**'
pull_request:
types:
- opened
- reopened
- synchronize
- ready_for_review
workflow_dispatch:
# cancel older runs of a pull request;
# this will not cancel anything for normal git pushes
concurrency:
# * For runs on other repos, always use the `ref_name` so each branch only can have one concurrent run
# * For runs on `com-lihaoyi/mill`, use `head_ref` to allow one concurrent run per PR, but `run_id` to
# allow multiple concurrent runs in master
group: cancel-old-pr-runs-${{ github.workflow }}-${{ (github.repository != 'com-lihaoyi/mill' && github.ref_name) || (github.head_ref || github.run_id) }}
cancel-in-progress: true
env:
FORCE_COLOR: '1'
jobs:
# Jobs are listed in rough order of priority: if multiple jobs fail, the first job
# in the list should be the one that's most worth looking into
build-linux:
if: (github.event.action == 'ready_for_review') || (github.event.pull_request.draft == false)
uses: ./.github/workflows/pre-build.yml
with:
java-version: 25
os: ubuntu-latest
shell: bash
build-windows:
if: (github.event.action == 'ready_for_review') || (github.event.pull_request.draft == false)
uses: ./.github/workflows/pre-build.yml
with:
java-version: 25
os: windows-latest
shell: powershell
test-dist:
if: (github.event.action == 'ready_for_review') || (github.event.pull_request.draft == false)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
with:
fetch-depth: 0
- run: ./mill website.fastPages + website.checkBrokenLinks + dist.test
cross-plat:
if: (github.event.action == 'ready_for_review') || (github.event.pull_request.draft == false)
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
# Run these with Mill native launcher as a smoketest
include:
- os: ubuntu-24.04-arm
millargs: "'example.thirdparty.{mockito,netty,arrow}.native.daemon'"
java-version: 17
- os: macos-latest
millargs: "'example.thirdparty.{acyclic,fansi,gatling}.native.daemon'"
java-version: 19
- os: macos-15-intel
millargs: "'example.thirdparty.{jimfs,commons-io}.native.daemon'"
java-version: 23
steps:
- uses: actions/checkout@v5
with: { fetch-depth: 1 }
- uses: ./.github/actions/pre-build-setup
with:
os: ${{ matrix.os }}
java-version: ${{ matrix.java-version }}
shell: bash
- uses: ./.github/actions/post-build-setup
with:
java-version: ${{ matrix.java-version }}
os: ${{ matrix.os }}
- run: ./mill -k selective.resolveTree ${{ matrix.millargs }}
shell: bash
- uses: ./.github/actions/post-build-selective
with:
millargs: ${{ matrix.millargs }}
shell: bash
linux:
needs: build-linux
strategy:
fail-fast: false
matrix:
include:
# For most tests, run them arbitrarily on Java 11 or Java 17 on Linux, and
# on the opposite version on Windows below, so we get decent coverage of
# each test on each Java version and each operating system
# We also try to group tests together to manually balance out the runtimes of each jobs
- millargs: "'{contrib,core,testkit,runner,dist.scripts}.__.test'"
- millargs: "'libs.scalalib.__.test'"
- millargs: "'libs.{scalajslib,scalanativelib,kotlinlib,pythonlib,javascriptlib,init,tabcomplete}.__.test'"
install-sbt: true
- millargs: "example.kotlinlib._._"
extra: "--jobs=1" # Kotlinlib tests seem flaky otherwise
- millargs: "example.scalalib._._"
- millargs: "example.javalib._._"
- millargs: "example.androidlib._._"
setup-android: true
- millargs: "example.thirdparty.android-compose-samples.packaged.daemon"
setup-android: true
- millargs: "example.thirdparty.koin-androidx-samples.packaged.daemon"
setup-android: true
- millargs: "example.migrating.scalalib._"
install-sbt: true
- millargs: "'example.{groovylib,pythonlib,javascriptlib}._._'"
- millargs: "'example.{cli,fundamentals,depth,extending,large}._._'"
- millargs: "'integration.feature._'"
- millargs: "'integration.dedicated._'"
# run this specifically in `native` mode to make sure our non-JVM native image
# launcher is able to bootstrap everything necessary without a JVM installed
- millargs: "integration.bootstrap.no-java-bootstrap.native.daemon"
# tests that need to be exercised in both execution modes to make
# sure they work with and without -i/--no-server being passed
- millargs: "integration.multimode._.packaged.nodaemon"
- millargs: "integration.migrating._"
install-sbt: true
- millargs: "integration.failure._"
uses: ./.github/workflows/post-build-selective.yml
with:
setup-android: ${{ matrix.setup-android || false }}
install-sbt: ${{ matrix.install-sbt || false }}
install-xvfb: ${{ matrix.install-xvfb || false }}
java-version: 25
millargs: ${{ matrix.millargs }}
extra: ${{ matrix.extra || '' }}
shell: bash
windows:
needs: build-windows
strategy:
fail-fast: false
matrix:
include:
- millargs: "integration.multimode._.packaged.daemon"
- # turn of parallelism since it sometimes causes issues with concurrent migrations
millargs: "example.migrating.javalib._.packaged.daemon"
extra: "--jobs=1"
- millargs: '"libs.{util,javalib,androidlib,graphviz}.__.test"'
- millargs: '"example.scalalib.{basic,publishing}.__.proguard.daemon"'
- millargs: "dist.scripts.test" # run this on both windows and mac to exercise bootstrap scripts
- millargs: "integration.bootstrap.no-java-bootstrap.native.daemon"
uses: ./.github/workflows/post-build-selective.yml
with:
os: windows-latest
java-version: 25
millargs: ${{ matrix.millargs }}
extra: ${{ matrix.extra || '' }}
shell: powershell
itest:
needs: build-linux
strategy:
fail-fast: false
matrix:
include:
# bootstrap tests
- java-version: 24
buildcmd: ci/test-dist-run.sh && ci/test-mill-bootstrap.sh
uses: ./.github/workflows/post-build-raw.yml
with:
java-version: ${{ matrix.java-version }}
buildcmd: ${{ matrix.buildcmd }}
# Scalafmt, Mima, and Scalafix job runs last because it's the least important:
# usually just an automated or mechanical manual fix to do before merging
lint-autofix:
needs: build-linux
uses: ./.github/workflows/post-build-raw.yml
with:
java-version: '17'
buildcmd: |
set -eux
FATAL_WARNINGS=1 ./mill mill.scalalib.scalafmt.ScalafmtModule/scalafmt --check + __.fix --check + mill.javalib.palantirformat.PalantirFormatModule/ --check + mill.kotlinlib.ktlint.KtlintModule/checkFormatAll
mima:
needs: build-linux
uses: ./.github/workflows/post-build-raw.yml
with:
java-version: '17'
buildcmd: |
set -eux
./mill __.mimaReportBinaryIssues