Skip to content

Commit

Permalink
Updates documentation and workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
cadojo committed Sep 9, 2024
1 parent eeb8c9f commit 10bd08c
Show file tree
Hide file tree
Showing 9 changed files with 302 additions and 99 deletions.
55 changes: 37 additions & 18 deletions .github/workflows/CompatHelper.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
60 changes: 54 additions & 6 deletions .github/workflows/Documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
35 changes: 35 additions & 0 deletions .github/workflows/Register.yml
Original file line number Diff line number Diff line change
@@ -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).
30 changes: 26 additions & 4 deletions .github/workflows/TagBot.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
name: TagBot

on:
issue_comment:
types:
- created
workflow_dispatch:
inputs:
lookback:
default: 3
default: "3"

permissions:
actions: read
checks: read
Expand All @@ -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
58 changes: 41 additions & 17 deletions .github/workflows/Tests.yml
Original file line number Diff line number Diff line change
@@ -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
82 changes: 70 additions & 12 deletions docs/make.jl
Original file line number Diff line number Diff line change
@@ -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",
)
Loading

0 comments on commit 10bd08c

Please sign in to comment.