Skip to content

Commit c5bd67b

Browse files
committed
Update dev-tooling
1 parent 9bc806a commit c5bd67b

7 files changed

Lines changed: 107 additions & 27 deletions

File tree

.github/dependabot.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
2+
version: 2
3+
updates:
4+
- package-ecosystem: "github-actions"
5+
directory: "/" # Location of package manifests
6+
schedule:
7+
interval: "weekly"

.github/workflows/CI.yml

Lines changed: 56 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -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

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,6 @@
33
*.jl.mem
44
Manifest.toml
55
/docs/build/
6+
/gh-pages/
7+
/.JuliaFormatter.toml
8+
/lcov.info

CONTRIBUTING.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Contributing
2+
3+
Everyone is welcome to contribute! You can contribute simply by opening issues to report bugs or request features.
4+
5+
Development of all packages in the [JuliaQuantumControl] organization follows shared contributing guidelines. Please refer to these for instructions on reporting issues, making pull requests, running the tests, building the documentation, code formatting, the changelog, and the release process:
6+
7+
<https://github.com/JuliaQuantumControl/.github/blob/master/CONTRIBUTING.md>
8+
9+
[JuliaQuantumControl]: https://github.com/JuliaQuantumControl

Makefile

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,12 @@ devrepl: ## Start an interactive REPL for testing and building documentation
3535
$(JULIA) --project=test --banner=no --startup-file=yes -i devrepl.jl
3636

3737

38-
docs: test/Manifest.toml ## Build the documentation
39-
$(JULIA) --project=test docs/make.jl
38+
docs/Manifest.toml: docs/Project.toml ../scripts/installorg.jl
39+
$(JULIA) --project=docs ../scripts/installorg.jl
40+
@touch $@
41+
42+
docs: docs/Manifest.toml ## Build the documentation
43+
$(JULIA) --project=docs docs/make.jl
4044
@echo "Done. Consider using 'make devrepl'"
4145

4246
servedocs: test/Manifest.toml ## Build (auto-rebuild) and serve documentation at PORT=8000
@@ -45,7 +49,16 @@ servedocs: test/Manifest.toml ## Build (auto-rebuild) and serve documentation a
4549
clean: ## Clean up build/doc/testing artifacts
4650
$(JULIA) -e 'include("test/clean.jl"); clean()'
4751

48-
codestyle: test/Manifest.toml ../.JuliaFormatter.toml ## Apply the codestyle to the entire project
52+
.JuliaFormatter.toml:
53+
@if [ -e ../.JuliaFormatter.toml ]; then \
54+
ln -sf ../.JuliaFormatter.toml .JuliaFormatter.toml; \
55+
echo "Linked to ../.JuliaFormatter.toml"; \
56+
else \
57+
curl -fsSL -o .JuliaFormatter.toml https://raw.githubusercontent.com/JuliaQuantumControl/JuliaQuantumControl/refs/heads/master/.JuliaFormatter.toml; \
58+
echo "Downloaded .JuliaFormatter.toml from JuliaQuantumControl repository"; \
59+
fi
60+
61+
codestyle: test/Manifest.toml .JuliaFormatter.toml ## Apply the codestyle to the entire project
4962
$(JULIA) --project=test -e 'using JuliaFormatter; format(".", verbose=true)'
5063
@echo "Done. Consider using 'make devrepl'"
5164

docs/Project.toml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
[deps]
2+
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
3+
DocumenterInterLinks = "d12716ef-a0f6-4df4-a9f1-a5a34e75c656"
4+
Pkg = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f"
5+
QuantumControl = "8a270532-f23f-47a8-83a9-b33d10cad486"
6+
QuantumGradientGenerators = "a563f35e-61db-434d-8c01-8b9e3ccdfd85"
7+
QuantumPropagators = "7bf12567-5742-4b91-a078-644e72a65fc1"
8+
9+
[sources]
10+
QuantumGradientGenerators = {path = ".."}
11+
12+
[compat]
13+
Documenter = "1.4"
14+
DocumenterInterLinks = "1.1"
15+
julia = "1.11"

test/Project.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,5 @@ Zygote = "e88e6eb3-aa80-5325-afca-941959d7151f"
2929

3030
[compat]
3131
Documenter = "1.1"
32+
JuliaFormatter = "=2.3.0"
3233
julia = "1.9"

0 commit comments

Comments
 (0)