diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 7a9fd17..a141cf6 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -9,23 +9,8 @@ concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }} jobs: - test: - name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }} - strategy: - fail-fast: false - matrix: - version: - - '1.10' - - '1' - os: - - ubuntu-latest - arch: - - x64 - uses: "SciML/.github/.github/workflows/tests.yml@v1" - with: - julia-version: ${{ matrix.version }} - julia-arch: ${{ matrix.arch }} - os: ${{ matrix.os }} + tests: + uses: "SciML/.github/.github/workflows/grouped-tests.yml@v1" secrets: "inherit" docs: name: Documentation diff --git a/Project.toml b/Project.toml index 987084a..922e6eb 100644 --- a/Project.toml +++ b/Project.toml @@ -31,6 +31,7 @@ LocalRegistry = "0.5" SnoopCompileCore = "3" Statistics = "1" TOML = "1" +Test = "1" YAML = "0.4" julia = "1.10" diff --git a/test/jet_tests.jl b/test/qa.jl similarity index 73% rename from test/jet_tests.jl rename to test/qa.jl index 34d4004..3e266b1 100644 --- a/test/jet_tests.jl +++ b/test/qa.jl @@ -1,11 +1,25 @@ -# JET.jl static analysis tests -# These tests verify type stability and catch potential runtime errors +# QA group: Aqua.jl project-quality checks and JET.jl static analysis. +# Runs in the isolated test/qa environment (see test/qa/Project.toml), gated on +# GROUP == "QA" in runtests.jl. +using OrgMaintenanceScripts +using Test +using Aqua using JET +using Dates + +@testset "Aqua quality assurance" begin + # stale_deps and deps_compat are known failing and marked @test_broken below. + # Tracked in https://github.com/SciML/OrgMaintenanceScripts.jl/issues/60 + Aqua.test_all(OrgMaintenanceScripts; stale_deps = false, deps_compat = false) + # Aqua stale deps: SnoopCompileCore, YAML — tracked in https://github.com/SciML/OrgMaintenanceScripts.jl/issues/60 + @test_broken false + # Aqua deps_compat: missing compat for Dates, Distributed, LibGit2, Logging, Pkg, Printf, Random — tracked in https://github.com/SciML/OrgMaintenanceScripts.jl/issues/60 + @test_broken false +end @testset "JET static analysis" begin @testset "Project utilities" begin - # Test type stability of project utility functions @test_opt target_modules = (OrgMaintenanceScripts,) OrgMaintenanceScripts.find_all_project_tomls(".") @test_opt target_modules = (OrgMaintenanceScripts,) OrgMaintenanceScripts.get_project_info("Project.toml") @test_opt target_modules = (OrgMaintenanceScripts,) OrgMaintenanceScripts.is_subpackage(".", ".") @@ -13,7 +27,6 @@ using JET end @testset "Version check finder" begin - # Create a temporary test file mktempdir() do tmpdir test_file = joinpath(tmpdir, "test.jl") write( @@ -28,26 +41,21 @@ using JET """ ) - # Test that find_version_checks_in_file is type stable @test_opt target_modules = (OrgMaintenanceScripts,) OrgMaintenanceScripts.find_version_checks_in_file( test_file ) end - # Test find_version_checks_in_repo with the current directory - # Note: This may have some issues from dependencies, so we use target_modules @test_opt target_modules = (OrgMaintenanceScripts,) OrgMaintenanceScripts.find_version_checks_in_repo(".") end @testset "Version bumping functions" begin - # Test bump_minor_version type stability @test_opt target_modules = (OrgMaintenanceScripts,) OrgMaintenanceScripts.bump_minor_version( "1.0.0" ) end @testset "Struct constructors" begin - # Test that struct constructors are type stable @test_opt OrgMaintenanceScripts.VersionCheck("test.jl", 1, "test line", v"1.0", "v\"1.0\"") @test_opt OrgMaintenanceScripts.InvalidationEntry("method", "file.jl", 1, "pkg", "reason", 0, 0) @test_opt OrgMaintenanceScripts.InvalidationReport( @@ -56,9 +64,7 @@ using JET end @testset "Report functions" begin - # Test VersionCheck related functions checks = OrgMaintenanceScripts.VersionCheck[] - # Test the IO method directly for type stability @test_opt target_modules = (OrgMaintenanceScripts,) OrgMaintenanceScripts.print_version_check_summary( devnull, checks ) diff --git a/test/qa/Project.toml b/test/qa/Project.toml new file mode 100644 index 0000000..5c00c49 --- /dev/null +++ b/test/qa/Project.toml @@ -0,0 +1,15 @@ +[deps] +Aqua = "4c88cf16-eb10-579e-8560-4a9242c79595" +Dates = "ade2ca70-3891-5945-98fb-dc099432e06a" +JET = "c3a54625-cd67-489e-a8e7-0a5a0ff4e31b" +OrgMaintenanceScripts = "87d49508-7ad8-40c6-ae47-b3ac92269cd4" +Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" + +[compat] +Aqua = "0.8" +JET = "0.9, 0.10, 0.11" +Test = "1" +julia = "1.10" + +[sources] +OrgMaintenanceScripts = {path = "../.."} diff --git a/test/runtests.jl b/test/runtests.jl index 9e75e39..bde2385 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -1,10 +1,21 @@ +using Pkg using OrgMaintenanceScripts using Test using TOML using Dates -@testset "OrgMaintenanceScripts.jl" begin - @testset "Version bumping" begin +const GROUP = get(ENV, "GROUP", "All") + +if GROUP == "QA" + Pkg.activate(joinpath(@__DIR__, "qa")) + Pkg.develop(PackageSpec(path = joinpath(@__DIR__, ".."))) + Pkg.instantiate() + include("qa.jl") +end + +if GROUP == "All" || GROUP == "Core" + @testset "OrgMaintenanceScripts.jl" begin + @testset "Version bumping" begin # Test bump_minor_version @test OrgMaintenanceScripts.bump_minor_version("1.2.3") == "1.3.0" @test OrgMaintenanceScripts.bump_minor_version("0.1.0") == "0.2.0" @@ -134,7 +145,6 @@ using Dates # Temporarily commented out due to syntax error in multiprocess_testing.jl # include("multiprocess_testing_tests.jl") include("documentation_cleanup_tests.jl") - # JET tests are available for manual static analysis but not included in CI - # To run JET analysis manually: julia --project=. -e 'using JET; include("test/jet_tests.jl")' - # include("jet_tests.jl") + # JET/Aqua static analysis runs in the QA group (GROUP=QA -> test/qa.jl). + end end diff --git a/test/test_groups.toml b/test/test_groups.toml new file mode 100644 index 0000000..00f326d --- /dev/null +++ b/test/test_groups.toml @@ -0,0 +1,12 @@ +# Root test-group matrix for OrgMaintenanceScripts.jl, consumed by the canonical +# grouped-tests.yml@v1 reusable workflow (see .github/workflows/CI.yml). Each +# group runs on every Julia version it lists. runtests.jl dispatches on GROUP. +# +# Core reproduces the previous CI matrix (Julia 1.10 == "lts", and "1"). +# QA runs Aqua/JET static analysis in an isolated environment (test/qa). + +[Core] +versions = ["lts", "1"] + +[QA] +versions = ["lts", "1"]