Add DroneCI plugin for new PkgTemplates
This commit is contained in:
parent
5e9ff16cbe
commit
ad8e78d87e
@ -49,6 +49,7 @@ These plugins will create the configuration files of common CI services for you.
|
||||
```@docs
|
||||
AppVeyor
|
||||
CirrusCI
|
||||
DroneCI
|
||||
GitLabCI
|
||||
TravisCI
|
||||
```
|
||||
|
@ -253,6 +253,61 @@ function view(p::GitLabCI, t::Template, pkg::AbstractString)
|
||||
)
|
||||
end
|
||||
|
||||
"""
|
||||
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).
|
||||
- `arm::Bool`: Whether or not to run builds on ARM64.
|
||||
$EXTRA_VERSIONS_DOC
|
||||
|
||||
!!! note
|
||||
Nightly Julia is not supported.
|
||||
"""
|
||||
@with_kw_noshow struct DroneCI <: BasicPlugin
|
||||
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
|
||||
|
||||
"""
|
||||
is_ci(::Plugin) -> Bool
|
||||
|
||||
@ -260,6 +315,6 @@ Determine whether or not a plugin is a CI plugin.
|
||||
If you are adding a CI plugin, you should implement this function and return `true`.
|
||||
"""
|
||||
is_ci(::Plugin) = false
|
||||
is_ci(::Union{AppVeyor, TravisCI, CirrusCI, GitLabCI}) = true
|
||||
is_ci(::Union{AppVeyor, TravisCI, CirrusCI, GitLabCI, DroneCI}) = true
|
||||
|
||||
needs_username(::Union{AppVeyor, TravisCI, CirrusCI, GitLabCI}) = true
|
||||
needs_username(::Union{AppVeyor, TravisCI, CirrusCI, GitLabCI, DroneCI}) = true
|
||||
|
@ -51,6 +51,7 @@ badge_order() = [
|
||||
GitLabCI,
|
||||
TravisCI,
|
||||
AppVeyor,
|
||||
DroneCI,
|
||||
CirrusCI,
|
||||
Codecov,
|
||||
Coveralls,
|
||||
|
27
templates/drone.star
Normal file
27
templates/drone.star
Normal file
@ -0,0 +1,27 @@
|
||||
def main(ctx):
|
||||
pipelines = []
|
||||
for arch in [{{{ARCHES}}}]:
|
||||
for julia in [{{{VERSIONS}}}]:
|
||||
pipelines.append(pipeline(arch, julia))
|
||||
return pipelines
|
||||
|
||||
def pipeline(arch, julia):
|
||||
return {
|
||||
"kind": "pipeline",
|
||||
"type": "docker",
|
||||
"name": "Julia %s - %s" % (julia, arch),
|
||||
"platform": {
|
||||
"os": "linux",
|
||||
"arch": arch,
|
||||
},
|
||||
"steps": [
|
||||
{
|
||||
"name": "test",
|
||||
"image": "julia:%s" % julia,
|
||||
"commands": [
|
||||
"julia -e 'using InteractiveUtils; versioninfo()'",
|
||||
"julia --project=@. -e 'using Pkg; Pkg.instantiate(); Pkg.build(); Pkg.test();'",
|
||||
],
|
||||
},
|
||||
],
|
||||
}
|
27
test/fixtures/AllPlugins/.drone.star
vendored
Normal file
27
test/fixtures/AllPlugins/.drone.star
vendored
Normal file
@ -0,0 +1,27 @@
|
||||
def main(ctx):
|
||||
pipelines = []
|
||||
for arch in ["amd64"]:
|
||||
for julia in ["1.0", "1.2"]:
|
||||
pipelines.append(pipeline(arch, julia))
|
||||
return pipelines
|
||||
|
||||
def pipeline(arch, julia):
|
||||
return {
|
||||
"kind": "pipeline",
|
||||
"type": "docker",
|
||||
"name": "Julia %s - %s" % (julia, arch),
|
||||
"platform": {
|
||||
"os": "linux",
|
||||
"arch": arch,
|
||||
},
|
||||
"steps": [
|
||||
{
|
||||
"name": "test",
|
||||
"image": "julia:%s" % julia,
|
||||
"commands": [
|
||||
"julia -e 'using InteractiveUtils; versioninfo()'",
|
||||
"julia --project=@. -e 'using Pkg; Pkg.instantiate(); Pkg.build(); Pkg.test();'",
|
||||
],
|
||||
},
|
||||
],
|
||||
}
|
1
test/fixtures/AllPlugins/README.md
vendored
1
test/fixtures/AllPlugins/README.md
vendored
@ -4,6 +4,7 @@
|
||||
[](https://gitlab.com/tester/AllPlugins.jl/commits/master)
|
||||
[](https://travis-ci.com/tester/AllPlugins.jl)
|
||||
[](https://ci.appveyor.com/project/tester/AllPlugins-jl)
|
||||
[](https://cloud.drone.io/tester/AllPlugins.jl)
|
||||
[](https://cirrus-ci.com/github/tester/AllPlugins.jl)
|
||||
[](https://codecov.io/gh//.jl)
|
||||
[](https://coveralls.io/github//.jl?branch=master)
|
||||
|
27
test/fixtures/WackyOptions/.drone.star
vendored
Normal file
27
test/fixtures/WackyOptions/.drone.star
vendored
Normal file
@ -0,0 +1,27 @@
|
||||
def main(ctx):
|
||||
pipelines = []
|
||||
for arch in ["arm", "arm64"]:
|
||||
for julia in ["1.1", "1.2"]:
|
||||
pipelines.append(pipeline(arch, julia))
|
||||
return pipelines
|
||||
|
||||
def pipeline(arch, julia):
|
||||
return {
|
||||
"kind": "pipeline",
|
||||
"type": "docker",
|
||||
"name": "Julia %s - %s" % (julia, arch),
|
||||
"platform": {
|
||||
"os": "linux",
|
||||
"arch": arch,
|
||||
},
|
||||
"steps": [
|
||||
{
|
||||
"name": "test",
|
||||
"image": "julia:%s" % julia,
|
||||
"commands": [
|
||||
"julia -e 'using InteractiveUtils; versioninfo()'",
|
||||
"julia --project=@. -e 'using Pkg; Pkg.instantiate(); Pkg.build(); Pkg.test();'",
|
||||
],
|
||||
},
|
||||
],
|
||||
}
|
2
test/fixtures/WackyOptions/README.md
vendored
2
test/fixtures/WackyOptions/README.md
vendored
@ -1,4 +1,4 @@
|
||||
# WackyOptions [](https://tester.gitlab.io/WackyOptions.jl/dev) [](https://gitlab.com/tester/WackyOptions.jl/pipelines) [](https://travis-ci.com/tester/WackyOptions.jl) [](https://ci.appveyor.com/project/tester/WackyOptions-jl) [](https://cirrus-ci.com/github/tester/WackyOptions.jl) [](https://codecov.io/gh//.jl) [](https://coveralls.io/github//.jl?branch=master)
|
||||
# WackyOptions [](https://tester.gitlab.io/WackyOptions.jl/dev) [](https://gitlab.com/tester/WackyOptions.jl/pipelines) [](https://travis-ci.com/tester/WackyOptions.jl) [](https://ci.appveyor.com/project/tester/WackyOptions-jl) [](https://cloud.drone.io/tester/WackyOptions.jl) [](https://cirrus-ci.com/github/tester/WackyOptions.jl) [](https://codecov.io/gh//.jl) [](https://coveralls.io/github//.jl?branch=master)
|
||||
|
||||
## Citing
|
||||
|
||||
|
@ -23,7 +23,7 @@ end
|
||||
@testset "All plugins" begin
|
||||
test_all("AllPlugins"; authors=USER, plugins=[
|
||||
AppVeyor(), CirrusCI(), Citation(), Codecov(), Coveralls(),
|
||||
Develop(), Documenter(), GitLabCI(), TravisCI(),
|
||||
Develop(), Documenter(), DroneCI(), GitLabCI(), TravisCI(),
|
||||
])
|
||||
end
|
||||
|
||||
@ -39,6 +39,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"]),
|
||||
Git(; ignore=["a", "b", "c"], manifest=true),
|
||||
GitLabCI(; coverage=false, extra_versions=[v"0.6"]),
|
||||
License(; name="ISC"),
|
||||
|
Loading…
Reference in New Issue
Block a user