Skip to content
Merged
Show file tree
Hide file tree
Changes from 18 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 9 additions & 7 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
name: Test JuliaAstro
name: CI

on:
push:
branches: [main]
pull_request:
schedule:
- cron: '15 2 * * *' # 2:15 AM UTC every day
workflow_call:
inputs:
test_args:
required: true
type: string

jobs:
test:
name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }} - ${{ github.event_name }}
Expand All @@ -30,4 +31,5 @@ jobs:
- uses: julia-actions/julia-buildpkg@v1
- uses: julia-actions/julia-runtest@v1
with:
coverage: false
test_args: ${{ inputs.test_args }}
coverage: false
14 changes: 14 additions & 0 deletions .github/workflows/CI_dev.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: Test JuliaAstro (dev)

on:
push:
branches: [main]
pull_request:
schedule:
- cron: '15 2 * * *' # 2:15 AM UTC every day

jobs:
test-dev:
uses: ./.github/workflows/CI.yml
with:
test_args: "--verbose packages_dev"
14 changes: 14 additions & 0 deletions .github/workflows/CI_release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: Test JuliaAstro (release)

on:
push:
branches: [main]
pull_request:
schedule:
- cron: '15 2 * * 1' # 2:15 AM UTC every Monday

jobs:
test-release:
uses: ./.github/workflows/CI.yml
with:
test_args: "--verbose packages_release"
5 changes: 4 additions & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
name = "JuliaAstroDocs"
uuid = "5ba9df79-bc07-467f-bade-66a1d49082bd"

[workspace]
projects = ["test", "docs"]

[deps]
TypedTables = "9d95f2ec-7b3d-5a63-8d20-e2491e220bb9"

