Skip to content

Commit f5eba5f

Browse files
authored
CI: Run a single job on Julia nightly (but skip the incremental=false tests on Julia 1.12) (#982)
1 parent a58c9c1 commit f5eba5f

File tree

2 files changed

+120
-26
lines changed

2 files changed

+120
-26
lines changed

.github/workflows/ci.nightly.yml

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
name: Nightly CI
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches:
7+
- 'master'
8+
- 'release-*'
9+
tags: '*'
10+
merge_group: # GitHub Merge Queue
11+
12+
concurrency:
13+
# Skip intermediate builds: all builds except for builds on the `master` branch
14+
# Cancel intermediate builds: only pull request builds
15+
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.ref != 'refs/heads/master' || github.run_number }}
16+
cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }}
17+
18+
jobs:
19+
test-nightly:
20+
timeout-minutes: 90
21+
runs-on: ${{ matrix.github-runner }}
22+
strategy:
23+
max-parallel: 5 # leave space for other runs in the JuliaLang org, given these tests are long
24+
fail-fast: false
25+
matrix:
26+
include:
27+
# 1. We intentionally put nightly CI into a separate YAML
28+
# file (`ci.nightly.yml` versus the main `ci.yml` file).
29+
# This allows us to enable and disable the nightly CI
30+
# workflow from the GitHub web UI, without having any
31+
# impact on the main CI.
32+
# 2. We intentionally only run one CI job on Julia nightly,
33+
# in order to conserve CI resources.
34+
# 3. This CI only runs on Julia nightly. It doesn't run on
35+
# Julia pre-releases. For CI on Julia pre-releases, see
36+
# the main CI workflow file.
37+
- julia-version: 'nightly'
38+
julia-wordsize: '64'
39+
github-runner: ubuntu-latest
40+
coverage: false
41+
steps:
42+
- uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
43+
- uses: julia-actions/setup-julia@9b79636afcfb07ab02c256cede01fe2db6ba808c # v2.6.0
44+
with:
45+
version: ${{ matrix.julia-version }}
46+
# If `julia-wordsize` is 32, then we set `arch` to `x86`, because we know that
47+
# 32-bit builds of Julia are only available for x86.
48+
#
49+
# If `julia-wordsize` is 64, then we set `arch` to `${{ runner.arch }}`, which
50+
# GitHub will automatically expand to the correct value (`x86_64` or `aarch64`)
51+
# based on the architecture of the underlying GitHub Runner (virtual machine).
52+
arch: ${{ github.ref == '32' && 'x86' || runner.arch }}
53+
- uses: julia-actions/cache@824243901fb567ccb490b0d0e2483ccecde46834 # v2.0.5
54+
- uses: julia-actions/julia-runtest@d0c4f093badade621cd041bba567d1e832480ac2 # v1.10.0
55+
with:
56+
coverage: ${{ matrix.coverage }}
57+
- uses: julia-actions/julia-processcoverage@03114f09f119417c3242a9fb6e0b722676aedf38 # v1.2.2
58+
- uses: codecov/codecov-action@b9fd7d16f6d7d1b5d2bec1a2887e65ceed900238 # v4.6.0
59+
with:
60+
file: lcov.info
61+
env:
62+
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

test/runtests.jl

Lines changed: 58 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ const is_slow_ci = is_ci && Sys.ARCH == :aarch64
1818
const is_julia_1_6 = VERSION.major == 1 && VERSION.minor == 6
1919
const is_julia_1_9 = VERSION.major == 1 && VERSION.minor == 9
2020
const is_julia_1_11 = VERSION.major == 1 && VERSION.minor == 11
21+
const is_julia_1_12 = VERSION.major == 1 && VERSION.minor == 12
2122

2223
if is_ci
2324
@show Sys.ARCH
@@ -27,7 +28,14 @@ if is_slow_ci
2728
@warn "This is \"slow CI\" (`is_ci && Sys.ARCH == :aarch64`). Some tests will be skipped or modified." Sys.ARCH
2829
end
2930

30-
if any([is_julia_1_6, is_julia_1_9, is_julia_1_11])
31+
const some_tests_skipped = [
32+
is_julia_1_6,
33+
is_julia_1_9,
34+
is_julia_1_11,
35+
is_julia_1_12,
36+
]
37+
38+
if any(some_tests_skipped)
3139
@warn "This is Julia $(VERSION.major).$(VERSION.minor). Some tests will be skipped or modified." VERSION
3240
end
3341

