diff --git a/.github/workflows/test-algebraicepimodels.yaml b/.github/workflows/test-algebraicepimodels.yaml new file mode 100644 index 0000000..027d519 --- /dev/null +++ b/.github/workflows/test-algebraicepimodels.yaml @@ -0,0 +1,66 @@ +name: AlgebraicEpiModels smoke test + +on: + pull_request: + paths: + - AlgebraicEpiModels/** + - AlgebraicEpiMech/** + - ConfigurableEpi/** + - .github/workflows/test-algebraicepimodels.yaml + push: + branches: [master, main] + paths: + - AlgebraicEpiModels/** + - AlgebraicEpiMech/** + - ConfigurableEpi/** + - .github/workflows/test-algebraicepimodels.yaml + +permissions: + actions: write + contents: read + +jobs: + smoke-test: + name: Julia 1.13 + runs-on: ubuntu-latest + timeout-minutes: 15 + + steps: + - uses: actions/checkout@v7 + - uses: julia-actions/setup-julia@v3 + with: + version: '1.13' + - uses: julia-actions/cache@v3 + - name: Install and load the wrapper package + env: + JULIA_PKG_PRECOMPILE_AUTO: '0' + shell: julia --color=yes {0} + run: | + using Pkg + + Pkg.activate(mktempdir()) + Pkg.add(url = ENV["GITHUB_WORKSPACE"], subdir = "AlgebraicEpiModels") + Pkg.develop([ + PackageSpec(path = joinpath(ENV["GITHUB_WORKSPACE"], "AlgebraicEpiMech")), + PackageSpec(path = joinpath(ENV["GITHUB_WORKSPACE"], "ConfigurableEpi")), + ]) + + using AlgebraicEpiModels + + wrapper = AlgebraicEpiModels + mech = wrapper.AlgebraicEpiMech + configurable = wrapper.ConfigurableEpi + wrapper_exports = Set(names(wrapper)) + mech_exports = Set(names(mech)) + configurable_exports = Set(names(configurable)) + + conflicts = filter(intersect(mech_exports, configurable_exports)) do name + getproperty(mech, name) !== getproperty(configurable, name) + end + @assert isempty(conflicts) "Conflicting exports: $(sort!(collect(conflicts)))" + + for name in union(mech_exports, configurable_exports) + @assert name in wrapper_exports "Missing re-export: $name" + source = name in mech_exports ? mech : configurable + @assert getproperty(wrapper, name) === getproperty(source, name) + end diff --git a/AlgebraicEpiModels/Project.toml b/AlgebraicEpiModels/Project.toml new file mode 100644 index 0000000..7116b8e --- /dev/null +++ b/AlgebraicEpiModels/Project.toml @@ -0,0 +1,19 @@ +name = "AlgebraicEpiModels" +uuid = "b621e4e5-594b-4e55-ae0f-5d115ed6976b" +version = "0.1.0" +authors = ["Samuel Brand <48288458+SamuelBrand1@users.noreply.github.com>"] + +[deps] +AlgebraicEpiMech = "a6e39d6b-8b2d-49f3-aca0-f4154643f040" +ConfigurableEpi = "805b86f7-2d53-4db0-a930-efd5b25deb53" +Reexport = "189a3867-3050-52da-a836-e630ba90ab69" + +[sources] +AlgebraicEpiMech = {url = "https://github.com/CDCgov/AlgebraicEpiModels", subdir = "AlgebraicEpiMech"} +ConfigurableEpi = {url = "https://github.com/CDCgov/AlgebraicEpiModels", subdir = "ConfigurableEpi"} + +[compat] +AlgebraicEpiMech = "0.1" +ConfigurableEpi = "0.1" +Reexport = "1.2" +julia = "1.11" diff --git a/AlgebraicEpiModels/src/AlgebraicEpiModels.jl b/AlgebraicEpiModels/src/AlgebraicEpiModels.jl new file mode 100644 index 0000000..4aae415 --- /dev/null +++ b/AlgebraicEpiModels/src/AlgebraicEpiModels.jl @@ -0,0 +1,9 @@ +""" +Convenience module for re-exporting AlgebraicEpiMech and ConfigurableEpi. +""" +module AlgebraicEpiModels +using Reexport +@reexport using AlgebraicEpiMech +@reexport using ConfigurableEpi + +end diff --git a/docs/getting-started.md b/docs/getting-started.md index 7f09aa1..3fe26e0 100644 --- a/docs/getting-started.md +++ b/docs/getting-started.md @@ -11,6 +11,16 @@ Pkg.add(url = "https://github.com/CDCgov/AlgebraicEpiModels", subdir = "Algebrai Pkg.add(url = "https://github.com/CDCgov/AlgebraicEpiModels", subdir = "ConfigurableEpi") ``` +On Julia 1.13 or later, you can instead install only the convenience wrapper: + +```julia +using Pkg +Pkg.add(url = "https://github.com/CDCgov/AlgebraicEpiModels", subdir = "AlgebraicEpiModels") +``` + +This installs both underlying packages and re-exports their public APIs. +Installing only the wrapper relies on recursive package sources, which are a Julia 1.13+ feature. + Drawing Petri nets with `to_graphviz` needs the [Graphviz](https://graphviz.org/download/) `dot` executable on the `PATH`. To work on the packages themselves, clone the repository and instantiate the package you are working on; each package's test environment is a workspace project: