forked from typetools/checker-framework
-
Notifications
You must be signed in to change notification settings - Fork 19
265 lines (249 loc) · 10 KB
/
ci.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
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
263
264
265
name: CI tests
on:
pull_request:
push:
branches: [ "master" ]
# Configure GitHub Actions cancel in progress workflow to avoid redundant runs in pull requests.
# See: https://docs.github.com/en/enterprise-cloud@latest/actions/writing-workflows/choosing-what-your-workflow-does/control-the-concurrency-of-workflows-and-jobs
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ !contains(github.ref, 'heads/master')}}
jobs:
# Basic sanity tests on JDK 21.
sanity:
name: ${{ matrix.script }} on JDK ${{ matrix.java_version }}
runs-on: ubuntu-latest
permissions:
contents: read
strategy:
matrix:
script: ['cftests-junit', 'cftests-nonjunit']
java_version: [21]
env:
JAVA_VERSION: ${{ matrix.java_version }}
steps:
- uses: actions/checkout@v4
- name: Set up JDK ${{ matrix.java_version }}
uses: actions/setup-java@v4
with:
java-version: ${{ matrix.java_version }}
distribution: 'temurin'
# Configure Gradle for optimal use in GitHub Actions, including caching of downloaded dependencies.
# See: https://github.com/gradle/actions/blob/main/setup-gradle/README.md
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4.2.2
- name: Setup Bazel
uses: bazel-contrib/setup-bazel@0.12.0
if: ${{ matrix.script == 'cftests-nonjunit' }}
with:
# Avoid downloading Bazel every time.
bazelisk-cache: true
# Store build cache per workflow.
disk-cache: ${{ github.workflow }}
# Share repository cache between workflows.
repository-cache: true
- name: Run test script checker/bin-devel/test-${{ matrix.script }}
run: ./checker/bin-devel/test-${{ matrix.script }}.sh
# The remaining tests for JDK 21. Separate from `sanity` to allow parallelism with `otheros`.
remainder:
name: ${{ matrix.script }} on JDK ${{ matrix.java_version }}
runs-on: ubuntu-latest
# Don't depend on sanity jobs, to have more parallelism.
# TODO: cancel these jobs if sanity fails.
# needs: sanity
permissions:
contents: read
strategy:
fail-fast: true
matrix:
# No need to run 'cftests-junit-jdk21' on JDK 21.
script: ['typecheck-part1', 'typecheck-part2',
'guava', 'plume-lib',
'daikon-part1', 'daikon-part2',
'jspecify-conformance', 'jspecify-reference-checker',
'misc']
java_version: [21]
env:
JAVA_VERSION: ${{ matrix.java_version }}
steps:
- uses: actions/checkout@v4
if: ${{ matrix.script != 'misc' }}
with:
fetch-depth: 1
- uses: actions/checkout@v4
if: ${{ matrix.script == 'misc' }}
with:
# CI diff needs more history - 0 fetches all history.
fetch-depth: 0
- name: Set up JDK ${{ matrix.java_version }}
uses: actions/setup-java@v4
with:
java-version: ${{ matrix.java_version }}
distribution: 'temurin'
# Configure Gradle for optimal use in GitHub Actions, including caching of downloaded dependencies.
# See: https://github.com/gradle/actions/blob/main/setup-gradle/README.md
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4.2.2
# Setup for misc tests
- name: Install misc dependencies
if: ${{ matrix.script == 'misc' }}
run: |
sudo apt install -y shellcheck devscripts python3-pip \
texlive-latex-base texlive-latex-extra latexmk librsvg2-bin \
autoconf dia hevea latexmk libasound2-dev rsync pdf2svg \
libcups2-dev libfontconfig1-dev libx11-dev libxext-dev \
libxrender-dev libxrandr-dev libxtst-dev libxt-dev \
texlive-font-utils texlive-fonts-recommended texlive-latex-recommended
pip install black flake8 html5validator
- name: Run test script checker/bin-devel/test-${{ matrix.script }}
run: ./checker/bin-devel/test-${{ matrix.script }}.sh
otherjdks:
name: ${{ matrix.script }} on JDK ${{ matrix.java.version }}
runs-on: ubuntu-latest
needs: sanity
permissions:
contents: read
strategy:
fail-fast: true
matrix:
# `jspecify-conformance` and `jspecify-reference-checker` only tested on JDK 21.
script: ['cftests-junit', 'cftests-nonjunit', 'cftests-junit-jdk21',
'typecheck-part1', 'typecheck-part2',
'guava', 'plume-lib',
'daikon-part1', 'daikon-part2',
'misc']
# JDK 21 used by `sanity` and `remainder` before.
# `experimental` versions use the $version compiler, but run on JDK 21.
java: [{version: '8', experimental: false},
{version: '11', experimental: false},
{version: '17', experimental: false},
{version: '23', experimental: false},
{version: '24-ea', experimental: true}]
exclude:
# JDK 8 does not allow toolchains, so testing 'cftests-junit-jdk21' is unnecessary.
- script: 'cftests-junit-jdk21'
java: {version: '8'}
# Only run `typecheck*`, `guava`, and `misc` scripts on core versions,
# so exclude 11 and 17.
- script: 'typecheck-part1'
java: {version: '11'}
- script: 'typecheck-part1'
java: {version: '17'}
- script: 'typecheck-part2'
java: {version: '11'}
- script: 'typecheck-part2'
java: {version: '17'}
- script: 'guava'
java: {version: '11'}
- script: 'guava'
java: {version: '17'}
- script: 'misc'
java: {version: '11'}
- script: 'misc'
java: {version: '17'}
# At least one plume-lib project no longer works on Java 8,
# so exclude 8, 11, and 17.
- script: 'plume-lib'
java: {version: '8'}
- script: 'plume-lib'
java: {version: '11'}
- script: 'plume-lib'
java: {version: '17'}
# Daikon produces 'this-escape' compiler warnings in JDK 22+.
# Exclude all versions here and just explicitly include with JDK 17.
- script: 'daikon-part1'
- script: 'daikon-part2'
include:
- script: 'daikon-part1'
java: {version: '17', experimental: false}
- script: 'daikon-part2'
java: {version: '17', experimental: false}
env:
JAVA_VERSION: ${{ matrix.java.version }}
continue-on-error: ${{ matrix.java.experimental }}
steps:
- name: Check out sources
uses: actions/checkout@v4
if: ${{ matrix.script != 'misc' }}
with:
fetch-depth: 1
- name: Check out sources with all history
uses: actions/checkout@v4
if: ${{ matrix.script == 'misc' }}
with:
# CI diff needs more history - 0 fetches all history.
fetch-depth: 0
- name: Set up JDK ${{ matrix.java.version }}
uses: actions/setup-java@v4
with:
java-version: ${{ matrix.java.version }}
distribution: 'temurin'
- name: Set up JDK 21 on an experimental platform
if: ${{ matrix.java.experimental }}
uses: actions/setup-java@v4
with:
# Install JDK 21 second, to make it the default on which gradle runs.
# This unfortunately also means that all tests run on JDK 21 instead of the newer version.
java-version: 21
distribution: 'temurin'
# Configure Gradle for optimal use in GitHub Actions, including caching of downloaded dependencies.
# See: https://github.com/gradle/actions/blob/main/setup-gradle/README.md
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4.2.2
- name: Install misc dependencies
if: ${{ matrix.script == 'misc' }}
run: |
sudo apt install -y shellcheck devscripts python3-pip \
texlive-latex-base texlive-latex-extra latexmk librsvg2-bin \
autoconf dia hevea latexmk libasound2-dev rsync pdf2svg \
libcups2-dev libfontconfig1-dev libx11-dev libxext-dev \
libxrender-dev libxrandr-dev libxtst-dev libxt-dev \
texlive-font-utils texlive-fonts-recommended texlive-latex-recommended
pip install black flake8 html5validator
- name: Setup Bazel
uses: bazel-contrib/setup-bazel@0.12.0
if: ${{ matrix.script == 'cftests-nonjunit' }}
with:
# Avoid downloading Bazel every time.
bazelisk-cache: true
# Store build cache per workflow.
disk-cache: ${{ github.workflow }}
# Share repository cache between workflows.
repository-cache: true
- name: Run test script checker/bin-devel/test-${{ matrix.script }}
run: ./checker/bin-devel/test-${{ matrix.script }}.sh
# Set the compiler version to use, allowing us to e.g. run Java 23 while gradle does not work
# on Java 23 yet. This only tests the compiler, it does not use that version to run the tests.
env:
ORG_GRADLE_PROJECT_useJdkCompiler: ${{ matrix.java.version }}
# Sanity tests on Windows and MacOS.
otheros:
name: ${{ matrix.script }} on JDK ${{ matrix.java_version }} on ${{ matrix.os }}
runs-on: "${{ matrix.os }}"
needs: sanity
permissions:
contents: read
strategy:
matrix:
os: ['windows-latest', 'macos-latest']
script: ['cftests-junit']
java_version: [21]
env:
JAVA_VERSION: ${{ matrix.java_version }}
steps:
- uses: actions/checkout@v4
- name: Set up JDK ${{ matrix.java_version }}
uses: actions/setup-java@v4
with:
java-version: ${{ matrix.java_version }}
distribution: 'temurin'
# Configure Gradle for optimal use in GitHub Actions, including caching of downloaded dependencies.
# See: https://github.com/gradle/actions/blob/main/setup-gradle/README.md
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4.2.2
- name: Install coreutils on MacOS
if: ${{ matrix.os == 'macos-latest' }}
run: brew install coreutils
- name: Run test script checker/bin-devel/test-${{ matrix.script }}
shell: bash
run: ./checker/bin-devel/test-${{ matrix.script }}.sh