Skip to content

Commit dbe70f6

Browse files
authored
CI: Multiple CI and test suite changes (#50)
* CI: Run CI on more Julia versions * CI: Remove Julia 1.9 from the CI matrix * CI: Run CI on both Intel macOS and Apple Silicon macOS, and set `arch` correctly on each * CI: Disable interactive threads * Disable the interactive thread in Julia 1.9+ * Only bother disabling the interactive thread on Julia 1.12+ The default interactive thread didn't exist in Julia 1.11 and earlier * Only use `JULIA_NUM_THREADS=x,y` on Julia 1.12+ * Exclude Windows on Julia 1.10, because killing workers doesn't work
1 parent d8f44f5 commit dbe70f6

2 files changed

Lines changed: 54 additions & 17 deletions

File tree

.github/workflows/ci.yml

Lines changed: 46 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -17,38 +17,50 @@ concurrency:
1717

1818
jobs:
1919
test:
20-
name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }} - ${{ github.event_name }}
2120
runs-on: ${{ matrix.os }}
2221
strategy:
2322
fail-fast: false
2423
matrix:
2524
version:
25+
- '1.10'
26+
- '1.11'
27+
- '1.12'
2628
- 'nightly'
27-
- '1'
28-
- '1.9'
2929
os:
3030
- ubuntu-latest
3131
- windows-latest
32-
arch:
33-
- x64
34-
- x86
35-
include:
36-
- os: macOS-latest
37-
arch: aarch64
38-
version: '1'
39-
- os: macOS-latest
40-
arch: aarch64
41-
version: 'nightly'
32+
- macos-15-intel # Intel
33+
- macos-latest # Apple Silicon
34+
julia-wordsize:
35+
# The value here only affects the version of Julia binary that we download.
36+
# It does not affect the architecture of the GitHub Runner (virtual machine) that
37+
# we run on.
38+
- '32' # 32-bit Julia. Only available on x86_64. Not available on aarch64.
39+
- '64' # 64-bit Julia.
4240
exclude:
43-
- os: windows-latest # Killing workers doesn't work on windows in 1.9
44-
version: '1.9'
41+
# Killing workers doesn't work on Windows in Julia 1.10:
42+
- os: windows-latest
43+
version: '1.10'
44+
# We don't have 32-bit builds of Julia for Intel macOS:
45+
- os: macos-15-intel # Intel
46+
julia-wordsize: '32'
47+
#
48+
# We don't have 32-bit builds of Julia for Apple Silicon macOS:
49+
- os: macos-latest # Apple Silicon
50+
julia-wordsize: '32'
4551

4652
steps:
4753
- uses: actions/checkout@v6
4854
- uses: julia-actions/setup-julia@v2
4955
with:
5056
version: ${{ matrix.version }}
51-
arch: ${{ matrix.arch }}
57+
# If `julia-wordsize` is 32, then we set `arch` to `x86`, because we know that
58+
# 32-bit builds of Julia are only available for x86.
59+
#
60+
# If `julia-wordsize` is 64, then we set `arch` to `${{ runner.arch }}`, which
61+
# GitHub will automatically expand to the correct value (`x86_64` or `aarch64`)
62+
# based on the architecture of the underlying GitHub Runner (virtual machine).
63+
arch: ${{ github.ref == '32' && 'x86' || runner.arch }}
5264
- uses: actions/cache@v5
5365
env:
5466
cache-name: cache-artifacts
@@ -60,9 +72,26 @@ jobs:
6072
${{ runner.os }}-test-${{ matrix.os }}
6173
${{ runner.os }}-
6274
- uses: julia-actions/julia-buildpkg@v1
75+
- name: Decide what the value of JULIA_NUM_THREADS should be
76+
id: decide-numthreads-str
77+
run: |
78+
if Base.VERSION >= v"1.12-"
79+
# The x,y format for threadpools requires Julia 1.9 or above.
80+
# However, Julia didn't begin starting with 1 interactive thread by default until Julia 1.12
81+
# So we don't need to bother with this on Julia 1.11 and earlier
82+
value = "1,0"
83+
else
84+
value = "1"
85+
end
86+
open(ENV["GITHUB_OUTPUT"], "a") do io
87+
name = "numthreads"
88+
line = "$(name)=$(value)"
89+
println(io, line)
90+
end
91+
shell: julia --color=yes {0}
6392
- uses: julia-actions/julia-runtest@v1
6493
env:
65-
JULIA_NUM_THREADS: 4,4
94+
JULIA_NUM_THREADS: ${{ steps.decide-numthreads-str.outputs.numthreads }}
6695
- uses: julia-actions/julia-processcoverage@v1
6796
- uses: codecov/codecov-action@v5
6897
with:

test/runtests.jl

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,14 @@ cmd = `$test_exename $test_exeflags`
1414
if Sys.isunix()
1515
# Run the SSH tests with a single thread because LibSSH.jl is not thread-safe
1616
sshtestfile = joinpath(@__DIR__, "sshmanager.jl")
17+
if Base.VERSION >= v"1.12-"
18+
# The x,y format for threadpools requires Julia 1.9 or above.
19+
# However, Julia didn't begin starting with 1 interactive thread by default until Julia 1.12
20+
# So we don't need to bother with this on Julia 1.11 and earlier
21+
JULIA_NUM_THREADS = "1,0"
22+
else
23+
JULIA_NUM_THREADS = "1"
24+
end
1725
run(addenv(`$cmd $sshtestfile`, "JULIA_NUM_THREADS" => "1"))
1826
else
1927
@warn "Skipping the SSH tests because this platform is not supported"

0 commit comments

Comments
 (0)