Skip to content

Commit

Permalink
CI update for 1.10 and 1.11
Browse files Browse the repository at this point in the history
  • Loading branch information
Liozou committed Jan 16, 2024
1 parent 10b84c0 commit 5708e01
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
matrix:
version:
- '1.6'
- '1.9'
- '1.10'
- 'nightly'
os:
- ubuntu-latest
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 7 additions & 1 deletion src/executable.jl
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,12 @@ function split_clusterings(s)
end
end

@static if VERSION < v"1.11-"
macro main()
:main
end
end

"""
main(ARGS)
Expand All @@ -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
Expand Down
8 changes: 6 additions & 2 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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: ")
Expand All @@ -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"
Expand Down Expand Up @@ -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)
Expand All @@ -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)
Expand Down

0 comments on commit 5708e01

Please sign in to comment.