diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index ad382aa..f37a8b3 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -12,14 +12,8 @@ concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }} jobs: - test: - name: "Tests" - strategy: - fail-fast: false - matrix: - version: - - "1" - uses: "SciML/.github/.github/workflows/tests.yml@v1" + tests: + uses: "SciML/.github/.github/workflows/grouped-tests.yml@v1" with: - julia-version: "${{ matrix.version }}" + group-env-name: PPS_TEST_GROUP secrets: "inherit" diff --git a/Project.toml b/Project.toml index f624209..6d7a479 100644 --- a/Project.toml +++ b/Project.toml @@ -30,6 +30,7 @@ ForwardDiff = "0.10, 1.3" JET = "0.9, 0.10, 0.11" KernelAbstractions = "0.9" LineSearch = "0.1" +LinearAlgebra = "1" NonlinearSolveBase = "2.24" Optimization = "4.1, 5.2" PrecompileTools = "1" @@ -40,6 +41,7 @@ SciMLBase = "2.79, 3.0" Setfield = "1.1" SimpleNonlinearSolve = "2.12" StaticArrays = "1.9" +Test = "1" julia = "1.10" [extras] diff --git a/test/Project.toml b/test/Project.toml index 602ee38..1090e98 100644 --- a/test/Project.toml +++ b/test/Project.toml @@ -3,6 +3,7 @@ JET = "c3a54625-cd67-489e-a8e7-0a5a0ff4e31b" KernelAbstractions = "63c18a36-062a-441e-b654-da1e3ab1ce7c" LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e" Optimization = "7f7a1694-90dd-40f0-9382-eb1efda571ba" +Pkg = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f" QuasiMonteCarlo = "8a4e6c94-4038-4cdc-81c3-7e6ffdb2a71b" Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c" SafeTestsets = "1bc83da4-3b8d-516f-aca4-4fe02f6d838f" diff --git a/test/jet.jl b/test/qa.jl similarity index 100% rename from test/jet.jl rename to test/qa.jl diff --git a/test/qa/Project.toml b/test/qa/Project.toml new file mode 100644 index 0000000..c7c271d --- /dev/null +++ b/test/qa/Project.toml @@ -0,0 +1,13 @@ +[deps] +JET = "c3a54625-cd67-489e-a8e7-0a5a0ff4e31b" +ParallelParticleSwarms = "ab63da0c-63b4-40fa-a3b7-d2cba5be6419" +StaticArrays = "90137ffa-7385-5640-81b9-e52037218182" +Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" + +[sources] +ParallelParticleSwarms = {path = "../.."} + +[compat] +JET = "0.9, 0.10, 0.11" +StaticArrays = "1.9" +julia = "1.10" diff --git a/test/runtests.jl b/test/runtests.jl index f8e921c..ac97ce6 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -1,18 +1,27 @@ +using Pkg using SafeTestsets using Test -global CI_GROUP = get(ENV, "GROUP", "CPU") +const TEST_GROUP = get(ENV, "PPS_TEST_GROUP", "Core") -@safetestset "Regression tests" include("./regression.jl") -@safetestset "Reinitialization tests" include("./reinit.jl") -@safetestset "JET static analysis" include("./jet.jl") +if TEST_GROUP == "QA" + Pkg.activate(joinpath(@__DIR__, "qa")) + Pkg.develop(PackageSpec(path = joinpath(@__DIR__, ".."))) + Pkg.instantiate() + include("qa.jl") +else + global CI_GROUP = get(ENV, "GROUP", "CPU") -#TODO: Current throws warning for redefinition with the use of @testset multiple times. Migrate to TestItemRunners.jl -@testset for BACKEND in unique(("CPU", CI_GROUP)) - global GROUP = BACKEND - @testset "$(BACKEND) optimizers tests" include("./gpu.jl") - GC.gc(true) - @testset "$(BACKEND) optimizers with constraints tests" include("./constraints.jl") - GC.gc(true) - @testset "$(BACKEND) hybrid optimizers" include("./lbfgs.jl") + @safetestset "Regression tests" include("./regression.jl") + @safetestset "Reinitialization tests" include("./reinit.jl") + + #TODO: Current throws warning for redefinition with the use of @testset multiple times. Migrate to TestItemRunners.jl + @testset for BACKEND in unique(("CPU", CI_GROUP)) + global GROUP = BACKEND + @testset "$(BACKEND) optimizers tests" include("./gpu.jl") + GC.gc(true) + @testset "$(BACKEND) optimizers with constraints tests" include("./constraints.jl") + GC.gc(true) + @testset "$(BACKEND) hybrid optimizers" include("./lbfgs.jl") + end end diff --git a/test/test_groups.toml b/test/test_groups.toml new file mode 100644 index 0000000..1fe84cd --- /dev/null +++ b/test/test_groups.toml @@ -0,0 +1,5 @@ +[Core] +versions = ["lts", "1", "pre"] + +[QA] +versions = ["lts", "1"]