Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/ropensci-archive/travis-goodpractice

:no_entry: ARCHIVED :no_entry:
https://github.com/ropensci-archive/travis-goodpractice

Last synced: 3 months ago
JSON representation

:no_entry: ARCHIVED :no_entry:

Awesome Lists containing this project

README

        

[![Project Status: WIP – Initial development is in progress, but there has not yet been a stable, usable release suitable for the public.](http://www.repostatus.org/badges/latest/wip.svg)](http://www.repostatus.org/#wip)

goodpractice setup for your .travis.yml file
============================================

As part of rOpenSci onboarding/software review we run the [goodpractice][] package on each submission. This is done manually right now, then we paste in the output into the issue.

We have been wanting to automate running `goodpractice`. One approach is integrating with Travis-CI. This repo just has example `.travis.yml` files. In another repo(s) we'll have code for automating Travis builds with `goodpractice` and reporting the output back to the issue.

## Simple example

See [.simple-travis.yml](.simple-travis.yml)

```
language: r
sudo: false
cache: packages
dist: trusty

r_github_packages:
- MangoTheCat/goodpractice

after_success:
- Rscript -e 'Sys.setenv(NOT_CRAN = "true"); goodpractice::gp()'
```

## Deploy example

To deploy the output of `goodpractice` on Travis, you can use something like that in See [.deploy-travis.yml](.deploy-travis.yml), where we change the `after-success` declaration to:

```
after_success:
- Rscript -e 'Sys.setenv(NOT_CRAN = "true"); x = goodpractice::gp(); z = capture.output(x);
pkg = x$package[[1]]; pkgver = x$description$get_version(); dt = gsub(":|-", "_",
format(Sys.time(), format="%y-%h-%d_%T")); cat(z, file = sprintf("%s_%s_%s.txt",
pkg, pkgver, dt), sep = "\\n"); goodpractice::export_json(x, sprintf("%s_%s_%s.json",
pkg, pkgver, dt)); x'
```

And add an `addons` declaration to deploy to Amazon S3 (or somewhere else as you like)

```
addons:
artifacts:
s3_region: us-west-2
paths:
- $(git ls-files -o | grep -e '.txt' -e '.json' | tr "\n" ":")
```

If you deploy you'll likely need keys. You can add those in the Travis web console, or as global env vars like

```
env:
global:
- secure:
- secure:
```

[goodpractice]: https://github.com/MangoTheCat/goodpractice