forked from scala-native/scala-native
-
Notifications
You must be signed in to change notification settings - Fork 0
279 lines (255 loc) · 9.38 KB
/
run-tests-linux.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
266
267
268
269
270
271
272
273
274
275
276
277
278
name: Run tests Linux
on:
workflow_call:
pull_request:
schedule:
# Every day at 2 AM UTC
- cron: "0 2 * * *"
workflow_dispatch:
concurrency:
group: linux-${{ github.head_ref }}-${{ github.event_name }}
cancel-in-progress: true
jobs:
# Compile all sources for given Scala version
# Cache external dependencies
# Test tools, if any of them fails, further tests will not start.
tests-tools:
name: Compile & test tools
if: "github.event_name == 'pull_request' || github.event_name == 'workflow_dispatch' || ((github.event_name == 'schedule' || github.event_name == 'workflow_call') && github.repository == 'scala-native/scala-native')"
runs-on: ubuntu-22.04
env:
ENABLE_EXPERIMENTAL_COMPILER: true
strategy:
fail-fast: false
matrix:
scala: [2.12, 2.13, 3]
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/linux-setup-env
with:
scala-version: ${{matrix.scala}}
java-version: 8
- name: Test tools
run: sbt "test-tools ${{ matrix.scala }}; toolsBenchmarks${{env.project-version}}/Jmh/compile"
tests-compile-scalaPublishVersion:
name: Compile sources with the Scala 3 version used for publishing artifacts
if: "github.event_name == 'pull_request' || ((github.event_name == 'schedule' || github.event_name == 'workflow_call') && github.repository == 'scala-native/scala-native')"
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/linux-setup-env
with:
scala-version: 3
java-version: 8
- name: Compile everything
# Publish 2.13.latest artifacts locally first, these are required by scalalib3
run: sbt "scalalib2_13/publishLocal;clean; ++2.13.8; all Test/compile Compile/doc; ++3.1.3; all Test/compile Compile/doc"
test-scala-cross-build:
runs-on: ubuntu-22.04
if: "(github.event_name == 'schedule' || github.event_name == 'workflow_call') && github.repository == 'scala-native/scala-native'"
env:
ENABLE_EXPERIMENTAL_COMPILER: true
strategy:
fail-fast: false
matrix:
scala: [2.12, 2.13, 3, 3-next]
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/linux-setup-env
with:
scala-version: ${{matrix.scala}}
java-version: 8
- name: Test cross compilation of compiler plugins
run: sbt "+nscplugin${{ env.project-version }}/test; +junitPlugin${{ env.project-version }}/compile; +scalalib${{ env.project-version }}/compile"
test-runtime:
name: Test runtime
if: "github.event_name == 'pull_request' || ((github.event_name == 'schedule' || github.event_name == 'workflow_call') && github.repository == 'scala-native/scala-native')"
runs-on: ubuntu-22.04
needs: tests-tools
env:
ENABLE_EXPERIMENTAL_COMPILER: true
strategy:
fail-fast: false
matrix:
scala: [3, 2.13, 2.12, 3-next]
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/linux-setup-env
with:
scala-version: ${{matrix.scala}}
- name: Test GC compilation
timeout-minutes: 30
run: sbt "test-gc ${{ matrix.scala }}"
- name: Run tests
timeout-minutes: 45
env:
SCALANATIVE_TEST_PREFETCH_DEBUG_INFO: 1
run: sbt "test-runtime ${{ matrix.scala }}"
test-runtime-ext:
name: Test runtime extension
if: "(github.event_name == 'schedule' || github.event_name == 'workflow_call') && github.repository == 'scala-native/scala-native'"
runs-on: ubuntu-22.04
needs: [tests-tools, test-runtime]
env:
ENABLE_EXPERIMENTAL_COMPILER: true
strategy:
fail-fast: false
matrix:
scala: [2.13, 3]
build-mode: [debug, release-fast]
lto: [none, thin]
gc: [boehm, immix, commix]
exclude:
# Covered in basic test-runtime
- scala: 3
build-mode: debug
- scala: 2.13
build-mode: debug
gc: immix
# Slow, leads to timeouts
- build-mode: release-fast
lto: none
include:
- scala: 3
build-mode: release-size
lto: thin
gc: immix
# Release-full is flaky
# - scala: 3
# build-mode: release-full
# lto: thin
# gc: commix
# - scala: 2.13
# build-mode: release-full
# lto: full
# gc: commix
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/linux-setup-env
with:
scala-version: ${{matrix.scala}}
- name: Run tests
timeout-minutes: 45
env:
SCALANATIVE_MODE: ${{ matrix.build-mode }}
SCALANATIVE_GC: ${{ matrix.gc }}
SCALANATIVE_LTO: ${{ matrix.lto }}
SCALANATIVE_OPTIMIZE: true
SCALANATIVE_TEST_PREFETCH_DEBUG_INFO: 1
run: sbt "test-runtime ${{ matrix.scala }}"
# This job is basically copy-paste of test-runtime.
# Main difference is disabled optimization and fixed Immix GC
test-runtime-no-opt:
name: Test runtime no-opt
if: "(github.event_name == 'schedule' || github.event_name == 'workflow_call') && github.repository == 'scala-native/scala-native'"
runs-on: ubuntu-22.04
needs: tests-tools
env:
ENABLE_EXPERIMENTAL_COMPILER: true
strategy:
fail-fast: false
matrix:
scala: [3]
build-mode: [debug]
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/linux-setup-env
with:
scala-version: ${{matrix.scala}}
- name: Run tests
timeout-minutes: 45
env:
SCALANATIVE_MODE: ${{ matrix.build-mode }}
SCALANATIVE_GC: immix
SCALANATIVE_OPTIMIZE: false
SCALANATIVE_TEST_PREFETCH_DEBUG_INFO: 1
run: sbt "test-runtime ${{ matrix.scala }}"
# This job is basically copy-paste of test-runtime.
# Scripted tests take a long time to run, ~30 minutes, and should be limited and absolute minimum.
test-scripted:
name: Test scripted
if: "github.event_name == 'pull_request' || ((github.event_name == 'schedule' || github.event_name == 'workflow_call') && github.repository == 'scala-native/scala-native')"
runs-on: ubuntu-22.04
needs: tests-tools
strategy:
fail-fast: false
matrix:
scala: [3]
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/linux-setup-env
with:
scala-version: ${{matrix.scala}}
- name: Run tests
env:
SCALANATIVE_MODE: release-fast
SCALANATIVE_GC: immix
SCALANATIVE_OPTIMIZE: true
run: |
export LLVM_BIN=$(dirname $(readlink -f /usr/bin/clang))
sbt "test-scripted ${{matrix.scala}}"
test-llvm-versions:
if: "(github.event_name == 'schedule' || github.event_name == 'workflow_call') && github.repository == 'scala-native/scala-native'"
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
scala: [3]
llvm: [14, 15, 16, 17, 18] # Last 3 stable versions + available future versions
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/linux-setup-env
with:
scala-version: ${{matrix.scala}}
llvm-version: ${{ matrix.llvm }}
java-version: 8
- name: Run tests
timeout-minutes: 45
env:
SCALANATIVE_MODE: release-fast
SCALANATIVE_LTO: thin
LLVM_BIN: "/usr/lib/llvm-${{ matrix.llvm }}/bin"
SCALANATIVE_TEST_PREFETCH_DEBUG_INFO: 1
run: sbt "test-runtime ${{ matrix.scala }}"
test-scala-partests:
if: "github.event_name == 'pull_request' || ((github.event_name == 'schedule' || github.event_name == 'workflow_call') && github.repository == 'scala-native/scala-native')"
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
scala: [2.13]
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/linux-setup-env
with:
scala-version: ${{matrix.scala}}
java-version: 11
# Make sure that Scala partest denylisted tests contain only valid test names
- name: Setup Scala-cli
uses: VirtusLab/[email protected]
- name: Check partest disabled tests list
# No partests support for Scala 3
if: ${{ !startsWith(matrix.scala, '3') }}
run: |
sbt "scalaPartest${{env.project-version}}/fetchScalaSource"
scala-cli scripts/partest-check-files.scala
# scala-cli-setup can override default java version
- uses: ./.github/actions/linux-setup-env
with:
scala-version: ${{matrix.scala}}
java-version: 11
# Running all partests would take ~2h for each Scala version, run only single test of each kind
# to make sure that infrastructure works correctly.
- name: Test partests infrastracture
if: "github.event_name == 'pull_request'"
run: |
sbt \
"-J-Xmx3G" \
"scalaPartestTests${{env.project-version}}/testOnly -- --showDiff neg/abstract.scala pos/abstract.scala run/Course-2002-01.scala"
- name: Run all of partests
if: "github.event_name == 'schedule'"
timeout-minutes: 300
run: |
sbt \
"-J-Xmx3G" \
"scalaPartestTests${{env.project-version}}/testOnly -- --showDiff"