From 10bd08c16081cd404b3451b07f8a0152af6b2845 Mon Sep 17 00:00:00 2001 From: Joey Carpinelli Date: Sun, 8 Sep 2024 22:58:35 -0400 Subject: [PATCH] Updates documentation and workflows --- .github/workflows/CompatHelper.yml | 55 +++++++++----- .github/workflows/Documentation.yml | 60 +++++++++++++-- .github/workflows/Register.yml | 35 +++++++++ .github/workflows/TagBot.yml | 30 +++++++- .github/workflows/Tests.yml | 58 ++++++++++----- docs/make.jl | 82 ++++++++++++++++++--- lib/AstrodynamicalCalculations/docs/make.jl | 21 +++--- lib/AstrodynamicalModels/docs/make.jl | 29 ++++---- lib/AstrodynamicalSolvers/docs/make.jl | 31 ++++---- 9 files changed, 302 insertions(+), 99 deletions(-) create mode 100644 .github/workflows/Register.yml diff --git a/.github/workflows/CompatHelper.yml b/.github/workflows/CompatHelper.yml index 5960da2b..e59ae00f 100644 --- a/.github/workflows/CompatHelper.yml +++ b/.github/workflows/CompatHelper.yml @@ -2,27 +2,46 @@ name: CompatHelper on: schedule: - - cron: '0 5 * * *' - - cron: '0 16 * * *' - issues: - types: [opened, reopened] - workflow_dispatch: + - cron: 0 0 * * * + workflow_dispatch: + +permissions: + contents: write + pull-requests: write jobs: - build: - runs-on: ${{ matrix.os }} - strategy: - matrix: - julia-version: [1] - julia-arch: [x86] - os: [ubuntu-latest] + CompatHelper: + runs-on: ubuntu-latest steps: - - uses: julia-actions/setup-julia@latest + - name: Check if Julia is already available in the PATH + id: julia_in_path + run: which julia + continue-on-error: true + - name: Install Julia, but only if it is not already available in the PATH + uses: julia-actions/setup-julia@v1 with: - version: ${{ matrix.julia-version }} - - name: Pkg.add("CompatHelper") - run: julia -e 'using Pkg; Pkg.add("CompatHelper")' - - name: CompatHelper.main() + version: "1" + arch: ${{ runner.arch }} + if: steps.julia_in_path.outcome != 'success' + - name: "Add the General registry via Git" + run: | + import Pkg + ENV["JULIA_PKG_SERVER"] = "" + Pkg.Registry.add("General") + shell: julia --color=yes {0} + - name: "Install CompatHelper" + run: | + import Pkg + name = "CompatHelper" + uuid = "aa819f21-2bde-4658-8897-bab36330d9b7" + version = "3" + Pkg.add(; name, uuid, version) + shell: julia --color=yes {0} + - name: "Run CompatHelper" + run: | + import CompatHelper + CompatHelper.main() + shell: julia --color=yes {0} env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: julia -e 'using CompatHelper; CompatHelper.main()' + COMPATHELPER_PRIV: ${{ secrets.DOCUMENTER_KEY }} diff --git a/.github/workflows/Documentation.yml b/.github/workflows/Documentation.yml index 3767aec2..1b034d0e 100644 --- a/.github/workflows/Documentation.yml +++ b/.github/workflows/Documentation.yml @@ -4,18 +4,66 @@ on: push: branches: - main - tags: '*' + tags: "*" + workflow_dispatch: jobs: - build: + deploy: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 + - uses: julia-actions/setup-julia@latest - with: - version: '1' - - name: Install dependencies - run: julia --project=docs/ -e 'using Pkg; Pkg.develop(PackageSpec(path=pwd())); Pkg.instantiate()' + + # + # AstrodynamicalCalculations Documentation + # + + - name: Install Documentation Dependencies for AstrodynamicalCalculations + run: julia --project=lib/AstrodynamicalCalculations/docs -e 'using Pkg; Pkg.develop(PackageSpec(path = joinpath("lib", "AstrodynamicalCalculations"))); Pkg.instantiate()' + + - name: Build and deploy AstrodynamicalCalculations + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + DOCUMENTER_KEY: ${{ secrets.DOCUMENTER_KEY }} + working-directory: lib/AstrodynamicalCalculations + run: julia --project=docs/ docs/make.jl + + # + # AstrodynamicalModels Documentation + # + + - name: Install Documentation Dependencies for AstrodynamicalModels + run: julia --project=lib/AstrodynamicalModels/docs -e 'using Pkg; Pkg.develop(PackageSpec(path = joinpath("lib", "AstrodynamicalModels"))); Pkg.instantiate()' + + - name: Build and deploy AstrodynamicalModels + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + DOCUMENTER_KEY: ${{ secrets.DOCUMENTER_KEY }} + working-directory: lib/AstrodynamicalModels + run: julia --project=docs/ docs/make.jl + + # + # AstrodynamicalSolvers Documentation + # + + - name: Install Documentation Dependencies for AstrodynamicalSolvers + run: julia --project=lib/AstrodynamicalSolvers/docs -e 'using Pkg; Pkg.develop(PackageSpec(path = joinpath("lib", "AstrodynamicalSolvers"))); Pkg.instantiate()' + + - name: Build and deploy AstrodynamicalSolvers + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + DOCUMENTER_KEY: ${{ secrets.DOCUMENTER_KEY }} + working-directory: lib/AstrodynamicalSolvers + run: julia --project=docs/ docs/make.jl + + # + # GeneralAstrodynamics Documentation + # + + - name: Install Documentation Dependencies + run: julia --project=docs -e 'using Pkg; Pkg.develop(PackageSpec(path = @__DIR__)); Pkg.instantiate()' + - name: Build and deploy env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # For authentication with GitHub Actions token diff --git a/.github/workflows/Register.yml b/.github/workflows/Register.yml new file mode 100644 index 00000000..e55c5bde --- /dev/null +++ b/.github/workflows/Register.yml @@ -0,0 +1,35 @@ +name: Register + +on: + workflow_dispatch: + +jobs: + release-subpackages: + name: Register Subpackages + runs-on: ubuntu-latest + strategy: + matrix: + group: + - EphemerisSourcesBase + - HorizonsAPI + - HorizonsEphemeris + - SPICEKernels + - SPICEBodies + steps: + - uses: peter-evans/commit-comment@v3 + with: + body: | + @JuliaRegistrator register subdir="lib/${{ matrix.group }}" + + This comment was generated with `commit-comment` and [`Register.yml`](/.github/workflows/Register.yml). + + release-superpackage: + name: Register Superpackage + runs-on: ubuntu-latest + steps: + - uses: peter-evans/commit-comment@v3 + with: + body: | + @JuliaRegistrator register" + + This comment was generated with `commit-comment` and [`Register.yml`](/.github/workflows/Register.yml). diff --git a/.github/workflows/TagBot.yml b/.github/workflows/TagBot.yml index c9ad3a60..a2a3683e 100644 --- a/.github/workflows/TagBot.yml +++ b/.github/workflows/TagBot.yml @@ -1,4 +1,5 @@ name: TagBot + on: issue_comment: types: @@ -6,7 +7,8 @@ on: workflow_dispatch: inputs: lookback: - default: 3 + default: "3" + permissions: actions: read checks: read @@ -20,13 +22,33 @@ permissions: repository-projects: read security-events: read statuses: read + jobs: TagBot: - if: - github.event_name == 'workflow_dispatch' || github.actor == 'JuliaTagBot' + if: github.event_name == 'workflow_dispatch' || github.actor == 'JuliaTagBot' runs-on: ubuntu-latest steps: - - uses: JuliaRegistries/TagBot@v1 + - name: Tag AstrodynamicalCalculations.jl + uses: JuliaRegistries/TagBot@v1 with: token: ${{ secrets.GITHUB_TOKEN }} ssh: ${{ secrets.DOCUMENTER_KEY }} + subdir: lib/AstrodynamicalCalculations + - name: Tag AstrodynamicalModels.jl + uses: JuliaRegistries/TagBot@v1 + with: + token: ${{ secrets.GITHUB_TOKEN }} + ssh: ${{ secrets.DOCUMENTER_KEY }} + subdir: lib/AstrodynamicalModels + - name: Tag AstrodynamicalSolvers.jl + uses: JuliaRegistries/TagBot@v1 + with: + token: ${{ secrets.GITHUB_TOKEN }} + ssh: ${{ secrets.DOCUMENTER_KEY }} + subdir: lib/AstrodynamicalSolvers + - name: Tag AstrodynamicalModels.jl + uses: JuliaRegistries/TagBot@v1 + with: + token: ${{ secrets.GITHUB_TOKEN }} + ssh: ${{ secrets.DOCUMENTER_KEY }} + subdir: lib/AstrodynamicalModels diff --git a/.github/workflows/Tests.yml b/.github/workflows/Tests.yml index 85f764b6..cec478ef 100644 --- a/.github/workflows/Tests.yml +++ b/.github/workflows/Tests.yml @@ -1,35 +1,59 @@ name: Tests + +# +# Content copied and modified from https://github.com/SciML/Optimization.jl +# + on: + pull_request: + branches: + - main + paths-ignore: + - "**/docs/**" + - "**/paper/**" push: branches: - main - schedule: - - cron: "0 0 * * 4" + paths-ignore: + - "**/docs/**" + - "**/paper/**" + workflow_dispatch: + jobs: test: - name: - Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }} - ${{ github.event_name }} - runs-on: ${{ matrix.os }} + runs-on: ubuntu-latest strategy: - fail-fast: true + fail-fast: false matrix: + group: + - AstrodynamicalCalculations + - AstrodynamicalModels + - AstrodynamicalSolvers version: - "1" - os: - - ubuntu-latest - arch: - - x64 steps: - - uses: actions/checkout@v2 - - uses: julia-actions/setup-julia@v1 + - uses: actions/checkout@v4 + - uses: julia-actions/setup-julia@v2 with: version: ${{ matrix.version }} - arch: ${{ matrix.arch }} - - uses: actions/cache@v1 + - uses: actions/cache@v4 env: cache-name: cache-artifacts with: path: ~/.julia/artifacts - key: ${{ runner.os }}-test-${{ env.cache-name }}-${{hashFiles('**/Project.toml') }} - - uses: julia-actions/julia-buildpkg@latest - - uses: julia-actions/julia-runtest@latest + 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 + env: + GROUP: ${{ matrix.group }} + - uses: julia-actions/julia-processcoverage@v1 + with: + directories: lib/${{ matrix.group }}/src + # - uses: codecov/codecov-action@v4 + # env: + # CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} + # slug: JuliaAstro/${{ matrix.group }}.jl diff --git a/docs/make.jl b/docs/make.jl index a0408a87..9c5b8cb6 100644 --- a/docs/make.jl +++ b/docs/make.jl @@ -1,25 +1,83 @@ using Documenter using DocStringExtensions -using GeneralAstrodynamics +using GeneralAstrodynamics using DifferentialEquations using Plots makedocs( - format=Documenter.HTML(), - sitename="GeneralAstrodynamics.jl", + format = Documenter.HTML(), + sitename = "GeneralAstrodynamics.jl", authors = "Joey Carpinelli", - pages=[ - "Quick Start" => [ - "Getting Started" => "index.md", - "Docstrings" => "docstrings.md" - ] - ] + pages = [ + "Quick Start" => ["Getting Started" => "index.md", "Docstrings" => "docstrings.md"], + ], ) deploydocs( target = "build", - repo="github.com/cadojo/GeneralAstrodynamics.jl.git", - branch = "gh-pages", + repo = "github.com/cadojo/GeneralAstrodynamics.jl.git", + branch = "docs/general-astrodynamics", devbranch = "main", - versions = ["stable" => "v^", "manual", "v#.#", "v#.#.#"], +) + + +using MultiDocumenter + +clonedir = mktempdir() + +content = [ + MultiDocumenter.MultiDocRef( + upstream = joinpath(clonedir, "GeneralAstrodynamics.jl"), + path = "docs", + name = "GeneralAstrodynamics.jl", + branch = "docs/general-astrodynamics", + giturl = "https://github.com/cadojo/GeneralAstrodynamics.jl.git", + fix_canonical_url = false, + ), + MultiDocumenter.MultiDocRef( + upstream = joinpath(clonedir, "AstrodynamicalCalculations.jl"), + path = joinpath("docs", "lib", "AstrodynamicalCalculations"), + name = "Calculations", + branch = "docs/astrodynamical-calculations", + giturl = "https://github.com/cadojo/GeneralAstrodynamics.jl.git", + fix_canonical_url = false, + ), + MultiDocumenter.MultiDocRef( + upstream = joinpath(clonedir, "AstrodynamicalModels.jl"), + path = joinpath("docs", "lib", "AstrodynamicalModels"), + name = "Models", + branch = "docs/astrodynamical-models", + giturl = "https://github.com/cadojo/GeneralAstrodynamics.jl.git", + fix_canonical_url = false, + ), + MultiDocumenter.MultiDocRef( + upstream = joinpath(clonedir, "AstrodynamicalSolvers.jl"), + path = joinpath("docs", "lib", "AstrodynamicalSolvers"), + name = "Solvers", + branch = "docs/astrodynamical-solvers", + giturl = "https://github.com/cadojo/GeneralAstrodynamics.jl.git", + fix_canonical_url = false, + ), +] + +outpath = joinpath(@__DIR__, "build") + +MultiDocumenter.make( + outpath, + content; + prettyurls = true, + search_engine = MultiDocumenter.SearchConfig( + index_versions = ["stable", "dev"], + engine = MultiDocumenter.FlexSearch, + ), + brand_image = MultiDocumenter.BrandImage( + "https://juliaastro.org", + "http://juliaastro.org/dev/assets/logo.svg", + ), +) + +Documenter.deploydocs( + target = outpath, + versions = nothing, + repo = "github.com/cadojo/GeneralAstrodynamics.jl", ) diff --git a/lib/AstrodynamicalCalculations/docs/make.jl b/lib/AstrodynamicalCalculations/docs/make.jl index dcb4f549..cd9f41b4 100644 --- a/lib/AstrodynamicalCalculations/docs/make.jl +++ b/lib/AstrodynamicalCalculations/docs/make.jl @@ -2,21 +2,22 @@ using Documenter using AstrodynamicalCalculations makedocs( - sitename="AstrodynamicalCalculations.jl", - format=Documenter.HTML(), - modules=[AstrodynamicalCalculations], + sitename = "AstrodynamicalCalculations.jl", + format = Documenter.HTML(), + modules = [AstrodynamicalCalculations], authors = "Joey Carpinelli", - pages=[ + pages = [ "Getting Started" => "index.md", "R2BP Equations" => "r2bp.md", "CR3BP Equations" => "cr3bp.md", - ] + ], ) deploydocs( - target="build", - repo="github.com/cadojo/AstrodynamicalCalculations.jl.git", - branch="gh-pages", - devbranch="main", - versions=["stable" => "v^", "manual", "v#.#", "v#.#.#"], + target = "build", + repo = "github.com/cadojo/AstrodynamicalCalculations.jl.git", + branch = "docs/astrodynamical-calculations", + devbranch = "main", + tag_prefix = "AstrodynamicalCalculations-", ) + diff --git a/lib/AstrodynamicalModels/docs/make.jl b/lib/AstrodynamicalModels/docs/make.jl index 9326223f..16ddfecc 100644 --- a/lib/AstrodynamicalModels/docs/make.jl +++ b/lib/AstrodynamicalModels/docs/make.jl @@ -4,28 +4,25 @@ using ModelingToolkit using AstrodynamicalModels makedocs( - sitename="AstrodynamicalModels", - format=Documenter.HTML(), - modules=[AstrodynamicalModels], - pages=[ - "Overview" => [ - "Getting Started" => "index.md", - "Docstrings" => "docstrings.md" - ], + sitename = "AstrodynamicalModels", + format = Documenter.HTML(), + modules = [AstrodynamicalModels], + pages = [ + "Overview" => ["Getting Started" => "index.md", "Docstrings" => "docstrings.md"], "Models" => [ "R2BP" => "R2BP.md", "CR3BP" => "CR3BP.md", "NBP" => "NBP.md", "Entry" => "Entry.md", "Attitude" => "Attitude.md", - ] - ] + ], + ], ) deploydocs( - target="build", - repo="github.com/cadojo/AstrodynamicalModels.jl.git", - branch="gh-pages", - devbranch="main", - versions=["stable" => "v^", "manual", "v#.#", "v#.#.#"], -) + target = "build", + repo = "github.com/cadojo/AstrodynamicalModels.jl.git", + branch = "docs/astrodynamical-models", + devbranch = "main", + tag_prefix = "AstrodynamicalModels-", +) \ No newline at end of file diff --git a/lib/AstrodynamicalSolvers/docs/make.jl b/lib/AstrodynamicalSolvers/docs/make.jl index 85952eed..32908549 100644 --- a/lib/AstrodynamicalSolvers/docs/make.jl +++ b/lib/AstrodynamicalSolvers/docs/make.jl @@ -2,23 +2,22 @@ using Documenter using AstrodynamicalSolvers makedocs( - sitename="AstrodynamicalSolvers.jl", - format=Documenter.HTML(), - modules=[AstrodynamicalSolvers], - authors="Joey Carpinelli", - pages=[ + sitename = "AstrodynamicalSolvers.jl", + format = Documenter.HTML(), + modules = [AstrodynamicalSolvers], + authors = "Joey Carpinelli", + pages = [ "Getting Started" => "index.md", - "Reference" => [ - "`AstrodynamicalSolvers`" => "reference.md", - "`CR3BSolvers`" => "cr3bp.md", - ] - ] + "Reference" => + ["`AstrodynamicalSolvers`" => "reference.md", "`CR3BSolvers`" => "cr3bp.md"], + ], ) + deploydocs( - target="build", - repo="github.com/cadojo/AstrodynamicalSolvers.jl.git", - branch="gh-pages", - devbranch="main", - versions=["stable" => "v^", "manual", "v#.#", "v#.#.#"], -) + target = "build", + repo = "github.com/cadojo/AstrodynamicalSolvers.jl.git", + branch = "docs/astrodynamical-solvers", + devbranch = "main", + tag_prefix = "AstrodynamicalSolvers-", +) \ No newline at end of file