diff --git a/src/plugins/ci.jl b/src/plugins/ci.jl index 6986e0f..0f46ae7 100644 --- a/src/plugins/ci.jl +++ b/src/plugins/ci.jl @@ -394,6 +394,15 @@ This is useful for creating lists of versions to be included in CI configuration function collect_versions(t::Template, versions::Vector) custom = map(v -> v isa VersionNumber ? format_version(v) : string(v), versions) vs = map(v -> lstrip(v, 'v'), [format_version(t.julia); custom]) + filter!(vs) do v + # Throw away any versions lower than the template's minimum. + try + VersionNumber(v) >= t.julia + catch e + e isa ArgumentError || rethrow() + true + end + end return sort(unique(vs)) end diff --git a/test/fixtures/WackyOptions/.appveyor.yml b/test/fixtures/WackyOptions/.appveyor.yml index e4d10d1..1f220c3 100644 --- a/test/fixtures/WackyOptions/.appveyor.yml +++ b/test/fixtures/WackyOptions/.appveyor.yml @@ -1,7 +1,6 @@ # Documentation: https://github.com/JuliaCI/Appveyor.jl environment: matrix: - - julia_version: 1.1 - julia_version: 1.2 platform: - x64 diff --git a/test/fixtures/WackyOptions/.cirrus.yml b/test/fixtures/WackyOptions/.cirrus.yml index 10879bd..8f44759 100644 --- a/test/fixtures/WackyOptions/.cirrus.yml +++ b/test/fixtures/WackyOptions/.cirrus.yml @@ -5,8 +5,8 @@ task: artifacts_cache: folder: ~/.julia/artifacts env: - JULIA_VERSION: 1.1 JULIA_VERSION: 1.2 + JULIA_VERSION: 1.3 install_script: - sh -c "$(fetch https://raw.githubusercontent.com/ararslan/CirrusCI.jl/master/bin/install.sh -o -)" build_script: diff --git a/test/fixtures/WackyOptions/.drone.star b/test/fixtures/WackyOptions/.drone.star index 25ce631..addf3af 100644 --- a/test/fixtures/WackyOptions/.drone.star +++ b/test/fixtures/WackyOptions/.drone.star @@ -1,7 +1,7 @@ def main(ctx): pipelines = [] for arch in ["arm", "arm64"]: - for julia in ["1.1", "1.2"]: + for julia in ["1.2", "1.3"]: pipelines.append(pipeline(arch, julia)) return pipelines diff --git a/test/fixtures/WackyOptions/.github/workflows/ci.yml b/test/fixtures/WackyOptions/.github/workflows/ci.yml index b2c351d..6e3802e 100644 --- a/test/fixtures/WackyOptions/.github/workflows/ci.yml +++ b/test/fixtures/WackyOptions/.github/workflows/ci.yml @@ -9,7 +9,6 @@ jobs: strategy: matrix: version: - - '1.0' - '1.2' - '1.4' - 'nightly' diff --git a/test/fixtures/WackyOptions/.gitlab-ci.yml b/test/fixtures/WackyOptions/.gitlab-ci.yml index 0fc6bb9..257b83c 100644 --- a/test/fixtures/WackyOptions/.gitlab-ci.yml +++ b/test/fixtures/WackyOptions/.gitlab-ci.yml @@ -5,10 +5,6 @@ using Pkg Pkg.build() Pkg.test()' -Julia 0.6: - image: julia:0.6 - extends: - - .script Julia 1.2: image: julia:1.2 extends: diff --git a/test/fixtures/WackyOptions/.travis.yml b/test/fixtures/WackyOptions/.travis.yml index 48586f3..a1ad029 100644 --- a/test/fixtures/WackyOptions/.travis.yml +++ b/test/fixtures/WackyOptions/.travis.yml @@ -3,7 +3,6 @@ language: julia notifications: email: false julia: - - 1.1 - 1.2 os: - linux diff --git a/test/plugin.jl b/test/plugin.jl index 0918172..c87fc98 100644 --- a/test/plugin.jl +++ b/test/plugin.jl @@ -40,6 +40,13 @@ PT.user_view(::FileTest, ::Template, ::AbstractString) = Dict("X" => 1, "Z" => 3 @test_logs tpl(; julia=v"1.3", plugins=[p]) end + @testset "CI versions" begin + t = tpl(; julia=v"1") + @test PT.collect_versions(t, ["1.0", "1.5", "nightly"]) == ["1.0", "1.5", "nightly"] + t = tpl(; julia=v"2") + @test PT.collect_versions(t, ["1.0", "1.5", "nightly"]) == ["2.0", "nightly"] + end + @testset "Equality" begin a = FileTest("foo", true) b = FileTest("foo", true) diff --git a/test/reference.jl b/test/reference.jl index 948aae7..8491626 100644 --- a/test/reference.jl +++ b/test/reference.jl @@ -108,7 +108,7 @@ end @testset "Wacky options" begin test_all("WackyOptions"; authors=USER, julia=v"1.2", host="x.com", plugins=[ AppVeyor(; x86=true, coverage=true, extra_versions=[v"1.1"]), - CirrusCI(; image="freebsd-123", coverage=false, extra_versions=["1.1"]), + CirrusCI(; image="freebsd-123", coverage=false, extra_versions=["1.3"]), Citation(; readme=true), Codecov(; file=STATIC_FILE), CompatHelper(; cron="0 0 */3 * *"), @@ -118,7 +118,7 @@ end makedocs_kwargs=Dict(:foo => "bar", :bar => "baz"), canonical_url=(_t, _pkg) -> "http://example.com", ), - DroneCI(; amd64=false, arm=true, arm64=true, extra_versions=["1.1"]), + DroneCI(; amd64=false, arm=true, arm64=true, extra_versions=["1.3"]), Git(; ignore=["a", "b", "c"], manifest=true), GitHubActions(; x86=true, linux=false, coverage=false), GitLabCI(; coverage=false, extra_versions=[v"0.6"]),