Use Julia 1.11 for CI tests and docs#648
Use Julia 1.11 for CI tests and docs#648ferrolho wants to merge 4 commits intoJuliaRobotics:masterfrom
Conversation
|
|
||
| docs: | ||
| name: Documentation | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v2 | ||
| - uses: julia-actions/setup-julia@v1 | ||
| with: | ||
| version: '1.6' | ||
| - run: | | ||
| julia --project=docs -e ' | ||
| using Pkg | ||
| Pkg.develop(PackageSpec(path=pwd())) | ||
| Pkg.instantiate() | ||
| include("docs/make.jl")' | ||
| env: | ||
| PYTHON: "" | ||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| DOCUMENTER_KEY: ${{ secrets.DOCUMENTER_KEY }} |
There was a problem hiding this comment.
I have moved this into .github/workflows/Documentation.yml.
| - uses: actions/checkout@v4 | ||
| - uses: julia-actions/setup-julia@v2 | ||
| with: | ||
| version: '1.11' |
There was a problem hiding this comment.
Docs are now being built using Julia v1.11.
| if VERSION >= v"1.6" | ||
| push!(excludefiles, "6. Symbolics.jl") | ||
| push!(excludefiles, "7. Rigorous error bounds using IntervalArithmetic.jl") |
There was a problem hiding this comment.
This is a bit annoying... I have already spent a lot of time on this PR, but I haven't been able to fix the issues with these two notebooks.
ForUpdate: I have managed to get the6. Symbolics.jl, I am not sure how to fix it and there is an open issue for this (Symbolic Derivatives with SymPy do not work #630).6. Symbolics.jlexample notebook back up and running in 5155344.- For
7. Rigorous error bounds using IntervalArithmetic.jlI have already applied a few updates to use the new syntax and API of IntervalArithmetic.jl, but not all the cells of the notebook are fixed yet.
| ], | ||
| format = Documenter.HTML(prettyurls = parse(Bool, get(ENV, "CI", "false"))) | ||
| ], | ||
| warnonly = Documenter.except(), |
There was a problem hiding this comment.
I had to add this line warnonly = Documenter.except() because otherwise the build fails due to :missing_docs errors (which means not all docstrings are being used by the Docs).
| [[deps.MeshCatMechanisms]] | ||
| deps = ["ColorTypes", "CoordinateTransformations", "GeometryBasics", "InteractBase", "Interpolations", "LoopThrottle", "MechanismGeometries", "MeshCat", "OrderedCollections", "RigidBodyDynamics"] | ||
| git-tree-sha1 = "b766636d31175340e542c833cff1895c2f3f41cc" | ||
| git-tree-sha1 = "c6ca2052dc571cfe1395a12e970101c9356cf85f" | ||
| repo-rev = "hf/upstream-changes" | ||
| repo-url = "https://github.com/ferrolho/MeshCatMechanisms.jl.git" | ||
| uuid = "6ad125db-dd91-5488-b820-c1df6aab299d" | ||
| version = "0.9.0" | ||
| version = "0.9.1" |
There was a problem hiding this comment.
The Manifest.toml files of the notebooks need to be generated again after JuliaRobotics/MeshCatMechanisms.jl#71 has been merged. Right now, they are referring to the PR branch from my fork.
| include("test_pd_control.jl") | ||
|
|
||
| if v"1.9" <= VERSION < v"1.10" | ||
| if v"1.11" <= VERSION < v"1.12" # Test notebooks on Julia v1.11 |
There was a problem hiding this comment.
This is for running the notebook tests and benchmarks only on Julia v1.11 runners.
| repo = "github.com/JuliaRobotics/RigidBodyDynamics.jl.git" | ||
| repo="github.com/JuliaRobotics/RigidBodyDynamics.jl", | ||
| devbranch="master", | ||
| push_preview=true, |
There was a problem hiding this comment.
push_preview = true turned out to be useless for this PR because it only works for PRs originating from the same repo instead of from forked repositories — see this line of the job.
| ## Type piracy needed in order to make Symbolics.jl types interact well with Quaternions.jl. | ||
| ## This should be avoided — see https://docs.julialang.org/en/v1/manual/style-guide/#avoid-type-piracy. | ||
| function Base.:/(q::Quaternions.Quaternion, x::Symbolics.Num) | ||
| return Quaternions.Quaternion(q.s / x.val, q.v1 / x.val, q.v2 / x.val, q.v3 / x.val) | ||
| end |
There was a problem hiding this comment.
I took this from https://github.com/dionysos-dev/Dionysos.jl/blob/master/BipedRobot/src/piracy.jl to check if it would fix the issue in #630 and it did! So, we can close that issue when we merge this PR.
| try | ||
| ## This throws `ERROR: TypeError: non-boolean (Num) used in boolean context` because | ||
| ## of `m > 0 || return zero(cache_eltype(state))` in `gravitational_potential_energy`. | ||
| ## See https://docs.sciml.ai/Symbolics/stable/manual/faq/ for more details. | ||
| simplify(gravitational_potential_energy(x), expand=true) | ||
| catch e | ||
| e | ||
| end |
There was a problem hiding this comment.
This cell is not working because of the short-circuiting on this line:
RigidBodyDynamics.jl/src/mechanism_state.jl
Line 900 in d6df4eb
I tried removing the short-circuiting statement and it seems to fix it, but the repercussions of doing that are not clear to me. I am afraid that not having the early return might affect performance somehow, but on the other hand I could not see it being used as part of other methods...
@tkoolen would be the best person to chip in. 😛
This PR is for using Julia 1.11 for CI tests and docs.
I have tested it locally and the pipelines below also seem to be happy. 🎉
Important
There's something missing from this PR that I cannot fix myself because it has to do with the repo settings regarding the secret keys for Documenter.jl (this) and the GitHub action that deploys the documentation after it has been built. You can see the error from the last deploy attempt here (or pasted below) — FYI @tkoolen @rdeits.
Here's how to build the docs and serve them locally:
I keep forgetting this and have to check it every time I do maintenance on documentation of Julia packages, so I am writing this here mostly for my future reference... 😛