Skip to content

Create custom project badges in R

License

Unknown, MIT licenses found

Licenses found

Unknown
LICENSE
MIT
LICENSE.md
Notifications You must be signed in to change notification settings

lmeninato/anybadger

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

anybadger

R-CMD-check Codecov test coverage CRAN status

The goal of anybadger is to provide an easy way to create custom project badges in R.

Inspired heavily by the Python anybadge library.

This is useful in a GitLab CI/CD pipeline where you are behind a proxy and cannot easily use external services to create/store pipeline badges.

For instance, to add a custom badge in your pipeline using R you could do the following in your .gitlab-ci.yml file:

script:
  - Rscript -e "remotes::install_github('lmeninato/anybadger')"
  - Rscript -e "anybadger::create_badge('anybadger.svg', label = 'any', value = 'badger')"
artifacts:
  paths:
    - anybadger.svg

And then access the raw svg file from GitLab with %{path}/builds/artifacts/%{branch}/raw/anybadger.svg?job=%{job_name}.

Installation

# this is preferred right now as there is a bug in the first CRAN release
remotes::install_github("lmeninato/anybadger")

# in a few weeks this will be bug-free :)

install.packages("anybadger")

Example

Pipeline badge:

library(anybadger)

# the easiest way to create a badge
create_badge(tmp, label = "any", value = "badger", color = "fuchsia")

# if you want access to the low level Badge constructor and class:
b <- Badge$new(label = "Pipeline", value = "Passing")
b$create_svg("pipeline_status.svg")

About

Create custom project badges in R

Resources

License

Unknown, MIT licenses found

Licenses found

Unknown
LICENSE
MIT
LICENSE.md

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages