2019-09-18 14:22:04 +00:00
|
|
|
"""
|
|
|
|
format_version(v::Union{VersionNumber, AbstractString}) -> String
|
|
|
|
|
|
|
|
Strip everything but the major and minor release from a `VersionNumber`.
|
|
|
|
Strings are left in their original form.
|
|
|
|
"""
|
2019-02-05 17:31:51 +00:00
|
|
|
format_version(v::VersionNumber) = "$(v.major).$(v.minor)"
|
2019-08-29 16:04:11 +00:00
|
|
|
format_version(v::AbstractString) = string(v)
|
2019-02-05 17:31:51 +00:00
|
|
|
|
2019-12-17 02:11:51 +00:00
|
|
|
const ALLOWED_FAILURES = ["nightly"] # TODO: Update this list with new RCs.
|
2019-09-01 14:03:19 +00:00
|
|
|
const DEFAULT_CI_VERSIONS = map(format_version, [default_version(), VERSION, "nightly"])
|
2019-10-06 07:43:17 +00:00
|
|
|
const DEFAULT_CI_VERSIONS_NO_NIGHTLY = map(format_version, [default_version(), VERSION])
|
2019-09-01 14:03:19 +00:00
|
|
|
const EXTRA_VERSIONS_DOC = "- `extra_versions::Vector`: Extra Julia versions to test, as strings or `VersionNumber`s."
|
|
|
|
|
|
|
|
"""
|
2019-11-08 17:26:05 +00:00
|
|
|
GitHubActions(;
|
|
|
|
file="$(contractuser(default_file("github", "workflows", "ci.yml")))",
|
|
|
|
destination="ci.yml",
|
|
|
|
linux=true,
|
|
|
|
osx=true,
|
|
|
|
windows=true,
|
|
|
|
x64=true,
|
|
|
|
x86=false,
|
|
|
|
coverage=true,
|
2019-12-17 08:55:07 +00:00
|
|
|
extra_versions=$DEFAULT_CI_VERSIONS,
|
2019-11-08 17:26:05 +00:00
|
|
|
)
|
2019-09-01 14:03:19 +00:00
|
|
|
|
2019-11-08 17:26:05 +00:00
|
|
|
Integrates your packages with [GitHub Actions](https://github.com/features/actions).
|
|
|
|
|
|
|
|
## Keyword Arguments
|
|
|
|
- `file::AbstractString`: Template file for the workflow file.
|
2019-12-17 06:21:03 +00:00
|
|
|
- `destination::AbstractString`: Destination of the workflow file,
|
2019-11-08 17:26:05 +00:00
|
|
|
relative to `.github/workflows`.
|
|
|
|
- `linux::Bool`: Whether or not to run builds on Linux.
|
|
|
|
- `osx::Bool`: Whether or not to run builds on OSX (MacOS).
|
|
|
|
- `windows::Bool`: Whether or not to run builds on Windows.
|
|
|
|
- `x64::Bool`: Whether or not to run builds on 64-bit architecture.
|
|
|
|
- `x86::Bool`: Whether or not to run builds on 32-bit architecture.
|
|
|
|
- `coverage::Bool`: Whether or not to publish code coverage.
|
|
|
|
Another code coverage plugin such as [`Codecov`](@ref) must also be included.
|
|
|
|
$EXTRA_VERSIONS_DOC
|
|
|
|
|
|
|
|
!!! note
|
|
|
|
If using coverage plugins, don't forget to manually add your API tokens as secrets,
|
|
|
|
as described [here](https://help.github.com/en/actions/automating-your-workflow-with-github-actions/creating-and-using-encrypted-secrets#creating-encrypted-secrets).
|
2019-09-01 14:03:19 +00:00
|
|
|
"""
|
2020-05-25 20:20:27 +00:00
|
|
|
@plugin struct GitHubActions <: FilePlugin
|
2019-11-08 17:26:05 +00:00
|
|
|
file::String = default_file("github", "workflows", "ci.yml")
|
|
|
|
destination::String = "ci.yml"
|
|
|
|
linux::Bool = true
|
|
|
|
osx::Bool = true
|
|
|
|
windows::Bool = true
|
|
|
|
x64::Bool = true
|
|
|
|
x86::Bool = false
|
|
|
|
coverage::Bool = true
|
2019-12-17 08:55:07 +00:00
|
|
|
extra_versions::Vector = DEFAULT_CI_VERSIONS
|
2019-11-08 17:26:05 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
source(p::GitHubActions) = p.file
|
|
|
|
destination(p::GitHubActions) = joinpath(".github", "workflows", p.destination)
|
|
|
|
tags(::GitHubActions) = "<<", ">>"
|
|
|
|
|
2019-12-17 08:55:07 +00:00
|
|
|
badges(::GitHubActions) = Badge(
|
2019-11-08 17:26:05 +00:00
|
|
|
"Build Status",
|
|
|
|
"https://github.com/{{{USER}}}/{{{PKG}}}.jl/workflows/CI/badge.svg",
|
2019-12-17 00:35:16 +00:00
|
|
|
"https://github.com/{{{USER}}}/{{{PKG}}}.jl/actions",
|
2019-11-08 17:26:05 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
function view(p::GitHubActions, t::Template, pkg::AbstractString)
|
|
|
|
os = String[]
|
|
|
|
p.linux && push!(os, "ubuntu-latest")
|
|
|
|
p.osx && push!(os, "macOS-latest")
|
|
|
|
p.windows && push!(os, "windows-latest")
|
|
|
|
arch = filter(a -> getfield(p, Symbol(a)), ["x64", "x86"])
|
|
|
|
excludes = Dict{String, String}[]
|
|
|
|
p.osx && p.x86 && push!(excludes, Dict("E_OS" => "macOS-latest", "E_ARCH" => "x86"))
|
|
|
|
|
|
|
|
return Dict(
|
|
|
|
"ARCH" => arch,
|
|
|
|
"EXCLUDES" => excludes,
|
|
|
|
"HAS_CODECOV" => p.coverage && hasplugin(t, Codecov),
|
|
|
|
"HAS_COVERALLS" => p.coverage && hasplugin(t, Coveralls),
|
|
|
|
"HAS_DOCUMENTER" => hasplugin(t, Documenter{GitHubActions}),
|
|
|
|
"HAS_EXCLUDES" => !isempty(excludes),
|
|
|
|
"OS" => os,
|
|
|
|
"PKG" => pkg,
|
|
|
|
"USER" => t.user,
|
|
|
|
"VERSIONS" => collect_versions(t, p.extra_versions),
|
|
|
|
)
|
2019-02-05 17:31:51 +00:00
|
|
|
end
|
|
|
|
|
2019-09-01 14:03:19 +00:00
|
|
|
"""
|
|
|
|
TravisCI(;
|
|
|
|
file="$(contractuser(default_file("travis.yml")))",
|
|
|
|
linux=true,
|
|
|
|
osx=true,
|
|
|
|
windows=true,
|
2019-11-01 04:45:55 +00:00
|
|
|
x64=true,
|
2019-09-01 14:03:19 +00:00
|
|
|
x86=false,
|
2019-11-01 04:45:55 +00:00
|
|
|
arm64=false,
|
2019-09-01 14:03:19 +00:00
|
|
|
coverage=true,
|
|
|
|
extra_versions=$DEFAULT_CI_VERSIONS,
|
2019-09-18 14:22:04 +00:00
|
|
|
)
|
2019-09-01 14:03:19 +00:00
|
|
|
|
|
|
|
Integrates your packages with [Travis CI](https://travis-ci.com).
|
|
|
|
|
|
|
|
## Keyword Arguments
|
|
|
|
- `file::AbstractString`: Template file for `.travis.yml`.
|
|
|
|
- `linux::Bool`: Whether or not to run builds on Linux.
|
|
|
|
- `osx::Bool`: Whether or not to run builds on OSX (MacOS).
|
|
|
|
- `windows::Bool`: Whether or not to run builds on Windows.
|
2019-11-01 04:45:55 +00:00
|
|
|
- `x64::Bool`: Whether or not to run builds on 64-bit architecture.
|
|
|
|
- `x86::Bool`: Whether or not to run builds on 32-bit architecture.
|
|
|
|
- `arm64::Bool`: Whether or not to run builds on the ARM64 architecture.
|
2019-10-06 09:55:32 +00:00
|
|
|
- `coverage::Bool`: Whether or not to publish code coverage.
|
|
|
|
Another code coverage plugin such as [`Codecov`](@ref) must also be included.
|
2019-09-01 14:03:19 +00:00
|
|
|
$EXTRA_VERSIONS_DOC
|
|
|
|
"""
|
2020-05-25 20:20:27 +00:00
|
|
|
@plugin struct TravisCI <: FilePlugin
|
2019-10-06 07:43:17 +00:00
|
|
|
file::String = default_file("travis.yml")
|
|
|
|
linux::Bool = true
|
|
|
|
osx::Bool = true
|
|
|
|
windows::Bool = true
|
2019-11-01 04:45:55 +00:00
|
|
|
x64::Bool = true
|
2019-10-06 07:43:17 +00:00
|
|
|
x86::Bool = false
|
2019-11-01 04:45:55 +00:00
|
|
|
arm64::Bool = false
|
2019-10-06 07:43:17 +00:00
|
|
|
coverage::Bool = true
|
|
|
|
extra_versions::Vector = DEFAULT_CI_VERSIONS
|
2019-02-05 17:31:51 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
source(p::TravisCI) = p.file
|
|
|
|
destination(::TravisCI) = ".travis.yml"
|
|
|
|
|
|
|
|
badges(::TravisCI) = Badge(
|
|
|
|
"Build Status",
|
2019-09-18 15:27:16 +00:00
|
|
|
"https://travis-ci.com/{{{USER}}}/{{{PKG}}}.jl.svg?branch=master",
|
|
|
|
"https://travis-ci.com/{{{USER}}}/{{{PKG}}}.jl",
|
2019-02-05 17:31:51 +00:00
|
|
|
)
|
|
|
|
|
2019-08-27 14:59:25 +00:00
|
|
|
function view(p::TravisCI, t::Template, pkg::AbstractString)
|
2019-11-01 04:45:55 +00:00
|
|
|
os = filter(o -> getfield(p, Symbol(o)), ["linux", "osx", "windows"])
|
|
|
|
arch = filter(a -> getfield(p, Symbol(a)), ["x64", "x86", "arm64"])
|
2019-08-29 16:04:11 +00:00
|
|
|
versions = collect_versions(t, p.extra_versions)
|
|
|
|
allow_failures = filter(in(versions), ALLOWED_FAILURES)
|
2019-08-27 05:43:10 +00:00
|
|
|
|
2019-11-01 04:45:55 +00:00
|
|
|
excludes = Dict{String, String}[]
|
|
|
|
p.x86 && p.osx && push!(excludes, Dict("E_OS" => "osx", "E_ARCH" => "x86"))
|
|
|
|
if p.arm64
|
|
|
|
p.osx && push!(excludes, Dict("E_OS" => "osx", "E_ARCH" => "arm64"))
|
|
|
|
p.windows && push!(excludes, Dict("E_OS" => "windows", "E_ARCH" => "arm64"))
|
|
|
|
"nightly" in versions && push!(excludes, Dict("E_JULIA" => "nightly", "E_ARCH" => "arm64"))
|
2019-02-05 17:31:51 +00:00
|
|
|
end
|
2019-08-27 05:43:10 +00:00
|
|
|
|
2019-02-05 17:31:51 +00:00
|
|
|
return Dict(
|
2019-08-27 05:43:10 +00:00
|
|
|
"ALLOW_FAILURES" => allow_failures,
|
2019-11-01 04:45:55 +00:00
|
|
|
"ARCH" => arch,
|
|
|
|
"EXCLUDES" => excludes,
|
2019-08-27 05:43:10 +00:00
|
|
|
"HAS_ALLOW_FAILURES" => !isempty(allow_failures),
|
2019-02-05 17:31:51 +00:00
|
|
|
"HAS_CODECOV" => hasplugin(t, Codecov),
|
2019-08-29 16:04:11 +00:00
|
|
|
"HAS_COVERAGE" => p.coverage && hasplugin(t, is_coverage),
|
2019-02-05 17:31:51 +00:00
|
|
|
"HAS_COVERALLS" => hasplugin(t, Coveralls),
|
|
|
|
"HAS_DOCUMENTER" => hasplugin(t, Documenter{TravisCI}),
|
2019-11-01 04:45:55 +00:00
|
|
|
"HAS_EXCLUDES" => !isempty(excludes),
|
2019-08-27 05:43:10 +00:00
|
|
|
"OS" => os,
|
2019-02-05 17:31:51 +00:00
|
|
|
"PKG" => pkg,
|
2019-08-29 16:04:11 +00:00
|
|
|
"USER" => t.user,
|
2019-09-25 13:48:39 +00:00
|
|
|
"VERSION" => format_version(t.julia),
|
2019-08-29 16:04:11 +00:00
|
|
|
"VERSIONS" => versions,
|
2019-02-05 17:31:51 +00:00
|
|
|
)
|
|
|
|
end
|
|
|
|
|
2019-09-01 14:03:19 +00:00
|
|
|
"""
|
|
|
|
AppVeyor(;
|
|
|
|
file="$(contractuser(default_file("appveyor.yml")))",
|
|
|
|
x86=false,
|
|
|
|
coverage=true,
|
|
|
|
extra_versions=$DEFAULT_CI_VERSIONS,
|
2019-09-18 14:22:04 +00:00
|
|
|
)
|
2019-09-01 14:03:19 +00:00
|
|
|
|
2019-10-06 09:55:32 +00:00
|
|
|
Integrates your packages with [AppVeyor](https://appveyor.com)
|
|
|
|
via [AppVeyor.jl](https://github.com/JuliaCI/Appveyor.jl).
|
2019-09-01 14:03:19 +00:00
|
|
|
|
|
|
|
## Keyword Arguments
|
|
|
|
- `file::AbstractString`: Template file for `.appveyor.yml`.
|
2019-10-06 09:55:32 +00:00
|
|
|
- `x86::Bool`: Whether or not to run builds on 32-bit systems,
|
|
|
|
in addition to the default 64-bit builds.
|
|
|
|
- `coverage::Bool`: Whether or not to publish code coverage.
|
|
|
|
[`Codecov`](@ref) must also be included.
|
2019-09-01 14:03:19 +00:00
|
|
|
$EXTRA_VERSIONS_DOC
|
|
|
|
"""
|
2020-05-25 20:20:27 +00:00
|
|
|
@plugin struct AppVeyor <: FilePlugin
|
2019-10-06 07:43:17 +00:00
|
|
|
file::String = default_file("appveyor.yml")
|
|
|
|
x86::Bool = false
|
|
|
|
coverage::Bool = true
|
|
|
|
extra_versions::Vector = DEFAULT_CI_VERSIONS
|
2019-02-05 17:31:51 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
source(p::AppVeyor) = p.file
|
|
|
|
destination(::AppVeyor) = ".appveyor.yml"
|
|
|
|
|
|
|
|
badges(::AppVeyor) = Badge(
|
|
|
|
"Build Status",
|
2019-09-18 15:27:16 +00:00
|
|
|
"https://ci.appveyor.com/api/projects/status/github/{{{USER}}}/{{{PKG}}}.jl?svg=true",
|
|
|
|
"https://ci.appveyor.com/project/{{{USER}}}/{{{PKG}}}-jl",
|
2019-02-05 17:31:51 +00:00
|
|
|
)
|
|
|
|
|
2019-08-29 16:04:11 +00:00
|
|
|
function view(p::AppVeyor, t::Template, pkg::AbstractString)
|
2019-02-05 17:31:51 +00:00
|
|
|
platforms = ["x64"]
|
2019-08-29 16:04:11 +00:00
|
|
|
p.x86 && push!(platforms, "x86")
|
|
|
|
|
|
|
|
versions = collect_versions(t, p.extra_versions)
|
|
|
|
allow_failures = filter(in(versions), ALLOWED_FAILURES)
|
|
|
|
|
2019-02-05 17:31:51 +00:00
|
|
|
return Dict(
|
2019-08-29 16:04:11 +00:00
|
|
|
"ALLOW_FAILURES" => allow_failures,
|
|
|
|
"HAS_ALLOW_FAILURES" => !isempty(allow_failures),
|
|
|
|
"HAS_CODECOV" => p.coverage && hasplugin(t, Codecov),
|
2019-02-05 17:31:51 +00:00
|
|
|
"PKG" => pkg,
|
2019-08-29 16:04:11 +00:00
|
|
|
"PLATFORMS" => platforms,
|
|
|
|
"USER" => t.user,
|
|
|
|
"VERSIONS" => versions,
|
2019-02-05 17:31:51 +00:00
|
|
|
)
|
|
|
|
end
|
|
|
|
|
2019-09-01 14:03:19 +00:00
|
|
|
"""
|
|
|
|
CirrusCI(;
|
|
|
|
file="$(contractuser(default_file("cirrus.yml")))",
|
|
|
|
image="freebsd-12-0-release-amd64",
|
|
|
|
coverage=true,
|
|
|
|
extra_versions=$DEFAULT_CI_VERSIONS,
|
2019-09-18 14:22:04 +00:00
|
|
|
)
|
2019-09-01 14:03:19 +00:00
|
|
|
|
2019-10-06 09:55:32 +00:00
|
|
|
Integrates your packages with [Cirrus CI](https://cirrus-ci.org)
|
|
|
|
via [CirrusCI.jl](https://github.com/ararslan/CirrusCI.jl).
|
2019-09-01 14:03:19 +00:00
|
|
|
|
|
|
|
## Keyword Arguments
|
|
|
|
- `file::AbstractString`: Template file for `.cirrus.yml`.
|
|
|
|
- `image::AbstractString`: The FreeBSD image to be used.
|
2019-10-06 09:55:32 +00:00
|
|
|
- `coverage::Bool`: Whether or not to publish code coverage.
|
|
|
|
[`Codecov`](@ref) must also be included.
|
2019-09-01 14:03:19 +00:00
|
|
|
$EXTRA_VERSIONS_DOC
|
|
|
|
|
|
|
|
!!! note
|
2019-10-06 09:55:32 +00:00
|
|
|
Code coverage submission from Cirrus CI is not yet supported by
|
|
|
|
[Coverage.jl](https://github.com/JuliaCI/Coverage.jl).
|
2019-09-01 14:03:19 +00:00
|
|
|
"""
|
2020-05-25 20:20:27 +00:00
|
|
|
@plugin struct CirrusCI <: FilePlugin
|
2019-10-06 07:43:17 +00:00
|
|
|
file::String = default_file("cirrus.yml")
|
|
|
|
image::String = "freebsd-12-0-release-amd64"
|
|
|
|
coverage::Bool = true
|
|
|
|
extra_versions::Vector = DEFAULT_CI_VERSIONS
|
2019-02-05 17:31:51 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
source(p::CirrusCI) = p.file
|
|
|
|
destination(::CirrusCI) = ".cirrus.yml"
|
|
|
|
|
|
|
|
badges(::CirrusCI) = Badge(
|
|
|
|
"Build Status",
|
2019-09-18 15:27:16 +00:00
|
|
|
"https://api.cirrus-ci.com/github/{{{USER}}}/{{{PKG}}}.jl.svg",
|
|
|
|
"https://cirrus-ci.com/github/{{{USER}}}/{{{PKG}}}.jl",
|
2019-02-05 17:31:51 +00:00
|
|
|
)
|
|
|
|
|
2019-08-31 11:45:41 +00:00
|
|
|
function view(p::CirrusCI, t::Template, pkg::AbstractString)
|
2019-02-05 17:31:51 +00:00
|
|
|
return Dict(
|
|
|
|
"HAS_CODECOV" => hasplugin(t, Codecov),
|
|
|
|
"HAS_COVERALLS" => hasplugin(t, Coveralls),
|
2019-08-29 16:04:11 +00:00
|
|
|
"HAS_COVERAGE" => p.coverage && hasplugin(t, is_coverage),
|
2019-02-05 17:31:51 +00:00
|
|
|
"IMAGE" => p.image,
|
|
|
|
"PKG" => pkg,
|
2019-08-29 16:04:11 +00:00
|
|
|
"USER" => t.user,
|
|
|
|
"VERSIONS" => collect_versions(t, p.extra_versions),
|
2019-02-05 17:31:51 +00:00
|
|
|
)
|
|
|
|
end
|
|
|
|
|
2019-09-01 14:03:19 +00:00
|
|
|
"""
|
|
|
|
GitLabCI(;
|
|
|
|
file="$(contractuser(default_file("gitlab-ci.yml")))",
|
|
|
|
coverage=true,
|
2019-10-06 07:43:17 +00:00
|
|
|
extra_versions=$DEFAULT_CI_VERSIONS_NO_NIGHTLY,
|
2019-09-18 14:22:04 +00:00
|
|
|
)
|
2019-09-01 14:03:19 +00:00
|
|
|
|
2019-10-06 09:55:32 +00:00
|
|
|
Integrates your packages with [GitLab CI](https://docs.gitlab.com/ce/ci).
|
2019-09-01 14:03:19 +00:00
|
|
|
|
|
|
|
## Keyword Arguments
|
|
|
|
- `file::AbstractString`: Template file for `.gitlab-ci.yml`.
|
|
|
|
- `coverage::Bool`: Whether or not to compute code coverage.
|
|
|
|
$EXTRA_VERSIONS_DOC
|
|
|
|
|
|
|
|
## GitLab Pages
|
|
|
|
Documentation can be generated by including a `Documenter{GitLabCI}` plugin.
|
|
|
|
See [`Documenter`](@ref) for more information.
|
|
|
|
|
|
|
|
!!! note
|
|
|
|
Nightly Julia is not supported.
|
|
|
|
"""
|
2020-05-25 20:20:27 +00:00
|
|
|
@plugin struct GitLabCI <: FilePlugin
|
2019-10-06 07:43:17 +00:00
|
|
|
file::String = default_file("gitlab-ci.yml")
|
|
|
|
coverage::Bool = true
|
2019-08-31 14:09:22 +00:00
|
|
|
# Nightly has no Docker image.
|
2019-10-06 07:43:17 +00:00
|
|
|
extra_versions::Vector = DEFAULT_CI_VERSIONS_NO_NIGHTLY
|
2019-02-05 17:31:51 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
gitignore(p::GitLabCI) = p.coverage ? COVERAGE_GITIGNORE : String[]
|
2019-08-31 11:45:41 +00:00
|
|
|
source(p::GitLabCI) = p.file
|
2019-02-05 17:31:51 +00:00
|
|
|
destination(::GitLabCI) = ".gitlab-ci.yml"
|
|
|
|
|
|
|
|
function badges(p::GitLabCI)
|
|
|
|
ci = Badge(
|
|
|
|
"Build Status",
|
2020-04-18 15:35:35 +00:00
|
|
|
"https://{{{HOST}}}/{{{USER}}}/{{{PKG}}}.jl/badges/master/pipeline.svg",
|
|
|
|
"https://{{{HOST}}}/{{{USER}}}/{{{PKG}}}.jl/pipelines",
|
2019-02-05 17:31:51 +00:00
|
|
|
)
|
|
|
|
cov = Badge(
|
|
|
|
"Coverage",
|
2020-04-18 15:35:35 +00:00
|
|
|
"https://{{{HOST}}}/{{{USER}}}/{{{PKG}}}.jl/badges/master/coverage.svg",
|
|
|
|
"https://{{{HOST}}}/{{{USER}}}/{{{PKG}}}.jl/commits/master",
|
2019-02-05 17:31:51 +00:00
|
|
|
)
|
|
|
|
return p.coverage ? [ci, cov] : [ci]
|
|
|
|
end
|
|
|
|
|
2019-08-31 11:45:41 +00:00
|
|
|
function view(p::GitLabCI, t::Template, pkg::AbstractString)
|
2019-02-05 17:31:51 +00:00
|
|
|
return Dict(
|
|
|
|
"HAS_COVERAGE" => p.coverage,
|
|
|
|
"HAS_DOCUMENTER" => hasplugin(t, Documenter{GitLabCI}),
|
2020-04-18 15:35:35 +00:00
|
|
|
"HOST" => t.host,
|
2019-02-05 17:31:51 +00:00
|
|
|
"PKG" => pkg,
|
2019-08-29 16:04:11 +00:00
|
|
|
"USER" => t.user,
|
2019-09-25 13:48:39 +00:00
|
|
|
"VERSION" => format_version(t.julia),
|
2019-08-29 16:04:11 +00:00
|
|
|
"VERSIONS" => collect_versions(t, p.extra_versions),
|
2019-02-05 17:31:51 +00:00
|
|
|
)
|
|
|
|
end
|
2019-08-29 16:04:11 +00:00
|
|
|
|
2019-10-06 08:13:37 +00:00
|
|
|
"""
|
|
|
|
DroneCI(;
|
|
|
|
file="$(contractuser(default_file("drone.star")))",
|
|
|
|
amd64=true,
|
|
|
|
arm=false,
|
|
|
|
arm64=false,
|
|
|
|
extra_versions=$DEFAULT_CI_VERSIONS_NO_NIGHTLY,
|
|
|
|
)
|
|
|
|
|
|
|
|
Integrates your packages with [Drone CI](https://drone.io).
|
|
|
|
|
|
|
|
## Keyword Arguments
|
|
|
|
- `file::AbstractString`: Template file for `.drone.star`.
|
|
|
|
- `destination::AbstractString`: File destination, relative to the repository root.
|
|
|
|
For example, you might want to generate a `.drone.yml` instead of the default Starlark file.
|
|
|
|
- `amd64::Bool`: Whether or not to run builds on AMD64.
|
|
|
|
- `arm::Bool`: Whether or not to run builds on ARM (32-bit).
|
2019-10-06 09:55:32 +00:00
|
|
|
- `arm64::Bool`: Whether or not to run builds on ARM64.
|
2019-10-06 08:13:37 +00:00
|
|
|
$EXTRA_VERSIONS_DOC
|
|
|
|
|
|
|
|
!!! note
|
|
|
|
Nightly Julia is not supported.
|
|
|
|
"""
|
2020-05-25 20:20:27 +00:00
|
|
|
@plugin struct DroneCI <: FilePlugin
|
2019-10-06 08:13:37 +00:00
|
|
|
file::String = default_file("drone.star")
|
|
|
|
destination::String = ".drone.star"
|
|
|
|
amd64::Bool = true
|
|
|
|
arm::Bool = false
|
|
|
|
arm64::Bool = false
|
|
|
|
extra_versions::Vector = DEFAULT_CI_VERSIONS_NO_NIGHTLY
|
|
|
|
end
|
|
|
|
|
|
|
|
source(p::DroneCI) = p.file
|
|
|
|
destination(p::DroneCI) = p.destination
|
|
|
|
|
|
|
|
badges(::DroneCI) = Badge(
|
|
|
|
"Build Status",
|
|
|
|
"https://cloud.drone.io/api/badges/{{{USER}}}/{{{PKG}}}.jl/status.svg",
|
|
|
|
"https://cloud.drone.io/{{{USER}}}/{{{PKG}}}.jl",
|
|
|
|
)
|
|
|
|
|
|
|
|
function view(p::DroneCI, t::Template, pkg::AbstractString)
|
|
|
|
arches = String[]
|
|
|
|
p.amd64 && push!(arches, "amd64")
|
|
|
|
p.arm && push!(arches, "arm")
|
|
|
|
p.arm64 && push!(arches, "arm64")
|
|
|
|
|
|
|
|
return Dict(
|
|
|
|
"ARCHES" => join(map(repr, arches), ", "),
|
|
|
|
"PKG" => pkg,
|
|
|
|
"USER" => t.user,
|
|
|
|
"VERSIONS" => join(map(repr, collect_versions(t, p.extra_versions)), ", "),
|
|
|
|
)
|
|
|
|
end
|
|
|
|
|
2019-11-08 17:26:05 +00:00
|
|
|
"""
|
|
|
|
collect_versions(t::Template, versions::Vector) -> Vector{String}
|
|
|
|
|
|
|
|
Combine `t`'s Julia version with `versions`, and format them as `major.minor`.
|
|
|
|
This is useful for creating lists of versions to be included in CI configurations.
|
|
|
|
"""
|
|
|
|
function collect_versions(t::Template, versions::Vector)
|
|
|
|
vs = map(format_version, [t.julia, versions...])
|
|
|
|
return sort(unique(vs))
|
|
|
|
end
|
|
|
|
|
2020-05-25 20:20:27 +00:00
|
|
|
const AllCI = Union{AppVeyor, GitHubActions, TravisCI, CirrusCI, GitLabCI, DroneCI}
|
|
|
|
|
2019-09-01 14:03:19 +00:00
|
|
|
"""
|
2019-09-20 02:31:56 +00:00
|
|
|
is_ci(::Plugin) -> Bool
|
2019-09-01 14:03:19 +00:00
|
|
|
|
2019-09-20 02:31:56 +00:00
|
|
|
Determine whether or not a plugin is a CI plugin.
|
2019-09-01 14:03:19 +00:00
|
|
|
If you are adding a CI plugin, you should implement this function and return `true`.
|
|
|
|
"""
|
2019-09-20 02:31:56 +00:00
|
|
|
is_ci(::Plugin) = false
|
2020-05-25 20:20:27 +00:00
|
|
|
is_ci(::AllCI) = true
|
2019-09-25 02:45:08 +00:00
|
|
|
|
2020-05-25 20:20:27 +00:00
|
|
|
needs_username(::AllCI) = true
|
|
|
|
customizable(::Type{<:AllCI}) = (:extra_versions => Vector{VersionNumber},)
|