diff --git a/src/plugins/ci.jl b/src/plugins/ci.jl index 531e306..2b8dd63 100644 --- a/src/plugins/ci.jl +++ b/src/plugins/ci.jl @@ -30,6 +30,7 @@ end osx=true, windows=true, x86=false, + arm=false, coverage=true, extra_versions=$DEFAULT_CI_VERSIONS, ) @@ -43,6 +44,7 @@ Integrates your packages with [Travis CI](https://travis-ci.com). - `windows::Bool`: Whether or not to run builds on Windows. - `x86::Bool`: Whether or not to run builds on 32-bit systems, in addition to the default 64-bit builds. +- `arm::Bool`: Whether or not to run builds on the ARM architecture, in addition to AMD64. - `coverage::Bool`: Whether or not to publish code coverage. Another code coverage plugin such as [`Codecov`](@ref) must also be included. $EXTRA_VERSIONS_DOC @@ -53,6 +55,7 @@ $EXTRA_VERSIONS_DOC osx::Bool = true windows::Bool = true x86::Bool = false + arm::Bool = false coverage::Bool = true extra_versions::Vector = DEFAULT_CI_VERSIONS end @@ -75,11 +78,16 @@ function view(p::TravisCI, t::Template, pkg::AbstractString) versions = collect_versions(t, p.extra_versions) allow_failures = filter(in(versions), ALLOWED_FAILURES) - x86 = Dict{String, String}[] + jobs = Dict{String, String}[] if p.x86 foreach(versions) do v - p.linux && push!(x86, Dict("JULIA" => v, "OS" => "linux")) - p.windows && push!(x86, Dict("JULIA" => v, "OS" => "windows")) + p.linux && push!(jobs, Dict("JULIA" => v, "OS" => "linux", "ARCH" => "x86")) + p.windows && push!(jobs, Dict("JULIA" => v, "OS" => "windows", "ARCH" => "x86")) + end + end + if p.arm + foreach(versions) do v + p.linux && push!(jobs, Dict("JULIA" => v, "OS" => "linux", "ARCH" => "arm64")) end end @@ -90,13 +98,13 @@ function view(p::TravisCI, t::Template, pkg::AbstractString) "HAS_COVERAGE" => p.coverage && hasplugin(t, is_coverage), "HAS_COVERALLS" => hasplugin(t, Coveralls), "HAS_DOCUMENTER" => hasplugin(t, Documenter{TravisCI}), - "HAS_JOBS" => p.x86 || hasplugin(t, Documenter{TravisCI}), + "HAS_JOBS" => !isempty(jobs) || hasplugin(t, Documenter{TravisCI}), "OS" => os, "PKG" => pkg, "USER" => t.user, "VERSION" => format_version(t.julia), "VERSIONS" => versions, - "X86" => x86, + "JOBS" => jobs, ) end diff --git a/templates/travis.yml b/templates/travis.yml index accf0d2..64837ed 100644 --- a/templates/travis.yml +++ b/templates/travis.yml @@ -21,11 +21,11 @@ jobs: {{#HAS_JOBS}} include: {{/HAS_JOBS}} -{{#X86}} +{{#JOBS}} - julia: {{{JULIA}}} os: {{{OS}}} - arch: x86 -{{/X86}} + arch: {{{ARCH}}} +{{/JOBS}} {{#HAS_DOCUMENTER}} - stage: Documentation julia: {{{VERSION}}} diff --git a/test/fixtures/WackyOptions/.travis.yml b/test/fixtures/WackyOptions/.travis.yml index 5a97f17..23e5a57 100644 --- a/test/fixtures/WackyOptions/.travis.yml +++ b/test/fixtures/WackyOptions/.travis.yml @@ -17,3 +17,9 @@ jobs: - julia: 1.2 os: linux arch: x86 + - julia: 1.1 + os: linux + arch: arm64 + - julia: 1.2 + os: linux + arch: arm64 diff --git a/test/reference.jl b/test/reference.jl index 9fd3198..ac929d9 100644 --- a/test/reference.jl +++ b/test/reference.jl @@ -45,7 +45,13 @@ end License(; name="ISC"), Readme(; inline_badges=true), Tests(; project=true), - TravisCI(; coverage=false, windows=false, x86=true, extra_versions=["1.1"]), + TravisCI(; + coverage=false, + windows=false, + x86=true, + arm=true, + extra_versions=["1.1"], + ), ]) end end