Skip to content

Commit c9f57e4

Browse files
committed
Use a docs environment
This should decrease the time required to build the docs on CI, and follows the "best practices" that e.g., JuliaHub expects.
1 parent faa8cb0 commit c9f57e4

7 files changed

Lines changed: 45 additions & 13 deletions

File tree

.github/workflows/CI.yml

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -48,18 +48,21 @@ jobs:
4848
run: |
4949
import GRAPE
5050
include(pkgdir(GRAPE, "test", "runtests.jl"))
51-
- name: "Summarize coverage"
52-
shell: julia --project=test {0}
53-
run: |
54-
using QuantumControlTestUtils
55-
show_coverage()
5651
- uses: julia-actions/julia-processcoverage@v1
5752
- name: "Summarize coverage"
5853
run: julia --project=test -e 'using QuantumControlTestUtils; show_coverage();'
5954
- uses: codecov/codecov-action@v5
6055
with:
6156
files: lcov.info
6257
token: ${{ secrets.CODECOV_TOKEN }}
58+
- name: Save Julia depot cache on cancel or failure
59+
id: julia-cache-save
60+
if: cancelled() || failure()
61+
uses: actions/cache/save@v4
62+
with:
63+
path: |
64+
${{ steps.julia-cache.outputs.cache-paths }}
65+
key: ${{ steps.julia-cache.outputs.cache-key }}
6366
docs:
6467
name: Documentation
6568
runs-on: ubuntu-latest
@@ -78,10 +81,10 @@ jobs:
7881
wget https://raw.githubusercontent.com/JuliaQuantumControl/JuliaQuantumControl/master/scripts/installorg.jl
7982
install -m 600 -D /dev/null ~/.ssh/known_hosts
8083
ssh-keyscan -H github.com > ~/.ssh/known_hosts
81-
julia --project=test -e 'include("installorg.jl"); installorg(; github="develop")'
84+
julia --project=docs -e 'include("installorg.jl"); installorg(; github="develop")'
8285
# installing in develop mode enables proper "source" links in subpackage APIs
8386
- name: "Build documentation"
84-
run: julia --project=test docs/make.jl
87+
run: julia --project=docs docs/make.jl
8588
env:
8689
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
8790
DOCUMENTER_KEY: ${{ secrets.DOCUMENTER_KEY }}
@@ -96,6 +99,14 @@ jobs:
9699
path: |
97100
README.md
98101
./docs.zip
102+
- name: Save Julia depot cache on cancel or failure
103+
id: julia-cache-save
104+
if: cancelled() || failure()
105+
uses: actions/cache/save@v4
106+
with:
107+
path: |
108+
${{ steps.julia-cache.outputs.cache-paths }}
109+
key: ${{ steps.julia-cache.outputs.cache-key }}
99110
codestyle:
100111
name: Codestyle
101112
runs-on: ubuntu-latest

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
/Manifest.toml
55
/test/Manifest.toml
66
/docs/Manifest.toml
7-
/docs/Project.toml
87
/docs/build/
98
/gh-pages/
109
/.JuliaFormatter.toml

Makefile

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,16 @@ test/Manifest.toml: test/Project.toml ../scripts/installorg.jl
3030
$(JULIA) --project=test ../scripts/installorg.jl
3131
@touch $@
3232

33+
docs/Manifest.toml: docs/Project.toml ../scripts/installorg.jl
34+
$(JULIA) --project=docs ../scripts/installorg.jl
35+
@touch $@
3336

3437
devrepl: ## Start an interactive REPL for testing and building documentation
3538
$(JULIA) --project=test --banner=no --startup-file=yes -i devrepl.jl
3639

3740

38-
docs: test/Manifest.toml ## Build the documentation
39-
$(JULIA) --project=test docs/make.jl
41+
docs: docs/Manifest.toml ## Build the documentation
42+
$(JULIA) --project=docs docs/make.jl
4043
@echo "Done. Consider using 'make devrepl'"
4144

4245
servedocs: test/Manifest.toml ## Build (auto-rebuild) and serve documentation at PORT=8000

docs/Project.toml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
[deps]
2+
DocInventories = "43dc2714-ed3b-44b5-b226-857eda1aa7de"
3+
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
4+
DocumenterCitations = "daee34ce-89f3-4625-b898-19384cb65244"
5+
DocumenterInterLinks = "d12716ef-a0f6-4df4-a9f1-a5a34e75c656"
6+
GRAPE = "6b52fcaf-80fe-489a-93e9-9f92080510be"
7+
Krotov = "b05dcdc7-62f6-4360-bf2c-0898bba419de"
8+
OrdinaryDiffEq = "1dea7af3-3e70-54e6-95c3-0bf5283fa5ed"
9+
QuantumControl = "8a270532-f23f-47a8-83a9-b33d10cad486"
10+
QuantumPropagators = "7bf12567-5742-4b91-a078-644e72a65fc1"
11+
12+
[sources]
13+
QuantumControl = {path = ".."}
14+
15+
[compat]
16+
Documenter = "1.4"
17+
julia = "1.11"

docs/make.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
using Pkg
2+
Pkg.develop(path=joinpath(@__DIR__, ".."))
23

34
using Documenter
45
using QuantumPropagators
@@ -128,5 +129,4 @@ makedocs(;
128129
)
129130

130131
println("Finished makedocs")
131-
132-
deploydocs(; repo="github.com/JuliaQuantumControl/QuantumControl.jl")
132+
deploydocs(; repo="github.com/JuliaQuantumControl/QuantumControl.jl", push_preview=true)

test/Project.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,9 @@ UnPack = "3a884ed6-31ef-47d7-9d2a-63182c4928ed"
4848
UnicodePlots = "b8865327-cd53-5732-bb35-84acbb429228"
4949
Zygote = "e88e6eb3-aa80-5325-afca-941959d7151f"
5050

51+
[sources]
52+
QuantumControl = {path = ".."}
53+
5154
[compat]
5255
Documenter = "1.4"
5356
julia = "1.9"

test/clean.jl

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ function clean(; distclean=false, _exit=true)
3838
for folder in ["", "docs", "test"]
3939
_push!(DISTCLEAN, joinpath(joinpath(ROOT, folder), "Manifest.toml"))
4040
end
41-
_push!(DISTCLEAN, joinpath(ROOT, "docs", "Project.toml"))
4241
_push!(DISTCLEAN, joinpath(ROOT, "docs", "src", "examples", ".ipynb_checkpoints"))
4342
_push!(DISTCLEAN, joinpath(ROOT, ".JuliaFormatter.toml"))
4443
###########################################################################

0 commit comments

Comments
 (0)