-
-
Notifications
You must be signed in to change notification settings - Fork 349
222 lines (189 loc) · 7.26 KB
/
actions.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
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
name: CI
# We run full CI on push builds to main and on all pull requests
#
# Tags are automatically published
#
# Manual builds (workflow_dispatch) to the main branch are also published
#
# To maximize bug-catching changes while keeping CI times reasonable, we run:
# - All tests on Linux/Java17
# - Fewer tests on Linux/Java8 and Windows/Java17
# - Fewest tests on Windows/Java8
on:
push:
branches:
- main
tags:
- '**'
pull_request:
merge_group:
workflow_dispatch:
# cancel older runs of a pull request;
# this will not cancel anything for normal git pushes
concurrency:
group: cancel-old-pr-runs-${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
itest:
strategy:
fail-fast: false
matrix:
include:
# bootstrap tests
- java-version: 11 # Have one job on oldest JVM
buildcmd: ci/test-mill-dev.sh
- java-version: 17 # Have one job on default JVM
buildcmd: ci/test-mill-release.sh
- java-version: 17
buildcmd: ci/test-mill-bootstrap.sh
# Just some reporting to enable reasoning about library upgrades
- java-version: 11
buildcmd: |
./mill -i -k __.ivyDepsTree
./mill -i -k __.ivyDepsTree --withRuntime
uses: ./.github/workflows/run-mill-action.yml
with:
java-version: ${{ matrix.java-version }}
buildcmd: ${{ matrix.buildcmd }}
linux:
strategy:
fail-fast: false
matrix:
java-version: [11, 17]
millargs:
# Run unit and module tests on both oldest and newest Java versions
- '"{main,scalalib,testrunner,bsp}.__.test"'
include:
# For most tests, run them arbitrarily on Java 8 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
- java-version: 11
millargs: '"scalajslib.__.test"'
- java-version: 11
millargs: '"scalanativelib.__.test"'
- java-version: 17
millargs: "contrib._.test"
# Group these tests together to try and balance out the runtimes of each job
# Just running in `local` mode since they shouldn't depend on the mode
- java-version: 17
millargs: "'example.javalib.__.local.test'"
- java-version: 17
millargs: "'example.scalalib.__.local.test'"
- java-version: 11
millargs: "'example.thirdparty[{mockito,acyclic,commons-io}].local.test'"
- java-version: 17
millargs: "'example.thirdparty[{fansi,jimfs,netty,gatling}].local.test'"
- java-version: 11
millargs: "'example.depth.__.local.test'"
- java-version: 17
millargs: "'example.extending.__.local.test'"
# Most of these integration tests should not depend on which mode they
# are run in, so just run them in `local`
- java-version: 11
millargs: "'integration.{failure,feature,ide}[_].local.test'"
# These invalidation tests need to be exercised in all three execution modes
# to make sure they work with and without -i/--no-server being passed
- java-version: 17
millargs: "'integration.invalidation[_].local.test'"
- java-version: 17
millargs: "'integration.invalidation[_].fork.test'"
- java-version: 17
millargs: "'integration.invalidation[_].server.test'"
# Check docsite compiles
- java-version: 17
millargs: docs.githubPages
uses: ./.github/workflows/run-mill-action.yml
with:
java-version: ${{ matrix.java-version }}
millargs: ${{ matrix.millargs }}
compiler-bridge:
uses: ./.github/workflows/run-mill-action.yml
with:
java-version: '8'
millargs: bridge.__.publishLocal
env-bridge-versions: 'essential'
format-check:
uses: ./.github/workflows/run-mill-action.yml
with:
java-version: '11'
millargs: mill.scalalib.scalafmt.ScalafmtModule/checkFormatAll __.sources
scalafix-check:
uses: ./.github/workflows/run-mill-action.yml
with:
java-version: '11'
millargs: -i -k __.fix --check
bincompat-check:
uses: ./.github/workflows/run-mill-action.yml
with:
java-version: '11'
millargs: __.mimaReportBinaryIssues
continue-on-error: true
windows:
strategy:
fail-fast: false
matrix:
include:
# just run a subset of examples/ on Windows, because for some reason running
# the whole suite can take hours on windows v.s. half an hour on linux
- java-version: 11
millargs: '"{main,scalalib,bsp}.__.test"'
- java-version: 17
millargs: '"scalajslib.__.test"'
- java-version: 11
millargs: '"example.scalalib.basic.__.fork.test"'
- java-version: 17
millargs: "'integration.feature[_].fork.test'"
- java-version: 11
millargs: "'integration.invalidation[_].server.test'"
- java-version: 17
millargs: "'integration.failure[_].fork.test'"
- java-version: 11
millargs: "contrib.__.test"
uses: ./.github/workflows/run-mill-action.yml
with:
os: windows-latest
java-version: ${{ matrix.java-version }}
millargs: ${{ matrix.millargs }}
publish-sonatype:
# when in master repo, publish all tags and manual runs on main
if: github.repository == 'com-lihaoyi/mill' && (startsWith( github.ref, 'refs/tags/') || (github.ref == 'refs/heads/main' && github.event_name == 'workflow_dispatch' ) )
needs: [linux, windows, compiler-bridge, format-check, bincompat-check, scalafix-check, itest]
runs-on: ubuntu-latest
# only run one publish job for the same sha at the same time
# e.g. when a main-branch push is also tagged
concurrency: publish-sonatype-${{ github.sha }}
env:
SONATYPE_PGP_SECRET: ${{ secrets.SONATYPE_PGP_SECRET }}
SONATYPE_USERNAME: ${{ secrets.SONATYPE_DEPLOY_USER }}
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_DEPLOY_PASSWORD }}
SONATYPE_PGP_PASSWORD: ${{ secrets.SONATYPE_PGP_PASSWORD }}
LANG: "en_US.UTF-8"
LC_MESSAGES: "en_US.UTF-8"
LC_ALL: "en_US.UTF-8"
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: coursier/cache-action@v6
- uses: actions/setup-java@v4
with:
java-version: 8
distribution: temurin
- run: ci/release-maven.sh
release-github:
# when in master repo, publish all tags and manual runs on main
if: github.repository == 'com-lihaoyi/mill' && (startsWith( github.ref, 'refs/tags/') || (github.ref == 'refs/heads/main' && github.event_name == 'workflow_dispatch' ) )
needs: publish-sonatype
runs-on: ubuntu-latest
env:
REPO_ACCESS_TOKEN: ${{ secrets.REPO_ACCESS_TOKEN }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: coursier/cache-action@v6
- uses: actions/setup-java@v4
with:
java-version: 8
distribution: temurin
- run: ./mill -i uploadToGithub $REPO_ACCESS_TOKEN