From 23f78a18c3f51ba58c1bdf079d5af4f81ca143b3 Mon Sep 17 00:00:00 2001 From: Dilum Aluthge Date: Sun, 20 Oct 2024 03:08:30 -0400 Subject: [PATCH 1/8] CI: Run a single job on Julia nightly --- .github/workflows/ci.nightly.yml | 54 ++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 .github/workflows/ci.nightly.yml diff --git a/.github/workflows/ci.nightly.yml b/.github/workflows/ci.nightly.yml new file mode 100644 index 00000000..8c5fb7d1 --- /dev/null +++ b/.github/workflows/ci.nightly.yml @@ -0,0 +1,54 @@ +name: Nightly CI + +on: + pull_request: + push: + branches: + - 'master' + - 'release-*' + tags: '*' + merge_group: # GitHub Merge Queue + +concurrency: + # Skip intermediate builds: all builds except for builds on the `master` branch + # Cancel intermediate builds: only pull request builds + group: ${{ github.workflow }}-${{ github.ref }}-${{ github.ref != 'refs/heads/master' || github.run_number }} + cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }} + +jobs: + test-nightly: + timeout-minutes: 90 + runs-on: ${{ matrix.github-runner }} + strategy: + max-parallel: 5 # leave space for other runs in the JuliaLang org, given these tests are long + fail-fast: false + matrix: + include: + # We intentionally only run one CI job on Julia nightly, + # in order to conserve CI resources. + - julia-version: 'nightly' + julia-wordsize: '64' + github-runner: ubuntu-latest + coverage: false + steps: + - uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 + - uses: julia-actions/setup-julia@9b79636afcfb07ab02c256cede01fe2db6ba808c # v2.6.0 + with: + version: ${{ matrix.julia-version }} + # 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: julia-actions/cache@824243901fb567ccb490b0d0e2483ccecde46834 # v2.0.5 + - uses: julia-actions/julia-runtest@d0c4f093badade621cd041bba567d1e832480ac2 # v1.10.0 + with: + coverage: ${{ matrix.coverage }} + - uses: julia-actions/julia-processcoverage@03114f09f119417c3242a9fb6e0b722676aedf38 # v1.2.2 + - uses: codecov/codecov-action@b9fd7d16f6d7d1b5d2bec1a2887e65ceed900238 # v4.6.0 + with: + file: lcov.info + env: + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} From 63d18fd9e117b259ea8d6ca1c0128f15bf79af31 Mon Sep 17 00:00:00 2001 From: Dilum Aluthge Date: Sun, 20 Oct 2024 03:10:52 -0400 Subject: [PATCH 2/8] More contents --- .github/workflows/ci.nightly.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.nightly.yml b/.github/workflows/ci.nightly.yml index 8c5fb7d1..1095f752 100644 --- a/.github/workflows/ci.nightly.yml +++ b/.github/workflows/ci.nightly.yml @@ -24,8 +24,10 @@ jobs: fail-fast: false matrix: include: - # We intentionally only run one CI job on Julia nightly, - # in order to conserve CI resources. + # 1. We intentionally put nightly CI into a separate YAML + # file (`ci.nightly.yml` versus the main `ci.yml` file). + # 2. We intentionally only run one CI job on Julia nightly, + # in order to conserve CI resources. - julia-version: 'nightly' julia-wordsize: '64' github-runner: ubuntu-latest From c266c32e89a439d31dab24e19d1152a4da928f6c Mon Sep 17 00:00:00 2001 From: Dilum Aluthge Date: Sun, 20 Oct 2024 03:14:35 -0400 Subject: [PATCH 3/8] More contents --- .github/workflows/ci.nightly.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/ci.nightly.yml b/.github/workflows/ci.nightly.yml index 1095f752..1588e17a 100644 --- a/.github/workflows/ci.nightly.yml +++ b/.github/workflows/ci.nightly.yml @@ -26,8 +26,14 @@ jobs: include: # 1. We intentionally put nightly CI into a separate YAML # file (`ci.nightly.yml` versus the main `ci.yml` file). + # This allows us to enable and disable the nightly CI + # workflow from the GitHub web UI, without having any + # impact on the main CI. # 2. We intentionally only run one CI job on Julia nightly, # in order to conserve CI resources. + # 3. This CI only runs on Julia nightly. It doesn't run on + # on Julia pre-releases. For CI on Julia pre-releases, + # see the main CI workflow file. - julia-version: 'nightly' julia-wordsize: '64' github-runner: ubuntu-latest From 1ffd504099a0931719dec060d4549a331a67c46a Mon Sep 17 00:00:00 2001 From: Dilum Aluthge Date: Sun, 20 Oct 2024 03:17:01 -0400 Subject: [PATCH 4/8] Fix typo --- .github/workflows/ci.nightly.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.nightly.yml b/.github/workflows/ci.nightly.yml index 1588e17a..6de72912 100644 --- a/.github/workflows/ci.nightly.yml +++ b/.github/workflows/ci.nightly.yml @@ -32,8 +32,8 @@ jobs: # 2. We intentionally only run one CI job on Julia nightly, # in order to conserve CI resources. # 3. This CI only runs on Julia nightly. It doesn't run on - # on Julia pre-releases. For CI on Julia pre-releases, - # see the main CI workflow file. + # Julia pre-releases. For CI on Julia pre-releases, see + # the main CI workflow file. - julia-version: 'nightly' julia-wordsize: '64' github-runner: ubuntu-latest From 0ede753ae3dd4d8ea97a6bec8a5bfeddc87cb7b7 Mon Sep 17 00:00:00 2001 From: Dilum Aluthge Date: Sun, 20 Oct 2024 03:38:38 -0400 Subject: [PATCH 5/8] Skip the `incremental=false` tests on Julia nightly --- test/runtests.jl | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/test/runtests.jl b/test/runtests.jl index 4bbcc263..615f7942 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -18,6 +18,7 @@ const is_slow_ci = is_ci && Sys.ARCH == :aarch64 const is_julia_1_6 = VERSION.major == 1 && VERSION.minor == 6 const is_julia_1_9 = VERSION.major == 1 && VERSION.minor == 9 const is_julia_1_11 = VERSION.major == 1 && VERSION.minor == 11 +const is_julia_1_12 = VERSION.major == 1 && VERSION.minor == 12 if is_ci @show Sys.ARCH @@ -27,7 +28,14 @@ if is_slow_ci @warn "This is \"slow CI\" (`is_ci && Sys.ARCH == :aarch64`). Some tests will be skipped or modified." Sys.ARCH end -if any([is_julia_1_6, is_julia_1_9, is_julia_1_11]) +const some_tests_skipped = [ + is_julia_1_6, + is_julia_1_9, + is_julia_1_11, + is_julia_1_12, +] + +if any(some_tests_skipped) @warn "This is Julia $(VERSION.major).$(VERSION.minor). Some tests will be skipped or modified." VERSION end @@ -79,10 +87,10 @@ end app_compiled_dir = joinpath(tmp, "MyAppCompiled") @testset for incremental in (is_slow_ci ? (false,) : (true, false)) if incremental == false - if is_julia_1_11 - # On Julia 1.11, `incremental=false` is currently broken: https://github.com/JuliaLang/PackageCompiler.jl/issues/976 - # So, for now, we skip the `incremental=false` tests on Julia 1.11 - @warn "This is Julia 1.11; skipping incremental=false test due to known bug: https://github.com/JuliaLang/PackageCompiler.jl/issues/976" + if is_julia_1_11 || is_julia_1_12 + # On Julia 1.11 and 1.12, `incremental=false` is currently broken: https://github.com/JuliaLang/PackageCompiler.jl/issues/976 + # So, for now, we skip the `incremental=false` tests on Julia 1.11 and 1.12 + @warn "This is Julia $(VERSION.major).$(VERSION.minor); skipping incremental=false test due to known bug: https://github.com/JuliaLang/PackageCompiler.jl/issues/976" @test_skip false continue end From 0091cfe12eeb98d2a4e5a5f442fab6a31ea6a259 Mon Sep 17 00:00:00 2001 From: Dilum Aluthge Date: Sun, 20 Oct 2024 04:26:30 -0400 Subject: [PATCH 6/8] Skip another test (the `create_library()` test) on Julia 1.12 (because it does `incremental=false`) --- test/runtests.jl | 47 ++++++++++++++++++++++++++++++----------------- 1 file changed, 30 insertions(+), 17 deletions(-) diff --git a/test/runtests.jl b/test/runtests.jl index 615f7942..2bbc952f 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -88,9 +88,11 @@ end @testset for incremental in (is_slow_ci ? (false,) : (true, false)) if incremental == false if is_julia_1_11 || is_julia_1_12 - # On Julia 1.11 and 1.12, `incremental=false` is currently broken: https://github.com/JuliaLang/PackageCompiler.jl/issues/976 + # On Julia 1.11 and 1.12, `incremental=false` is currently broken. + # 1.11: https://github.com/JuliaLang/PackageCompiler.jl/issues/976 + # 1.12: No GitHub issue yet. # So, for now, we skip the `incremental=false` tests on Julia 1.11 and 1.12 - @warn "This is Julia $(VERSION.major).$(VERSION.minor); skipping incremental=false test due to known bug: https://github.com/JuliaLang/PackageCompiler.jl/issues/976" + @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)" @test_skip false continue end @@ -194,21 +196,32 @@ end end # testset if !is_slow_ci - # Test library creation - lib_source_dir = joinpath(@__DIR__, "..", "examples/MyLib") - lib_target_dir = joinpath(tmp, "MyLibCompiled") - - incremental = false - filter = true - lib_name = "inc" - - tmp_lib_src_dir = joinpath(tmp, "MyLib") - cp(lib_source_dir, tmp_lib_src_dir) - create_library(tmp_lib_src_dir, lib_target_dir; incremental=incremental, force=true, filter_stdlibs=filter, - precompile_execution_file=joinpath(lib_source_dir, "build", "generate_precompile.jl"), - precompile_statements_file=joinpath(lib_source_dir, "build", "additional_precompile.jl"), - lib_name=lib_name, version=v"1.0.0") - rm(tmp_lib_src_dir; recursive=true) + if is_julia_1_12 + # On Julia 1.12, `incremental=false` is currently broken when doing `create_library()`. + # 1.12: No GitHub issue yet. + # So, for now, we skip the `incremental=false` tests on Julia 1.12 when doing `create_library()`. + @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)" + @test_skip false + continue + else + # Test library creation + lib_source_dir = joinpath(@__DIR__, "..", "examples/MyLib") + lib_target_dir = joinpath(tmp, "MyLibCompiled") + + # This is why we have to skip this test on 1.12: + incremental = false + + filter = true + lib_name = "inc" + + tmp_lib_src_dir = joinpath(tmp, "MyLib") + cp(lib_source_dir, tmp_lib_src_dir) + create_library(tmp_lib_src_dir, lib_target_dir; incremental=incremental, force=true, filter_stdlibs=filter, + precompile_execution_file=joinpath(lib_source_dir, "build", "generate_precompile.jl"), + precompile_statements_file=joinpath(lib_source_dir, "build", "additional_precompile.jl"), + lib_name=lib_name, version=v"1.0.0") + rm(tmp_lib_src_dir; recursive=true) + end end # Test creating an empty sysimage From 5748b540cb3ce008aa794f94dce23125cbc54640 Mon Sep 17 00:00:00 2001 From: Dilum Aluthge Date: Sun, 20 Oct 2024 04:28:57 -0400 Subject: [PATCH 7/8] Fix --- test/runtests.jl | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/test/runtests.jl b/test/runtests.jl index 2bbc952f..f9a43fff 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -197,12 +197,11 @@ end if !is_slow_ci if is_julia_1_12 - # On Julia 1.12, `incremental=false` is currently broken when doing `create_library()`. - # 1.12: No GitHub issue yet. - # So, for now, we skip the `incremental=false` tests on Julia 1.12 when doing `create_library()`. + # On Julia 1.12, `incremental=false` is currently broken when doing `create_library()`. + # 1.12: No GitHub issue yet. + # So, for now, we skip the `incremental=false` tests on Julia 1.12 when doing `create_library()`. @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)" - @test_skip false - continue + @test_skip false else # Test library creation lib_source_dir = joinpath(@__DIR__, "..", "examples/MyLib") From 4598c27ad1f13790ce2aca7a829ed47162d40a1b Mon Sep 17 00:00:00 2001 From: Dilum Aluthge Date: Sun, 20 Oct 2024 04:52:36 -0400 Subject: [PATCH 8/8] Skip yet another test on Julia 1.12 (because `incremental=false`) --- test/runtests.jl | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/test/runtests.jl b/test/runtests.jl index f9a43fff..2a8a98d1 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -225,11 +225,23 @@ end # Test creating an empty sysimage if !is_slow_ci - tmp = mktempdir() - sysimage_path = joinpath(tmp, "empty." * Libdl.dlext) - foreach(x -> touch(joinpath(tmp, x)), ["Project.toml", "Manifest.toml"]) - create_sysimage(String[]; sysimage_path=sysimage_path, incremental=false, filter_stdlibs=true, project=tmp) - hello = read(`$(Base.julia_cmd()) -J $(sysimage_path) -e 'print("hello, world")'`, String) - @test hello == "hello, world" + if is_julia_1_12 + # On Julia 1.12, `incremental=false` is currently broken when doing `create_library()`. + # 1.12: No GitHub issue yet. + # So, for now, we skip the `incremental=false` tests on Julia 1.12 when doing `create_library()`. + @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)" + @test_skip false + else + tmp = mktempdir() + sysimage_path = joinpath(tmp, "empty." * Libdl.dlext) + foreach(x -> touch(joinpath(tmp, x)), ["Project.toml", "Manifest.toml"]) + + # This is why we need to skip this test on 1.12: + incremental=false + + create_sysimage(String[]; sysimage_path=sysimage_path, incremental=incremental, filter_stdlibs=true, project=tmp) + hello = read(`$(Base.julia_cmd()) -J $(sysimage_path) -e 'print("hello, world")'`, String) + @test hello == "hello, world" + end end end