Skip to content

Commit 954f4e1

Browse files
committed
Require Julia 1.9
1 parent c19b19a commit 954f4e1

8 files changed

Lines changed: 76 additions & 69 deletions

File tree

.coverage/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
*.info

.github/workflows/CI.yml

Lines changed: 52 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -1,51 +1,58 @@
11
name: CI
22
on:
3-
- push
4-
- pull_request
3+
push:
4+
branches:
5+
- master
6+
- 'release-*'
7+
tags:
8+
- '*'
9+
pull_request:
10+
branches:
11+
- master
512
env:
613
GKSwstype: 100
714
JULIA_PKG_PRECOMPILE_AUTO: false
815
jobs:
916
test:
10-
name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }} - ${{ github.event_name }}
17+
name: Test ${{ matrix.title }}
1118
runs-on: ${{ matrix.os }}
1219
strategy:
1320
fail-fast: false
1421
matrix:
15-
version:
16-
- '1.6'
17-
os:
18-
- ubuntu-latest
19-
arch:
20-
- x64
22+
include:
23+
- title: 'Linux - Latest'
24+
os: ubuntu-latest
25+
version: '1'
2126
steps:
22-
- uses: actions/checkout@v3
27+
- uses: actions/checkout@v4
2328
- uses: julia-actions/setup-julia@v1
2429
with:
2530
version: ${{ matrix.version }}
26-
arch: ${{ matrix.arch }}
2731
- uses: julia-actions/cache@v1
28-
- run: |
29-
# Instantiate Pkg
32+
- name: "Instantiate test environment"
33+
run: |
3034
wget https://raw.githubusercontent.com/JuliaQuantumControl/JuliaQuantumControl/master/scripts/installorg.jl
3135
julia --project=test installorg.jl
32-
- run: |
33-
# Run tests
34-
julia --project=test --color=auto --startup-file=yes --code-coverage="user" --depwarn="yes" --check-bounds="yes" -e 'include("test/runtests.jl")'
35-
- run: |
36-
# Run downstream "Krotov" tests
37-
julia --project=test -e '
38-
using Pkg
39-
Pkg.test("Krotov", coverage=true)'
40-
- run: |
41-
# Run downstream "GRAPE" tests
42-
julia --project=test -e '
43-
using Pkg
44-
Pkg.test("GRAPE", coverage=true)'
36+
- name: "Run tests"
37+
shell: julia --color=yes --project=test --code-coverage="@" --depwarn="yes" --check-bounds="yes" {0}
38+
run: |
39+
include(joinpath(pwd(), "test", "runtests.jl"))
40+
- name: "Run downstream Krotov tests"
41+
shell: julia --color=yes --project=test --code-coverage="@" --depwarn="yes" --check-bounds="yes" {0}
42+
run: |
43+
import Krotov
44+
include(pkgdir(Krotov, "test", "runtests.jl"))
45+
- name: "Run downstream GRAPE tests"
46+
shell: julia --color=yes --project=test --code-coverage="@" --depwarn="yes" --check-bounds="yes" {0}
47+
run: |
48+
import GRAPE
49+
include(pkgdir(GRAPE, "test", "runtests.jl"))
50+
- name: "Summarize coverage"
51+
shell: julia --project=test {0}
52+
run: |
53+
using QuantumControlTestUtils
54+
show_coverage()
4555
- uses: julia-actions/julia-processcoverage@v1
46-
- run: |
47-
# Summarize coverage
48-
julia --project=test -e 'using QuantumControlTestUtils; show_coverage();'
4956
- uses: codecov/codecov-action@v3
5057
with:
5158
files: lcov.info
@@ -55,36 +62,27 @@ jobs:
5562
permissions:
5663
contents: write
5764
steps:
58-
- uses: actions/checkout@v3
65+
- uses: actions/checkout@v4
5966
- uses: julia-actions/setup-julia@v1
6067
with:
6168
version: '1'
6269
- run: |
6370
# Install Python dependencies
6471
set -x
6572
/usr/bin/python3 -m pip install zip-files
66-
- run: |
73+
- name: "Instantiate test environment"
74+
run: |
6775
# Instantiate Pkg
6876
wget https://raw.githubusercontent.com/JuliaQuantumControl/JuliaQuantumControl/master/scripts/installorg.jl
6977
install -m 600 -D /dev/null ~/.ssh/known_hosts
7078
ssh-keyscan -H github.com > ~/.ssh/known_hosts
7179
julia --project=test -e 'include("installorg.jl"); installorg(; github="develop")'
7280
# installing in develop mode enables proper "source" links in subpackage APIs
73-
- run: cp test/*.toml docs/ # Prepare DrWatson
74-
- run: |
75-
# Run doctests
76-
julia --project=test -e '
77-
using Documenter: DocMeta, doctest
78-
using QuantumControl
79-
DocMeta.setdocmeta!(QuantumControl, :DocTestSetup, :(using QuantumControl); recursive=true)
80-
doctest(QuantumControl)'
81-
- run: |
82-
# Make documentation
83-
julia --project=test docs/make.jl
81+
- name: "Build documentation"
82+
run: julia --project=test docs/make.jl
8483
env:
8584
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
8685
DOCUMENTER_KEY: ${{ secrets.DOCUMENTER_KEY }}
87-
JULIA_DEBUG: Documenter
8886
- name: Zip the HTML documentation
8987
run: zip-folder --debug --auto-root --outfile "docs.zip" docs/build
9088
- uses: actions/upload-artifact@v3
@@ -100,27 +98,26 @@ jobs:
10098
name: Codestyle
10199
runs-on: ubuntu-latest
102100
steps:
103-
- uses: actions/checkout@v3
101+
- uses: actions/checkout@v4
104102
- uses: julia-actions/setup-julia@v1
105103
with:
106104
version: '1'
107105
- name: Get codestyle settings
108106
run: wget https://raw.githubusercontent.com/JuliaQuantumControl/JuliaQuantumControl/master/.JuliaFormatter.toml
109107
- name: Install JuliaFormatter and format
110-
# This will use the latest version by default but you can set the version like so:
111-
#
112-
# julia -e 'using Pkg; Pkg.add(PackageSpec(name="JuliaFormatter", version="0.13.0"))'
108+
shell: julia {0}
113109
run: |
114-
julia -e 'using Pkg; Pkg.add(PackageSpec(name="JuliaFormatter"))'
115-
julia -e 'using JuliaFormatter; format(".", verbose=true)'
116-
- name: Format check
110+
using Pkg
111+
Pkg.add(PackageSpec(name="JuliaFormatter"))
112+
using JuliaFormatter
113+
format(".", verbose=true)
114+
- name: Format Check
115+
shell: julia {0}
117116
run: |
118-
julia -e '
119-
out = Cmd(`git diff --name-only`) |> read |> String
117+
out = Cmd(`git diff -U0`) |> read |> String
120118
if out == ""
121119
exit(0)
122120
else
123-
@error "Some files have not been formatted !!!"
124-
write(stdout, out)
121+
@error "Some files have not been formatted !!!\n\n$out"
125122
exit(1)
126-
end'
123+
end

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,4 @@ Krotov = ">=0.5.3"
2626
QuantumControlBase = ">=0.8.3"
2727
QuantumPropagators = ">=0.6.0"
2828
Zygote = "0.6"
29-
julia = "1.6"
29+
julia = "1.9"

docs/generate_api.jl

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,13 @@ function get_local_members(pkg; all=true)
2323
]
2424
end
2525

26-
_parentmodule(m, pkg) = parentmodule(m)
27-
_parentmodule(m::Number, pkg) = pkg
26+
function _parentmodule(m, pkg)
27+
try
28+
parentmodule(m)
29+
catch
30+
return pkg
31+
end
32+
end
2833

2934

3035
"""Return a list of symbols for all the sub-modules of `pkg`.

docs/make.jl

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ using QuantumControl.Functionals
88
using QuantumControl.Generators
99
using Pkg
1010
using Documenter
11-
using QuantumCitations
11+
using DocumenterCitations
1212

1313
DocMeta.setdocmeta!(QuantumControl, :DocTestSetup, :(using QuantumControl); recursive=true)
1414

@@ -24,9 +24,8 @@ include("generate_api.jl")
2424

2525
bib = CitationBibliography(joinpath(@__DIR__, "src", "refs.bib"); style=:numeric)
2626

27-
makedocs(
28-
bib;
29-
strict=("CI" in keys(ENV)),
27+
makedocs(;
28+
plugins=[bib],
3029
authors=AUTHORS,
3130
sitename="QuantumControl.jl",
3231
format=Documenter.HTML(;

test/Project.toml

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,34 +7,39 @@ CSVFiles = "5d742f6a-9f54-50ce-8119-2520741973ca"
77
Coverage = "a2441757-f6aa-5fb2-8edb-039e3f45d037"
88
DataFrames = "a93c6f00-e57d-5684-b7b6-d8193f3e46c0"
99
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
10-
DocumenterTools = "35a29f4d-8980-5a13-9543-d66fff28ecb8"
10+
DocumenterCitations = "daee34ce-89f3-4625-b898-19384cb65244"
1111
Downloads = "f43a241f-c20a-4ad4-852c-f6b1247861c6"
1212
GRAPE = "6b52fcaf-80fe-489a-93e9-9f92080510be"
1313
GRAPELinesearchAnalysis = "290eba36-e2d8-4488-81b6-f66cc44f2186"
1414
IOCapture = "b5f81e59-6552-4d32-b1f0-c071b021bf89"
1515
JLD2 = "033835bb-8acc-5ee8-8aae-3f567f8a3819"
1616
JuliaFormatter = "98e50ef6-434e-11e9-1051-2b60c6c9e899"
1717
Krotov = "b05dcdc7-62f6-4360-bf2c-0898bba419de"
18+
LBFGSB = "5be7bae1-8223-5378-bac3-9e7378a2f6e6"
19+
LineSearches = "d3d80556-e9d4-5f37-9878-2ab0fcc64255"
1820
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
1921
Literate = "98b081ad-f1c9-55d3-8b20-4c87d4299306"
2022
LiveServer = "16fef848-5104-11e9-1b77-fb7a48bbb589"
2123
LocalCoverage = "5f6e1e16-694c-5876-87ef-16b5274f298e"
24+
Optim = "429524aa-4258-5aef-a3af-852621145aeb"
25+
Pkg = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f"
2226
Plots = "91a5bcdd-55d7-5caf-9e0b-520d859cae80"
23-
QuantumCitations = "259add83-af3e-4603-9706-50e341d5574e"
27+
Printf = "de0858da-6303-5e67-8744-51eddeeeb8d7"
2428
QuantumControl = "8a270532-f23f-47a8-83a9-b33d10cad486"
2529
QuantumControlBase = "f10a33bc-5a64-497c-be7b-6f86b4f0c2aa"
2630
QuantumControlTestUtils = "d3fd27c9-1dfb-4e67-b0c0-90d0d87a1e48"
2731
QuantumGradientGenerators = "a563f35e-61db-434d-8c01-8b9e3ccdfd85"
28-
QuantumOptics = "6e0679c1-51ea-5a7c-ac74-d61b76210b0c"
2932
QuantumPropagators = "7bf12567-5742-4b91-a078-644e72a65fc1"
3033
Reexport = "189a3867-3050-52da-a836-e630ba90ab69"
3134
Revise = "295af30f-e4ad-537b-8983-00126c2a3abe"
3235
SafeTestsets = "1bc83da4-3b8d-516f-aca4-4fe02f6d838f"
36+
SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf"
3337
StableRNGs = "860ef19b-820b-49d6-a774-d7a799459cd3"
34-
Term = "22787eb5-b846-44ae-b979-8e399b8463ab"
3538
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
3639
TwoQubitWeylChamber = "cad078a0-0012-46f4-b55e-a945d44e115b"
3740
UnicodePlots = "b8865327-cd53-5732-bb35-84acbb429228"
41+
Zygote = "e88e6eb3-aa80-5325-afca-941959d7151f"
3842

3943
[compat]
40-
julia = "1.6"
44+
julia = "1.9"
45+
Documenter = "1.1"

test/clean.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@ function clean(; distclean=false, _exit=true)
2929
append!(CLEAN, _glob(joinpath(ROOT, "docs", "src", "api"), ".md"))
3030
_push!(CLEAN, joinpath(ROOT, "coverage"))
3131
_push!(CLEAN, joinpath(ROOT, "docs", "build"))
32-
_push!(CLEAN, joinpath(ROOT, "lcov.info"))
32+
append!(CLEAN, _glob(ROOT, ".info"))
33+
append!(CLEAN, _glob(joinpath(ROOT, ".coverage"), ".info"))
3334
###########################################################################
3435

3536
###########################################################################

test/init.jl

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ unicodeplots()
55
using JuliaFormatter
66
using QuantumControlTestUtils: test, show_coverage, generate_coverage_html
77
using LiveServer: LiveServer, serve, servedocs as _servedocs
8-
using Term
98
include(joinpath(@__DIR__, "clean.jl"))
109

1110
function servedocs(; kwargs...)

0 commit comments

Comments
 (0)