[compat]
TypedTables = "1.4.6"
julia = "1.6"
julia = "1.10"
31 changes: 28 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ JuliaAstro.github.io
[![docs](https://img.shields.io/badge/docs-stable-blue.svg)](https://juliaastro.org/)
[![Build](https://github.com/JuliaAstro/JuliaAstro.github.io/actions/workflows/Documentation.yml/badge.svg)](https://github.com/JuliaAstro/JuliaAstro.github.io/actions/workflows/Documentation.yml)
[![Deploy](https://github.com/JuliaAstro/JuliaAstro.github.io/actions/workflows/pages/pages-build-deployment/badge.svg?branch=gh-pages)](https://github.com/JuliaAstro/JuliaAstro.github.io/actions/workflows/pages/pages-build-deployment)
[![Test JuliaAstro](https://github.com/JuliaAstro/JuliaAstro.github.io/actions/workflows/CI.yml/badge.svg)](https://github.com/JuliaAstro/JuliaAstro.github.io/actions/workflows/CI.yml)

[![Test JuliaAstro (release)](https://github.com/JuliaAstro/JuliaAstro.github.io/actions/workflows/CI_release.yml/badge.svg)](https://github.com/JuliaAstro/JuliaAstro.github.io/actions/workflows/CI_release.yml)
[![Test JuliaAstro (dev)](https://github.com/JuliaAstro/JuliaAstro.github.io/actions/workflows/CI_dev.yml/badge.svg)](https://github.com/JuliaAstro/JuliaAstro.github.io/actions/workflows/CI_dev.yml)

## Description

Expand Down Expand Up @@ -98,12 +100,14 @@ All in all, to add a new case study:
1. Update the content in the new file with your case study text.
1. Add an entry to `JuliaAstro.github.io/docs/case_studies/<case study category>/config.json` with your new case study filename. Note that trailing commas are not supported in the JSON spec.

## Testing locally / developer docs
## Developer docs

### Documentation

Add [LiveServer.jl](https://github.com/JuliaDocs/LiveServer.jl) to your global env and then run the following in the `JuliaAstro.github.io/` folder:

```julia-repl
> julia --proj=docs/
julia --proj=docs/

julia> using LiveServer

Expand All @@ -117,3 +121,24 @@ The `include_dirs` arg allows our internal Revise worklow to pick up changes in

See our [Contributing page](https://juliaastro.org/home/#Contributing) for more.

### Testing

Run all tests:

```julia-repl
julia --proj

julia> ]

pkg> test
```

Run specific tests (currently `packages_release` and `packages_dev`):

```julia-repl
julia --proj

julia> import Pkg

julia> Pkg.test("JuliaAstroDocs"; test_args=`--verbose packages_release`) # or packages_dev
```
1 change: 0 additions & 1 deletion docs/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ MultiDocumenter = "87ed4bf0-c935-4a67-83c3-2a03bee4197c"
Revise = "295af30f-e4ad-537b-8983-00126c2a3abe"

[sources]
JuliaAstroDocs = {path = ".."}
MultiDocumenter = {url = "https://github.com/JuliaComputing/MultiDocumenter.jl"}

[compat]
Expand Down
4 changes: 1 addition & 3 deletions test/Project.toml
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
[deps]
InteractiveUtils = "b77e0a4c-d291-57a0-90e8-8db25a27a240"
JuliaAstroDocs = "5ba9df79-bc07-467f-bade-66a1d49082bd"
ParallelTestRunner = "d3525ed8-44d0-4b2c-a655-542cee43accc"
Pkg = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

[sources]
JuliaAstroDocs = {path = ".."}
36 changes: 36 additions & 0 deletions test/_packages.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
function test_packages(mode)
@testset "Compatibility - $(mode)" begin
for package in packages_juliaastro
p_name = package.name
@info string("Adding: ", p_name)
@testset "$(p_name)" begin
if mode == :release
if p_name == "Spectra.jl"
# TODO: Register
@test Pkg.add(url="https://github.com/JuliaAstro/Spectra.jl") == nothing
else
@test Pkg.add(chopsuffix(p_name, ".jl")) == nothing
end
else
@test Pkg.add(url=package.repo) == nothing
end
end
end

@testset "Precompilation" begin
@test Pkg.precompile(; strict=true) == nothing
end

@testset "Package loading" begin
for package in packages_juliaastro
p_name = package.name
@info string("Loading: ", p_name)
@testset "$(p_name)" begin
@test eval(quote
@time_imports using $(Symbol(chopsuffix(p_name, ".jl")))
end) == nothing
end
end
end
end
end
3 changes: 3 additions & 0 deletions test/packages_dev.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
include("_packages.jl")

test_packages(:dev)
3 changes: 3 additions & 0 deletions test/packages_release.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
include("_packages.jl")

test_packages(:release)
61 changes: 17 additions & 44 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -4,54 +4,27 @@ This file defines integration tests for the JuliaAstro package ecosystem.
These are tests that confirm various packages can be installed and work together.
=#

using Test, Pkg, InteractiveUtils

using ParallelTestRunner: runtests, find_tests, parse_args
import JuliaAstroDocs

ecosystem_t = JuliaAstroDocs.ecosystem_t()

packages_juliaastro = filter(ecosystem_t) do package
occursin("juliaastro", lowercase(package.repo))
end
unique!(p -> p.name, packages_juliaastro)
sort!(packages_juliaastro)

@testset "JuliaAstro Package Evalauation" begin
@testset "Compatible versions exist" begin
ENV["JULIA_PKG_PRECOMPILE_AUTO"] = 0
for package in packages_juliaastro
p_name = package.name
@testset "$(p_name)" begin
if p_name == "Spectra.jl"
@test Pkg.add(url="https://github.com/JuliaAstro/Spectra.jl") == nothing
else
@test Pkg.add(chopsuffix(p_name, ".jl")) == nothing
end
end
end
end
const init_code = quote
# Start by testing that we can install all packages
# Worry if they compile successfully after
ENV["JULIA_PKG_PRECOMPILE_AUTO"] = 0

@testset "Development versions compatible" begin
# Start by testing that we can install all packages
# Worry if they compile successfully after
ENV["JULIA_PKG_PRECOMPILE_AUTO"] = 0
import Pkg
using JuliaAstroDocs: ecosystem_t
using InteractiveUtils: @time_imports

for package in packages_juliaastro
@testset "$(package.name)" begin
@test Pkg.add(url=package.repo) == nothing
end
end
packages_juliaastro = filter(ecosystem_t()) do package
occursin("juliaastro", lowercase(package.repo))
end
unique!(p -> p.name, packages_juliaastro)
sort!(packages_juliaastro)
end

@testset "Precompilation" begin
@test Pkg.precompile(; strict=true) == nothing
end
args = parse_args(Base.ARGS)
testsuite = find_tests(@__DIR__)
delete!(testsuite, "_packages")

@testset "Package loading" begin
for package in packages_juliaastro
@test eval(quote
@time_imports using $(Symbol(chopsuffix(package.name, ".jl")))
end) == nothing
end
end
end
runtests(JuliaAstroDocs, args; testsuite, init_code)
Loading