11name : CI
22on :
3- - push
4- - pull_request
3+ push :
4+ branches :
5+ - master
6+ - ' release-*'
7+ tags :
8+ - ' *'
9+ pull_request :
10+ branches :
11+ - master
512env :
613 GKSwstype : 100
714 JULIA_PKG_PRECOMPILE_AUTO : false
815jobs :
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
0 commit comments