diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 30580b1..4360bca 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -17,38 +17,50 @@ concurrency: jobs: test: - name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }} - ${{ github.event_name }} runs-on: ${{ matrix.os }} strategy: fail-fast: false matrix: version: + - '1.10' + - '1.11' + - '1.12' - 'nightly' - - '1' - - '1.9' os: - ubuntu-latest - windows-latest - arch: - - x64 - - x86 - include: - - os: macOS-latest - arch: aarch64 - version: '1' - - os: macOS-latest - arch: aarch64 - version: 'nightly' + - macos-15-intel # Intel + - macos-latest # Apple Silicon + julia-wordsize: + # The value here only affects the version of Julia binary that we download. + # It does not affect the architecture of the GitHub Runner (virtual machine) that + # we run on. + - '32' # 32-bit Julia. Only available on x86_64. Not available on aarch64. + - '64' # 64-bit Julia. exclude: - - os: windows-latest # Killing workers doesn't work on windows in 1.9 - version: '1.9' + # Killing workers doesn't work on Windows in Julia 1.10: + - os: windows-latest + version: '1.10' + # We don't have 32-bit builds of Julia for Intel macOS: + - os: macos-15-intel # Intel + julia-wordsize: '32' + # + # We don't have 32-bit builds of Julia for Apple Silicon macOS: + - os: macos-latest # Apple Silicon + julia-wordsize: '32' steps: - uses: actions/checkout@v6 - uses: julia-actions/setup-julia@v2 with: version: ${{ matrix.version }} - arch: ${{ matrix.arch }} + # If `julia-wordsize` is 32, then we set `arch` to `x86`, because we know that + # 32-bit builds of Julia are only available for x86. + # + # If `julia-wordsize` is 64, then we set `arch` to `${{ runner.arch }}`, which + # GitHub will automatically expand to the correct value (`x86_64` or `aarch64`) + # based on the architecture of the underlying GitHub Runner (virtual machine). + arch: ${{ github.ref == '32' && 'x86' || runner.arch }} - uses: actions/cache@v5 env: cache-name: cache-artifacts @@ -60,9 +72,26 @@ jobs: ${{ runner.os }}-test-${{ matrix.os }} ${{ runner.os }}- - uses: julia-actions/julia-buildpkg@v1 + - name: Decide what the value of JULIA_NUM_THREADS should be + id: decide-numthreads-str + run: | + if Base.VERSION >= v"1.12-" + # The x,y format for threadpools requires Julia 1.9 or above. + # However, Julia didn't begin starting with 1 interactive thread by default until Julia 1.12 + # So we don't need to bother with this on Julia 1.11 and earlier + value = "1,0" + else + value = "1" + end + open(ENV["GITHUB_OUTPUT"], "a") do io + name = "numthreads" + line = "$(name)=$(value)" + println(io, line) + end + shell: julia --color=yes {0} - uses: julia-actions/julia-runtest@v1 env: - JULIA_NUM_THREADS: 4,4 + JULIA_NUM_THREADS: ${{ steps.decide-numthreads-str.outputs.numthreads }} - uses: julia-actions/julia-processcoverage@v1 - uses: codecov/codecov-action@v5 with: diff --git a/test/runtests.jl b/test/runtests.jl index 0e7441d..bbc8577 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -14,6 +14,14 @@ cmd = `$test_exename $test_exeflags` if Sys.isunix() # Run the SSH tests with a single thread because LibSSH.jl is not thread-safe sshtestfile = joinpath(@__DIR__, "sshmanager.jl") + if Base.VERSION >= v"1.12-" + # The x,y format for threadpools requires Julia 1.9 or above. + # However, Julia didn't begin starting with 1 interactive thread by default until Julia 1.12 + # So we don't need to bother with this on Julia 1.11 and earlier + JULIA_NUM_THREADS = "1,0" + else + JULIA_NUM_THREADS = "1" + end run(addenv(`$cmd $sshtestfile`, "JULIA_NUM_THREADS" => "1")) else @warn "Skipping the SSH tests because this platform is not supported"