diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml deleted file mode 100644 index e3f54adf5b..0000000000 --- a/.github/workflows/CI.yml +++ /dev/null @@ -1,44 +0,0 @@ -name: CI -on: - pull_request: - branches: - - master - push: - branches: - - master -jobs: - test: - runs-on: ubuntu-latest - strategy: - matrix: - group: - - Core - version: - - '1' - steps: - - uses: actions/checkout@v4 - - uses: julia-actions/setup-julia@v2 - with: - version: ${{ matrix.version }} - - uses: actions/cache@v4 - env: - cache-name: cache-artifacts - with: - path: ~/.julia/artifacts - key: ${{ runner.os }}-test-${{ env.cache-name }}-${{ hashFiles('**/Project.toml') }} - restore-keys: | - ${{ runner.os }}-test-${{ env.cache-name }}- - ${{ runner.os }}-test- - ${{ runner.os }}- - - uses: julia-actions/julia-buildpkg@v1 - - uses: julia-actions/julia-runtest@v1 - - uses: julia-actions/julia-processcoverage@v1 - - uses: codecov/codecov-action@v4 - with: - file: lcov.info - token: ${{ secrets.CODECOV_TOKEN }} - fail_ci_if_error: false - - uses: coverallsapp/github-action@master - with: - github-token: ${{ secrets.GITHUB_TOKEN }} - path-to-lcov: ./lcov.info diff --git a/.github/workflows/Test.yml b/.github/workflows/Test.yml new file mode 100644 index 0000000000..b6328c8d6d --- /dev/null +++ b/.github/workflows/Test.yml @@ -0,0 +1,39 @@ +name: "Tests" + +on: + pull_request: + branches: + - master + paths-ignore: + - 'docs/**' + push: + branches: + - master + paths-ignore: + - 'docs/**' + +concurrency: + # Skip intermediate builds: always, but for the master branch. + # Cancel intermediate builds: always, but for the master branch. + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: ${{ github.ref != 'refs/heads/master' }} + +jobs: + tests: + name: "Tests" + strategy: + fail-fast: false + matrix: + version: + - "1" + - "lts" + - "pre" + group: + - Core + - Spatial + - Extensions + uses: "SciML/.github/.github/workflows/tests.yml@v1" + with: + julia-version: "${{ matrix.version }}" + group: "${{ matrix.group }}" + secrets: "inherit" diff --git a/Project.toml b/Project.toml index c100c1b450..e87278e3d7 100644 --- a/Project.toml +++ b/Project.toml @@ -71,17 +71,14 @@ Unitful = "1.12.4" julia = "1.10" [extras] -BifurcationKit = "0f109fa4-8a5d-4b75-95aa-f515264e7665" -CairoMakie = "13f3f980-e62b-5c42-98c6-ff1f3baf88f0" DiffEqCallbacks = "459566f4-90b8-5000-8ac3-15dfb0a30def" DomainSets = "5b8099bc-c8ec-5219-889f-1d9e522a28bf" -GraphMakie = "1ecd5474-83a3-4783-bb4f-06765db800d2" Graphviz_jll = "3c863552-8265-54e4-a6dc-903eb78fde85" -HomotopyContinuation = "f213a82b-91d6-5c5d-acf7-10f1c761b327" LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e" Logging = "56ddb016-857b-54e1-b83d-db4d58db5568" NonlinearSolve = "8913a72c-1f9b-4ce2-8d82-65094dcecaec" OrdinaryDiffEq = "1dea7af3-3e70-54e6-95c3-0bf5283fa5ed" +Pkg = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f" Plots = "91a5bcdd-55d7-5caf-9e0b-520d859cae80" Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c" SafeTestsets = "1bc83da4-3b8d-516f-aca4-4fe02f6d838f" @@ -92,9 +89,11 @@ StaticArrays = "90137ffa-7385-5640-81b9-e52037218182" Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2" SteadyStateDiffEq = "9672c7b4-1e72-59bd-8a11-6ac3964bc41f" StochasticDiffEq = "789caeaf-c7a9-5a7d-9973-96adeb23e2a0" -# StructuralIdentifiability = "220ca800-aa68-49bb-acd8-6037fa93a544" Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" Unitful = "1986cc42-f94f-5a68-af5c-568840ba703d" [targets] -test = ["BifurcationKit", "CairoMakie", "DiffEqCallbacks", "DomainSets", "Graphviz_jll", "HomotopyContinuation", "Logging", "GraphMakie", "NonlinearSolve", "OrdinaryDiffEq", "Plots", "Random", "SafeTestsets", "SciMLBase", "SciMLNLSolve", "StableRNGs", "StaticArrays", "Statistics", "SteadyStateDiffEq", "StochasticDiffEq", "Test", "Unitful"] +test = ["DiffEqCallbacks", "DomainSets", "Graphviz_jll", "Logging", "NonlinearSolve", + "OrdinaryDiffEq", "Pkg", "Plots", "Random", "SafeTestsets", "SciMLBase", "SciMLNLSolve", + "StableRNGs", "StaticArrays", "Statistics", "SteadyStateDiffEq", "StochasticDiffEq", + "Test", "Unitful"] diff --git a/test/extensions/Project.toml b/test/extensions/Project.toml new file mode 100644 index 0000000000..3b6c17bf0a --- /dev/null +++ b/test/extensions/Project.toml @@ -0,0 +1,12 @@ +[deps] +BifurcationKit = "0f109fa4-8a5d-4b75-95aa-f515264e7665" +Catalyst = "479239e8-5488-4da2-87a7-35f2df7eef83" +CairoMakie = "13f3f980-e62b-5c42-98c6-ff1f3baf88f0" +GraphMakie = "1ecd5474-83a3-4783-bb4f-06765db800d2" +Graphs = "86223c79-3864-5bf0-83f7-82e725a168b6" +HomotopyContinuation = "f213a82b-91d6-5c5d-acf7-10f1c761b327" +JumpProcesses = "ccbc3e58-028d-4f4c-8cd5-9ae44345cda5" +ModelingToolkit = "961ee093-0014-501f-94e3-6117800e7a78" +OrdinaryDiffEq = "1dea7af3-3e70-54e6-95c3-0bf5283fa5ed" +SteadyStateDiffEq = "9672c7b4-1e72-59bd-8a11-6ac3964bc41f" +# StructuralIdentifiability = "220ca800-aa68-49bb-acd8-6037fa93a544" diff --git a/test/spatial_modelling/lattice_simulation_plotting.jl b/test/extensions/lattice_simulation_plotting.jl similarity index 100% rename from test/spatial_modelling/lattice_simulation_plotting.jl rename to test/extensions/lattice_simulation_plotting.jl diff --git a/test/miscellaneous_tests/stability_computation.jl b/test/extensions/stability_computation.jl similarity index 100% rename from test/miscellaneous_tests/stability_computation.jl rename to test/extensions/stability_computation.jl diff --git a/test/runtests.jl b/test/runtests.jl index fd4e69c486..ab3afab8c9 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -1,78 +1,92 @@ ### Preparations ### # Required for `@safetestset` and `@testset`, respectively. -using SafeTestsets, Test +using SafeTestsets, Test, Pkg # Required for running parallel test groups (copied from ModelingToolkit). -#const GROUP = get(ENV, "GROUP", "All") +const GROUP = get(ENV, "GROUP", "All") +function activate_extensions_env() + Pkg.activate("extensions") + Pkg.develop(PackageSpec(path = dirname(@__DIR__))) + Pkg.instantiate() +end ### Run Tests ### @time begin + if GROUP == "All" || GROUP == "Core" + # Tests the `ReactionSystem` structure and its properties. + @time @safetestset "Reaction Structure" begin include("reactionsystem_core/reaction.jl") end + @time @safetestset "ReactionSystem Structure" begin include("reactionsystem_core/reactionsystem.jl") end + @time @safetestset "Higher Order Reactions" begin include("reactionsystem_core/higher_order_reactions.jl") end + @time @safetestset "Symbolic Stoichiometry" begin include("reactionsystem_core/symbolic_stoichiometry.jl") end + @time @safetestset "Parameter Type Designation" begin include("reactionsystem_core/parameter_type_designation.jl") end + @time @safetestset "Custom CRN Functions" begin include("reactionsystem_core/custom_crn_functions.jl") end + @time @safetestset "Coupled CRN/Equation Systems" begin include("reactionsystem_core/coupled_equation_crn_systems.jl") end + @time @safetestset "Events" begin include("reactionsystem_core/events.jl") end + + # Tests model creation via the @reaction_network DSL. + @time @safetestset "DSL Basic Model Construction" begin include("dsl/dsl_basic_model_construction.jl") end + @time @safetestset "DSL Advanced Model Construction" begin include("dsl/dsl_advanced_model_construction.jl") end + @time @safetestset "DSL Options" begin include("dsl/dsl_options.jl") end + + # Tests compositional and hierarchical modelling. + @time @safetestset "ReactionSystem Components Based Creation" begin include("compositional_modelling/component_based_model_creation.jl") end + + # Tests various miscellaneous features. + @time @safetestset "API" begin include("miscellaneous_tests/api.jl") end + @time @safetestset "Units" begin include("miscellaneous_tests/units.jl") end + @time @safetestset "Compound Species" begin include("miscellaneous_tests/compound_macro.jl") end + @time @safetestset "Reaction Balancing" begin include("miscellaneous_tests/reaction_balancing.jl") end + @time @safetestset "ReactionSystem Serialisation" begin include("miscellaneous_tests/reactionsystem_serialisation.jl") end + + # Tests reaction network analysis features. + @time @safetestset "Conservation Laws" begin include("network_analysis/conservation_laws.jl") end + @time @safetestset "Network Properties" begin include("network_analysis/network_properties.jl") end + + # Tests ODE, SDE, jump simulations, nonlinear solving, and steady state simulations. + @time @safetestset "ODE System Simulations" begin include("simulation_and_solving/simulate_ODEs.jl") end + @time @safetestset "Automatic Jacobian Construction" begin include("simulation_and_solving/jacobian_construction.jl") end + @time @safetestset "SDE System Simulations" begin include("simulation_and_solving/simulate_SDEs.jl") end + @time @safetestset "Jump System Simulations" begin include("simulation_and_solving/simulate_jumps.jl") end + @time @safetestset "Nonlinear and SteadyState System Solving" begin include("simulation_and_solving/solve_nonlinear.jl") end + + # Tests upstream SciML and DiffEq stuff. + @time @safetestset "MTK Structure Indexing" begin include("upstream/mtk_structure_indexing.jl") end + @time @safetestset "MTK Problem Inputs" begin include("upstream/mtk_problem_inputs.jl") end + + # Tests network visualisation. + # @time @safetestset "Latexify" begin include("visualisation/latexify.jl") end + # Disable on Macs as can't install GraphViz via jll + if !Sys.isapple() + @time @safetestset "Graphs Visualisations" begin include("visualisation/graphs.jl") end + end + end - # Tests the `ReactionSystem` structure and its properties. - @time @safetestset "Reaction Structure" begin include("reactionsystem_core/reaction.jl") end - @time @safetestset "ReactionSystem Structure" begin include("reactionsystem_core/reactionsystem.jl") end - @time @safetestset "Higher Order Reactions" begin include("reactionsystem_core/higher_order_reactions.jl") end - @time @safetestset "Symbolic Stoichiometry" begin include("reactionsystem_core/symbolic_stoichiometry.jl") end - @time @safetestset "Parameter Type Designation" begin include("reactionsystem_core/parameter_type_designation.jl") end - @time @safetestset "Custom CRN Functions" begin include("reactionsystem_core/custom_crn_functions.jl") end - @time @safetestset "Coupled CRN/Equation Systems" begin include("reactionsystem_core/coupled_equation_crn_systems.jl") end - @time @safetestset "Events" begin include("reactionsystem_core/events.jl") end - - # Tests model creation via the @reaction_network DSL. - @time @safetestset "DSL Basic Model Construction" begin include("dsl/dsl_basic_model_construction.jl") end - @time @safetestset "DSL Advanced Model Construction" begin include("dsl/dsl_advanced_model_construction.jl") end - @time @safetestset "DSL Options" begin include("dsl/dsl_options.jl") end - - # Tests compositional and hierarchical modelling. - @time @safetestset "ReactionSystem Components Based Creation" begin include("compositional_modelling/component_based_model_creation.jl") end - - # Tests various miscellaneous features. - @time @safetestset "API" begin include("miscellaneous_tests/api.jl") end - @time @safetestset "Units" begin include("miscellaneous_tests/units.jl") end - @time @safetestset "Compound Species" begin include("miscellaneous_tests/compound_macro.jl") end - @time @safetestset "Reaction Balancing" begin include("miscellaneous_tests/reaction_balancing.jl") end - @time @safetestset "ReactionSystem Serialisation" begin include("miscellaneous_tests/reactionsystem_serialisation.jl") end - - # Tests reaction network analysis features. - @time @safetestset "Conservation Laws" begin include("network_analysis/conservation_laws.jl") end - @time @safetestset "Network Properties" begin include("network_analysis/network_properties.jl") end - - # Tests ODE, SDE, jump simulations, nonlinear solving, and steady state simulations. - @time @safetestset "ODE System Simulations" begin include("simulation_and_solving/simulate_ODEs.jl") end - @time @safetestset "Automatic Jacobian Construction" begin include("simulation_and_solving/jacobian_construction.jl") end - @time @safetestset "SDE System Simulations" begin include("simulation_and_solving/simulate_SDEs.jl") end - @time @safetestset "Jump System Simulations" begin include("simulation_and_solving/simulate_jumps.jl") end - @time @safetestset "Nonlinear and SteadyState System Solving" begin include("simulation_and_solving/solve_nonlinear.jl") end - - # Tests upstream SciML and DiffEq stuff. - @time @safetestset "MTK Structure Indexing" begin include("upstream/mtk_structure_indexing.jl") end - @time @safetestset "MTK Problem Inputs" begin include("upstream/mtk_problem_inputs.jl") end - - # Tests network visualisation. - # @time @safetestset "Latexify" begin include("visualisation/latexify.jl") end - # Disable on Macs as can't install GraphViz via jll - if !Sys.isapple() - @time @safetestset "Graphs Visualisations" begin include("visualisation/graphs.jl") end + if GROUP == "All" || GROUP == "Spatial" + # Tests spatial modelling and simulations. + @time @safetestset "PDE Systems Simulations" begin include("spatial_modelling/simulate_PDEs.jl") end + @time @safetestset "Spatial Reactions" begin include("spatial_modelling/spatial_reactions.jl") end + @time @safetestset "Lattice Reaction Systems" begin include("spatial_modelling/lattice_reaction_systems.jl") end + @time @safetestset "Spatial Lattice Variants" begin include("spatial_modelling/lattice_reaction_systems_lattice_types.jl") end + @time @safetestset "ODE Lattice Systems Simulations" begin include("spatial_modelling/lattice_reaction_systems_ODEs.jl") end + @time @safetestset "Jump Lattice Systems Simulations" begin include("spatial_modelling/lattice_reaction_systems_jumps.jl") end + @time @safetestset "Lattice Simulation Structure Interfacing" begin include("spatial_modelling/lattice_simulation_struct_interfacing.jl") end end # Tests extensions. - @time @safetestset "BifurcationKit Extension" begin include("extensions/bifurcation_kit.jl") end - @time @safetestset "HomotopyContinuation Extension" begin include("extensions/homotopy_continuation.jl") end - # @time @safetestset "Structural Identifiability Extension" begin include("extensions/structural_identifiability.jl") end - - # Tests stability computation (uses HomotopyContinuation extension). - @time @safetestset "Steady State Stability Computations" begin include("miscellaneous_tests/stability_computation.jl") end - - # Tests spatial modelling and simulations. - @time @safetestset "PDE Systems Simulations" begin include("spatial_modelling/simulate_PDEs.jl") end - @time @safetestset "Spatial Reactions" begin include("spatial_modelling/spatial_reactions.jl") end - @time @safetestset "Lattice Reaction Systems" begin include("spatial_modelling/lattice_reaction_systems.jl") end - @time @safetestset "Spatial Lattice Variants" begin include("spatial_modelling/lattice_reaction_systems_lattice_types.jl") end - @time @safetestset "ODE Lattice Systems Simulations" begin include("spatial_modelling/lattice_reaction_systems_ODEs.jl") end - @time @safetestset "Jump Lattice Systems Simulations" begin include("spatial_modelling/lattice_reaction_systems_jumps.jl") end - @time @safetestset "Lattice Simulation Structure Interfacing" begin include("spatial_modelling/lattice_simulation_struct_interfacing.jl") end - @time @safetestset "Lattice Simulation Plotting" begin include("spatial_modelling/lattice_simulation_plotting.jl") end + if GROUP == "All" || GROUP == "Extensions" + activate_extensions_env() + + @time @safetestset "BifurcationKit Extension" begin include("extensions/bifurcation_kit.jl") end + @time @safetestset "HomotopyContinuation Extension" begin include("extensions/homotopy_continuation.jl") end + # @time @safetestset "Structural Identifiability Extension" begin include("extensions/structural_identifiability.jl") end + + # Tests stability computation (but requires the HomotopyContinuation extension). + @time @safetestset "Steady State Stability Computations" begin include("extensions/stability_computation.jl") end + + # Test spatial plotting, using CarioMakie and GraphMakie + @time @safetestset "Lattice Simulation Plotting" begin include("extensions/lattice_simulation_plotting.jl") end + end end # @time