@@ -25,15 +25,15 @@ jobs:
2525 os : ubuntu-latest
2626 version : ' 1'
2727 steps :
28- - uses : actions/checkout@v4
29- - uses : julia-actions/setup-julia@v2
28+ - uses : actions/checkout@v6
29+ - uses : julia-actions/setup-julia@v3
3030 with :
3131 version : ${{ matrix.version }}
32- - uses : julia-actions/cache@v2
32+ - uses : julia-actions/cache@v3
3333 - name : " Instantiate test environment"
3434 run : |
3535 wget https://raw.githubusercontent.com/JuliaQuantumControl/JuliaQuantumControl/master/scripts/installorg.jl
36- julia --project=test installorg.jl
36+ julia --project=test installorg.jl --no-precompile
3737 - name : " Run tests"
3838 shell : julia --color=yes --project=test --code-coverage="@" --depwarn="yes" --check-bounds="yes" {0}
3939 run : |
@@ -46,35 +46,35 @@ jobs:
4646 - uses : julia-actions/julia-processcoverage@v1
4747 - name : " Summarize coverage"
4848 run : julia --project=test -e 'using QuantumControlTestUtils; show_coverage();'
49- - uses : codecov/codecov-action@v4
49+ - uses : codecov/codecov-action@v7
5050 with :
5151 files : lcov.info
5252 token : ${{ secrets.CODECOV_TOKEN }}
5353 docs :
5454 name : Documentation
5555 runs-on : ubuntu-latest
5656 steps :
57- - uses : actions/checkout@v4
58- - uses : julia-actions/setup-julia@v2
57+ - uses : actions/checkout@v6
58+ - uses : julia-actions/setup-julia@v3
5959 with :
6060 version : ' 1'
61- - uses : julia-actions/cache@v2
61+ - uses : julia-actions/cache@v3
6262 - run : |
6363 # Install Python dependencies
6464 set -x
6565 /usr/bin/python3 -m pip install zip-files
6666 - name : Instantiate Pkg
6767 run : |
6868 wget https://raw.githubusercontent.com/JuliaQuantumControl/JuliaQuantumControl/master/scripts/installorg.jl
69- julia --project=test installorg.jl
69+ julia --project=docs installorg.jl
7070 - name : Make documentations
71- run : julia --project=test docs/make.jl
71+ run : julia --project=docs docs/make.jl
7272 env :
7373 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
7474 DOCUMENTER_KEY : ${{ secrets.DOCUMENTER_KEY }}
7575 - name : Zip the HTML documentation
7676 run : zip-folder --debug --auto-root --outfile "docs.zip" docs/build
77- - uses : actions/upload-artifact@v4
77+ - uses : actions/upload-artifact@v7
7878 name : Upload documentation artifacts
7979 with :
8080 name : QuantumGradientGenerators
@@ -87,27 +87,59 @@ jobs:
8787 name : Codestyle
8888 runs-on : ubuntu-latest
8989 steps :
90- - uses : actions/checkout@v4
91- - uses : julia-actions/setup-julia@v2
90+ - uses : actions/checkout@v6
91+ - uses : julia-actions/setup-julia@v3
9292 with :
9393 version : ' 1'
94+ - name : Get typos settings
95+ run : wget https://raw.githubusercontent.com/JuliaQuantumControl/JuliaQuantumControl/master/typos.toml
96+ - name : Spell Check
97+ uses : crate-ci/typos@master
98+ - name : Version Check
99+ shell : julia {0}
100+ run : |
101+ using Pkg
102+ VERSION = VersionNumber(Pkg.TOML.parsefile("Project.toml")["version"])
103+ BRANCH = ENV["GITHUB_REF_NAME"]
104+ if ENV["GITHUB_EVENT_NAME"] == "pull_request"
105+ # For pull_request events, return the head (aka., "from") branch,
106+ # not the base (aka., "to") branch.
107+ BRANCH = ENV["GITHUB_HEAD_REF"]
108+ end
109+ if startswith(BRANCH, "release-")
110+ if (length(VERSION.prerelease) == length(VERSION.build))
111+ println("Version $VERSION on release branch OK")
112+ else
113+ @error "Invalid version $VERSION on release branch"
114+ exit(1)
115+ end
116+ elseif (ENV["GITHUB_REF_TYPE"] == "branch") && (BRANCH != "master")
117+ if ("dev" in VERSION.prerelease) || ("dev" in VERSION.build)
118+ println("Version $VERSION OK with dev-suffix on $BRANCH")
119+ else
120+ @error "Invalid version $VERSION on branch $BRANCH: must contain dev suffix"
121+ exit(1)
122+ end
123+ else
124+ println("Version $VERSION OK on $BRANCH")
125+ end
126+ exit(0)
94127 - name : Get codestyle settings
95128 run : wget https://raw.githubusercontent.com/JuliaQuantumControl/JuliaQuantumControl/master/.JuliaFormatter.toml
96129 - name : Install JuliaFormatter and format
97- # This will use the latest version by default but you can set the version like so:
98- #
99- # julia -e 'using Pkg; Pkg.add(PackageSpec(name="JuliaFormatter", version="0.13.0"))'
130+ shell : julia {0}
100131 run : |
101- julia -e 'using Pkg; Pkg.add(PackageSpec(name="JuliaFormatter"))'
102- julia -e 'using JuliaFormatter; format(".", verbose=true)'
103- - name : Format check
132+ using Pkg
133+ Pkg.add(PackageSpec(name="JuliaFormatter", version="2.3.0"))
134+ using JuliaFormatter
135+ format(".", verbose=true)
136+ - name : Format Check
137+ shell : julia {0}
104138 run : |
105- julia -e '
106- out = Cmd(`git diff --name-only`) |> read |> String
139+ out = Cmd(`git diff -U0`) |> read |> String
107140 if out == ""
108141 exit(0)
109142 else
110- @error "Some files have not been formatted !!!"
111- write(stdout, out)
143+ @error "Some files have not been formatted !!!\n\n$out"
112144 exit(1)
113- end'
145+ end
0 commit comments