@@ -79,10 +87,12 @@ end
7987
app_compiled_dir = joinpath(tmp, "MyAppCompiled")
8088
@testset for incremental in (is_slow_ci ? (false,) : (true, false))
8189
if incremental == false
82-
if is_julia_1_11
83-
# On Julia 1.11, `incremental=false` is currently broken: https://github.com/JuliaLang/PackageCompiler.jl/issues/976
84-
# So, for now, we skip the `incremental=false` tests on Julia 1.11
85-
@warn "This is Julia 1.11; skipping incremental=false test due to known bug: https://github.com/JuliaLang/PackageCompiler.jl/issues/976"
90+
if is_julia_1_11 || is_julia_1_12
91+
# On Julia 1.11 and 1.12, `incremental=false` is currently broken.
92+
# 1.11: https://github.com/JuliaLang/PackageCompiler.jl/issues/976
93+
# 1.12: No GitHub issue yet.
94+
# So, for now, we skip the `incremental=false` tests on Julia 1.11 and 1.12
95+
@warn "This is Julia $(VERSION.major).$(VERSION.minor); skipping incremental=false test due to known bug: #976 (for 1.11), issue TODO (for 1.12)"
8696
@test_skip false
8797
continue
8898
end
@@ -186,30 +196,52 @@ end
186196
end # testset
187197

188198
if !is_slow_ci
189-
# Test library creation
190-
lib_source_dir = joinpath(@__DIR__, "..", "examples/MyLib")
191-
lib_target_dir = joinpath(tmp, "MyLibCompiled")
192-
193-
incremental = false
194-
filter = true
195-
lib_name = "inc"
196-
197-
tmp_lib_src_dir = joinpath(tmp, "MyLib")
198-
cp(lib_source_dir, tmp_lib_src_dir)
199-
create_library(tmp_lib_src_dir, lib_target_dir; incremental=incremental, force=true, filter_stdlibs=filter,
200-
precompile_execution_file=joinpath(lib_source_dir, "build", "generate_precompile.jl"),
201-
precompile_statements_file=joinpath(lib_source_dir, "build", "additional_precompile.jl"),
202-
lib_name=lib_name, version=v"1.0.0")
203-
rm(tmp_lib_src_dir; recursive=true)
199+
if is_julia_1_12
200+
# On Julia 1.12, `incremental=false` is currently broken when doing `create_library()`.
201+
# 1.12: No GitHub issue yet.
202+
# So, for now, we skip the `incremental=false` tests on Julia 1.12 when doing `create_library()`.
203+
@warn "This is Julia $(VERSION.major).$(VERSION.minor); skipping incremental=false test when doing `create_library()` due to known bug: issue TODO (for 1.12)"
204+
@test_skip false
205+
else
206+
# Test library creation
207+
lib_source_dir = joinpath(@__DIR__, "..", "examples/MyLib")
208+
lib_target_dir = joinpath(tmp, "MyLibCompiled")
209+
210+
# This is why we have to skip this test on 1.12:
211+
incremental = false
212+
213+
filter = true
214+
lib_name = "inc"
215+
216+
tmp_lib_src_dir = joinpath(tmp, "MyLib")
217+
cp(lib_source_dir, tmp_lib_src_dir)
218+
create_library(tmp_lib_src_dir, lib_target_dir; incremental=incremental, force=true, filter_stdlibs=filter,
219+
precompile_execution_file=joinpath(lib_source_dir, "build", "generate_precompile.jl"),
220+
precompile_statements_file=joinpath(lib_source_dir, "build", "additional_precompile.jl"),
221+
lib_name=lib_name, version=v"1.0.0")
222+
rm(tmp_lib_src_dir; recursive=true)
223+
end
204224
end
205225

206226
# Test creating an empty sysimage
207227
if !is_slow_ci
208-
tmp = mktempdir()
209-
sysimage_path = joinpath(tmp, "empty." * Libdl.dlext)
210-
foreach(x -> touch(joinpath(tmp, x)), ["Project.toml", "Manifest.toml"])
211-
create_sysimage(String[]; sysimage_path=sysimage_path, incremental=false, filter_stdlibs=true, project=tmp)
212-
hello = read(`$(Base.julia_cmd()) -J $(sysimage_path) -e 'print("hello, world")'`, String)
213-
@test hello == "hello, world"
228+
if is_julia_1_12
229+
# On Julia 1.12, `incremental=false` is currently broken when doing `create_library()`.
230+
# 1.12: No GitHub issue yet.
231+
# So, for now, we skip the `incremental=false` tests on Julia 1.12 when doing `create_library()`.
232+
@warn "This is Julia $(VERSION.major).$(VERSION.minor); skipping incremental=false test when doing `create_library()` due to known bug: issue TODO (for 1.12)"
233+
@test_skip false
234+
else
235+
tmp = mktempdir()
236+
sysimage_path = joinpath(tmp, "empty." * Libdl.dlext)
237+
foreach(x -> touch(joinpath(tmp, x)), ["Project.toml", "Manifest.toml"])
238+
239+
# This is why we need to skip this test on 1.12:
240+
incremental=false
241+
242+
create_sysimage(String[]; sysimage_path=sysimage_path, incremental=incremental, filter_stdlibs=true, project=tmp)
243+
hello = read(`$(Base.julia_cmd()) -J $(sysimage_path) -e 'print("hello, world")'`, String)
244+
@test hello == "hello, world"
245+
end
214246
end
215247
end

0 commit comments

Comments
 (0)