Skip to content

Commit

Permalink
add PkgEval badge (#334)
Browse files Browse the repository at this point in the history
* add PkgEval badge

* add tests for PkgEvalBadge

* export PkgEvalBadge

* add PkgEvalBadge to docs

* bump version to 0.7.26

* fix capitalization

* better link for PkgEval badge in docstring

Co-authored-by: Nick Robinson <npr251@gmail.com>

* fix other missing badge in show test

* switch to using view for PkgEvalBadge

* update Wacky Options reference tests with PkgEvalBadge

Co-authored-by: Nick Robinson <npr251@gmail.com>
  • Loading branch information
mileslucas and nickrobinson251 authored Jan 7, 2022
1 parent cb02b34 commit 515c2bc
Show file tree
Hide file tree
Showing 8 changed files with 27 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "PkgTemplates"
uuid = "14b8a8f1-9102-5b29-a752-f990bacb7fe1"
authors = ["Chris de Graaf", "Invenia Technical Computing Corporation"]
version = "0.7.25"
version = "0.7.26"

[deps]
Dates = "ade2ca70-3891-5945-98fb-dc099432e06a"
Expand Down
1 change: 1 addition & 0 deletions docs/src/user.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ Logo
```@docs
BlueStyleBadge
ColPracBadge
PkgEvalBadge
```

### Miscellaneous
Expand Down
1 change: 1 addition & 0 deletions src/PkgTemplates.jl
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ export
License,
Logo,
NoDeploy,
PkgEvalBadge,
ProjectFile,
Readme,
RegisterAction,
Expand Down
19 changes: 19 additions & 0 deletions src/plugins/badges.jl
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,22 @@ function badges(::ColPracBadge)
"https://github.com/SciML/ColPrac",
)
end

"""
PkgEvalBadge()
Adds a [`PkgEval` badge](https://github.com/JuliaCI/NanosoldierReports#pkgeval-reports) to the [`Readme`](@ref) file.
"""
struct PkgEvalBadge <: BadgePlugin end

function badges(::PkgEvalBadge)
return Badge(
"PkgEval",
"https://JuliaCI.github.io/NanosoldierReports/pkgeval_badges/{{{PKG1}}}/{{{PKG}}}.svg",
"https://JuliaCI.github.io/NanosoldierReports/pkgeval_badges/report.html"
)
end

function view(::PkgEvalBadge, t::Template, pkg::AbstractString)
return Dict("PKG1" => first(pkg), "PKG" => pkg)
end
2 changes: 1 addition & 1 deletion test/fixtures/WackyOptions/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# WackyOptions [![Stable](https://img.shields.io/badge/docs-stable-blue.svg)](https://tester.github.io/WackyOptions.jl/stable) [![Dev](https://img.shields.io/badge/docs-dev-blue.svg)](https://tester.github.io/WackyOptions.jl/dev) [![Build Status](https://github.com/tester/WackyOptions.jl/actions/workflows/CI.yml/badge.svg?branch=whackybranch)](https://github.com/tester/WackyOptions.jl/actions/workflows/CI.yml?query=branch%3Awhackybranch) [![Build Status](https://x.com/tester/WackyOptions.jl/badges/whackybranch/pipeline.svg)](https://x.com/tester/WackyOptions.jl/pipelines) [![Build Status](https://travis-ci.com/tester/WackyOptions.jl.svg?branch=whackybranch)](https://travis-ci.com/tester/WackyOptions.jl) [![Build Status](https://ci.appveyor.com/api/projects/status/github/tester/WackyOptions.jl?svg=true)](https://ci.appveyor.com/project/tester/WackyOptions-jl) [![Build Status](https://cloud.drone.io/api/badges/tester/WackyOptions.jl/status.svg)](https://cloud.drone.io/tester/WackyOptions.jl) [![Build Status](https://api.cirrus-ci.com/github/tester/WackyOptions.jl.svg)](https://cirrus-ci.com/github/tester/WackyOptions.jl) [![Coverage](https://coveralls.io/repos/github/tester/WackyOptions.jl/badge.svg?branch=whackybranch)](https://coveralls.io/github/tester/WackyOptions.jl?branch=whackybranch)
# WackyOptions [![Stable](https://img.shields.io/badge/docs-stable-blue.svg)](https://tester.github.io/WackyOptions.jl/stable) [![Dev](https://img.shields.io/badge/docs-dev-blue.svg)](https://tester.github.io/WackyOptions.jl/dev) [![Build Status](https://github.com/tester/WackyOptions.jl/actions/workflows/CI.yml/badge.svg?branch=whackybranch)](https://github.com/tester/WackyOptions.jl/actions/workflows/CI.yml?query=branch%3Awhackybranch) [![Build Status](https://x.com/tester/WackyOptions.jl/badges/whackybranch/pipeline.svg)](https://x.com/tester/WackyOptions.jl/pipelines) [![Build Status](https://travis-ci.com/tester/WackyOptions.jl.svg?branch=whackybranch)](https://travis-ci.com/tester/WackyOptions.jl) [![Build Status](https://ci.appveyor.com/api/projects/status/github/tester/WackyOptions.jl?svg=true)](https://ci.appveyor.com/project/tester/WackyOptions-jl) [![Build Status](https://cloud.drone.io/api/badges/tester/WackyOptions.jl/status.svg)](https://cloud.drone.io/tester/WackyOptions.jl) [![Build Status](https://api.cirrus-ci.com/github/tester/WackyOptions.jl.svg)](https://cirrus-ci.com/github/tester/WackyOptions.jl) [![Coverage](https://coveralls.io/repos/github/tester/WackyOptions.jl/badge.svg?branch=whackybranch)](https://coveralls.io/github/tester/WackyOptions.jl?branch=whackybranch) [![PkgEval](https://JuliaCI.github.io/NanosoldierReports/pkgeval_badges/W/WackyOptions.svg)](https://JuliaCI.github.io/NanosoldierReports/pkgeval_badges/report.html)

