From 5708e01ff721e21329c47d1546c8f2b12076ce48 Mon Sep 17 00:00:00 2001 From: Lionel Zoubritzky Date: Tue, 16 Jan 2024 15:08:56 +0100 Subject: [PATCH] CI update for 1.10 and 1.11 --- .github/workflows/CI.yml | 2 +- .github/workflows/documentation.yml | 2 +- src/executable.jl | 8 +++++++- test/runtests.jl | 8 ++++++-- 4 files changed, 15 insertions(+), 5 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 32f57bd..ebb93e3 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -18,7 +18,7 @@ jobs: matrix: version: - '1.6' - - '1.9' + - '1.10' - 'nightly' os: - ubuntu-latest diff --git a/.github/workflows/documentation.yml b/.github/workflows/documentation.yml index 489f040..dbc6880 100644 --- a/.github/workflows/documentation.yml +++ b/.github/workflows/documentation.yml @@ -14,7 +14,7 @@ jobs: - uses: actions/checkout@v2 - uses: julia-actions/setup-julia@latest with: - version: '1.9' + version: '1.10' - name: Install dependencies run: julia --project=docs/ -e 'using Pkg; Pkg.develop(PackageSpec(path=pwd())); Pkg.instantiate()' - name: Build and deploy diff --git a/src/executable.jl b/src/executable.jl index 3fb0efc..cf50b4e 100644 --- a/src/executable.jl +++ b/src/executable.jl @@ -240,6 +240,12 @@ function split_clusterings(s) end end +@static if VERSION < v"1.11-" + macro main() + :main + end +end + """ main(ARGS) @@ -253,7 +259,7 @@ Return code can be: * 4: internal CrystalNets.jl error * 5: unhandled CrystalNets.jl error, please report """ -function main(args) +function (@main)(args) try _parsed_args = parse_commandline(args) if _parsed_args isa Int diff --git a/test/runtests.jl b/test/runtests.jl index e02aec4..bd60429 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -44,7 +44,7 @@ import CrystalNets.Clustering: SingleNodes, AllNodes, Standard, PE, PEM @testset "MOF examples" begin cifs, crystalnetsdir = _finddirs() kwargs = (; structure=StructureType.MOF, clusterings=[Clustering.Auto,Standard,PE,PEM]) - println(stderr, "The following warning about altering performance is expected") + println(stderr, "The following warning about altering performance, the two messages on warning toggling and the three error statements are expected.") mofdataset = determine_topology_dataset(joinpath(cifs, "MOFs"), false; kwargs...) @testset "Dataset analysis" begin @@ -135,6 +135,8 @@ import CrystalNets.Clustering: SingleNodes, AllNodes, Standard, PE, PEM @test wemfif[PE].name == "crs" CrystalNets.toggle_warning(true) + println(stderr, "The following warning about symmetry and the three warnings about 0-dimensional structures are expected.") + # test cell minimization with collision nodes nott112 = extract1(determine_topology(joinpath(cifs, "NOTT-112.cif"); kwargs..., bonding=Bonding.Input)) @test startswith(string(nott112), "AllNodes, PEM: ntt\nSingleNodes, Standard: nts\nPE: ") @@ -147,7 +149,7 @@ import CrystalNets.Clustering: SingleNodes, AllNodes, Standard, PE, PEM calfig = extract1(determine_topology(joinpath(cifs, "CALFIG.cif"); kwargs..., clusterings=[Clustering.Auto])) @test string(calfig) == "non-periodic" - println(stderr, "The following @error about carbon cycle disorder is expected") + println(stderr, "The following @error about carbon cycle disorder is expected.") # Test carbon cycle disorder detection cizpos = extract1(determine_topology(joinpath(cifs, "CIZPOS.cif"); kwargs..., clusterings=[Clustering.Auto], bonding=Bonding.Guess)) @test string(cizpos) == "AllNodes: fof\nSingleNodes: nbo" @@ -352,6 +354,7 @@ end @test result == 0 @test written == ["gis, GIS"] + #= FIXME: https://github.com/carlobaldassi/ArgParse.jl/pull/128 empty!(ARGS) push!(ARGS, "--help") result, written = capture_out(out) @@ -364,6 +367,7 @@ end @test isempty(popfirst!(written)) @test isempty(popfirst!(written)) @test popfirst!(written) == "Automatic recognition of crystal net topologies." + =# empty!(ARGS) append!(ARGS, safeARGS)