Skip to content

Commit 4ac6dce

Browse files
authored
build: update packages tested (#207)
1 parent 2a0e4b3 commit 4ac6dce

3 files changed

Lines changed: 40 additions & 5 deletions

File tree

.github/workflows/CI.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,11 @@ jobs:
3030
version: ${{ matrix.version }}
3131
arch: ${{ matrix.arch }}
3232
- uses: julia-actions/cache@v3
33+
- name: Add AstroRegistry
34+
shell: julia --project=. --color=yes {0}
35+
run: |
36+
import Pkg
37+
Pkg.Registry.add(Pkg.RegistrySpec(url="https://github.com/astro-group-bristol/AstroRegistry/"))
3338
- uses: julia-actions/julia-buildpkg@v1
3439
- uses: julia-actions/julia-runtest@v1
3540
with:

.github/workflows/Documentation.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,12 @@ jobs:
1515
with:
1616
version: "1"
1717
- uses: julia-actions/cache@v3
18+
- name: Add AstroRegistry
19+
shell: julia --project=. --color=yes {0}
20+
run: |
21+
import Pkg
22+
Pkg.Registry.add("General")
23+
Pkg.Registry.add(Pkg.RegistrySpec(url="https://github.com/astro-group-bristol/AstroRegistry/"))
1824
- uses: julia-actions/julia-docdeploy@v1
1925
env:
2026
DOCUMENTER_KEY: ${{ secrets.DOCUMENTER_KEY }}

test/_packages.jl

Lines changed: 29 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,55 @@
11
function test_packages(mode)
2+
Pkg.activate(; temp = true)
23
@testset "Compatibility - $(mode)" begin
34
for package in packages_juliaastro
45
p_name = package.name
56
@info string("Adding: ", p_name)
67
@testset "$(p_name)" begin
78
if mode == :release
8-
if p_name == "Spectra.jl"
9-
# TODO: Register
10-
@test Pkg.add(url="https://github.com/JuliaAstro/Spectra.jl") == nothing
9+
if p_name == "ASDF.jl"
10+
# TODO: Register ASDF.jl v2 (v1 Python version currently broken)
11+
@test_skip p_name
12+
elseif p_name == "Spectra.jl"
13+
# TODO: Register SpectrumBase.jl
14+
@test_skip p_name
15+
elseif p_name == "GeneralAstrodynamics.jl"
16+
@test_skip p_name
1117
else
18+
@info "Adding package" p_name
1219
@test Pkg.add(chopsuffix(p_name, ".jl")) == nothing
1320
end
1421
elseif mode == :dev
15-
@test Pkg.add(url=package.repo) == nothing
22+
# Currently needed for Astroalign.jl until ConsensusFitting.jl is registered
23+
Pkg.add(url = "https://github.com/JuliaAstro/ConsensusFitting.jl")
24+
if p_name == "GeneralAstrodynamics.jl"
25+
# https://github.com/JuliaAstro/GeneralAstrodynamics.jl/pull/275
26+
repo = "https://github.com/JuliaAstro/GeneralAstrodynamics.jl"
27+
Pkg.add([
28+
Pkg.PackageSpec(; url = repo, subdir = "lib/AstrodynamicalCalculations"),
29+
Pkg.PackageSpec(; url = repo, subdir = "lib/AstrodynamicalModels"),
30+
Pkg.PackageSpec(; url = repo, subdir = "lib/AstrodynamicalSolvers"),
31+
Pkg.PackageSpec(; url = repo),
32+
])
33+
@test Pkg.add(url = "https://github.com/JuliaAstro/GeneralAstrodynamics.jl") == nothing
34+
else
35+
@test Pkg.add(url = package.repo) == nothing
36+
end
1637
else
1738
throw(ArgumentError("`mode` argument to `test_packages` must be either `:release` or `:dev`."))
1839
end
1940
end
2041
end
2142

2243
@testset "Precompilation" begin
23-
@test Pkg.precompile(; strict=true) == nothing
44+
@test (Pkg.precompile(; strict = true); true)
2445
end
2546

2647
@testset "Package loading" begin
2748
for package in packages_juliaastro
2849
p_name = package.name
50+
if mode == :release && p_name ["ASDF.jl", "Spectra.jl", "GeneralAstrodynamics.jl"]
51+
continue
52+
end
2953
@info string("Loading: ", p_name)
3054
@testset "$(p_name)" begin
3155
@test eval(quote

0 commit comments

Comments
 (0)