Support ARM builds on Travis CI

This commit is contained in:
Chris de Graaf 2019-11-01 09:27:12 +07:00
parent ab55313ee9
commit 206b7e9ade
No known key found for this signature in database
GPG Key ID: 150FFDD9B0073C7B
4 changed files with 29 additions and 9 deletions

View File

@ -30,6 +30,7 @@ end
osx=true, osx=true,
windows=true, windows=true,
x86=false, x86=false,
arm=false,
coverage=true, coverage=true,
extra_versions=$DEFAULT_CI_VERSIONS, 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. - `windows::Bool`: Whether or not to run builds on Windows.
- `x86::Bool`: Whether or not to run builds on 32-bit systems, - `x86::Bool`: Whether or not to run builds on 32-bit systems,
in addition to the default 64-bit builds. 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. - `coverage::Bool`: Whether or not to publish code coverage.
Another code coverage plugin such as [`Codecov`](@ref) must also be included. Another code coverage plugin such as [`Codecov`](@ref) must also be included.
$EXTRA_VERSIONS_DOC $EXTRA_VERSIONS_DOC
@ -53,6 +55,7 @@ $EXTRA_VERSIONS_DOC
osx::Bool = true osx::Bool = true
windows::Bool = true windows::Bool = true
x86::Bool = false x86::Bool = false
arm::Bool = false
coverage::Bool = true coverage::Bool = true
extra_versions::Vector = DEFAULT_CI_VERSIONS extra_versions::Vector = DEFAULT_CI_VERSIONS
end end
@ -75,11 +78,16 @@ function view(p::TravisCI, t::Template, pkg::AbstractString)
versions = collect_versions(t, p.extra_versions) versions = collect_versions(t, p.extra_versions)
allow_failures = filter(in(versions), ALLOWED_FAILURES) allow_failures = filter(in(versions), ALLOWED_FAILURES)
x86 = Dict{String, String}[] jobs = Dict{String, String}[]
if p.x86 if p.x86
foreach(versions) do v foreach(versions) do v
p.linux && push!(x86, Dict("JULIA" => v, "OS" => "linux")) p.linux && push!(jobs, Dict("JULIA" => v, "OS" => "linux", "ARCH" => "x86"))
p.windows && push!(x86, Dict("JULIA" => v, "OS" => "windows")) 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
end end
@ -90,13 +98,13 @@ function view(p::TravisCI, t::Template, pkg::AbstractString)
"HAS_COVERAGE" => p.coverage && hasplugin(t, is_coverage), "HAS_COVERAGE" => p.coverage && hasplugin(t, is_coverage),
"HAS_COVERALLS" => hasplugin(t, Coveralls), "HAS_COVERALLS" => hasplugin(t, Coveralls),
"HAS_DOCUMENTER" => hasplugin(t, Documenter{TravisCI}), "HAS_DOCUMENTER" => hasplugin(t, Documenter{TravisCI}),
"HAS_JOBS" => p.x86 || hasplugin(t, Documenter{TravisCI}), "HAS_JOBS" => !isempty(jobs) || hasplugin(t, Documenter{TravisCI}),
"OS" => os, "OS" => os,
"PKG" => pkg, "PKG" => pkg,
"USER" => t.user, "USER" => t.user,
"VERSION" => format_version(t.julia), "VERSION" => format_version(t.julia),
"VERSIONS" => versions, "VERSIONS" => versions,
"X86" => x86, "JOBS" => jobs,
) )
end end

View File

@ -21,11 +21,11 @@ jobs:
{{#HAS_JOBS}} {{#HAS_JOBS}}
include: include:
{{/HAS_JOBS}} {{/HAS_JOBS}}
{{#X86}} {{#JOBS}}
- julia: {{{JULIA}}} - julia: {{{JULIA}}}
os: {{{OS}}} os: {{{OS}}}
arch: x86 arch: {{{ARCH}}}
{{/X86}} {{/JOBS}}
{{#HAS_DOCUMENTER}} {{#HAS_DOCUMENTER}}
- stage: Documentation - stage: Documentation
julia: {{{VERSION}}} julia: {{{VERSION}}}

View File

@ -17,3 +17,9 @@ jobs:
- julia: 1.2 - julia: 1.2
os: linux os: linux
arch: x86 arch: x86
- julia: 1.1
os: linux
arch: arm64
- julia: 1.2
os: linux
arch: arm64

View File

@ -45,7 +45,13 @@ end
License(; name="ISC"), License(; name="ISC"),
Readme(; inline_badges=true), Readme(; inline_badges=true),
Tests(; project=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
end end