## Citing

Expand Down
1 change: 1 addition & 0 deletions test/plugin.jl
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ PT.user_view(::FileTest, ::Template, ::AbstractString) = Dict("X" => 1, "Z" => 3
@testset "$BadgeType" for (BadgeType, text) in (
BlueStyleBadge => "BlueStyle",
ColPracBadge => "ColPrac",
PkgEvalBadge => "PkgEval",
)
@test BadgeType <: PT.BadgePlugin
t = tpl(; plugins=[BadgeType()])
Expand Down
1 change: 1 addition & 0 deletions test/reference.jl
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ end
GitHubActions(; x86=true, linux=false, coverage=false),
GitLabCI(; coverage=false, extra_versions=[v"0.6"]),
License(; name="ISC"),
PkgEvalBadge(),
ProjectFile(; version=v"1"),
Readme(; inline_badges=true, badge_off=[Codecov]),
RegisterAction(; prompt="gimme version"),
Expand Down
4 changes: 2 additions & 2 deletions test/show.jl
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ end
file: "$(joinpath(TEMPLATES_DIR, "README.md"))"
destination: "README.md"
inline_badges: false
badge_order: DataType[Documenter{GitHubActions}, Documenter{GitLabCI}, Documenter{TravisCI}, GitHubActions, GitLabCI, TravisCI, AppVeyor, DroneCI, CirrusCI, Codecov, Coveralls, BlueStyleBadge, ColPracBadge]
badge_order: DataType[Documenter{GitHubActions}, Documenter{GitLabCI}, Documenter{TravisCI}, GitHubActions, GitLabCI, TravisCI, AppVeyor, DroneCI, CirrusCI, Codecov, Coveralls, BlueStyleBadge, ColPracBadge, PkgEvalBadge]
badge_off: DataType[]
"""
test_show(rstrip(expected), sprint(show, MIME("text/plain"), Readme()))
Expand Down Expand Up @@ -56,7 +56,7 @@ end
file: "$(joinpath(TEMPLATES_DIR, "README.md"))"
destination: "README.md"
inline_badges: false
badge_order: DataType[Documenter{GitHubActions}, Documenter{GitLabCI}, Documenter{TravisCI}, GitHubActions, GitLabCI, TravisCI, AppVeyor, DroneCI, CirrusCI, Codecov, Coveralls, BlueStyleBadge, ColPracBadge]
badge_order: DataType[Documenter{GitHubActions}, Documenter{GitLabCI}, Documenter{TravisCI}, GitHubActions, GitLabCI, TravisCI, AppVeyor, DroneCI, CirrusCI, Codecov, Coveralls, BlueStyleBadge, ColPracBadge, PkgEvalBadge]
badge_off: DataType[]
SrcDir:
file: "$(joinpath(TEMPLATES_DIR, "src", "module.jl"))"
Expand Down

0 comments on commit 515c2bc

Please sign in to comment.