Skip to content

Commit

Permalink
move to gh actions for ci
Browse files Browse the repository at this point in the history
  • Loading branch information
nbenn committed Mar 6, 2020
1 parent 06e16c7 commit fddf6ed
Show file tree
Hide file tree
Showing 11 changed files with 209 additions and 89 deletions.
2 changes: 2 additions & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,5 @@
^_pkgdown\.yml$
^docs$
^pkgdown$
^codecov\.yml$
^\.github$
1 change: 1 addition & 0 deletions .github/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.html
86 changes: 86 additions & 0 deletions .github/workflows/R-CMD-check.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
on:
push:
branches:
- master
pull_request:
branches:
- master

name: R-CMD-check

jobs:
R-CMD-check:
runs-on: ${{ matrix.config.os }}

name: ${{ matrix.config.os }} (${{ matrix.config.r }})

strategy:
fail-fast: false
matrix:
config:
- {os: windows-latest, r: '3.6'}
- {os: macOS-latest, r: '3.6'}
- {os: macOS-latest, r: 'devel'}
- {os: ubuntu-16.04, r: '3.2', cran: "https://demo.rstudiopm.com/all/__linux__/xenial/latest"}
- {os: ubuntu-16.04, r: '3.3', cran: "https://demo.rstudiopm.com/all/__linux__/xenial/latest"}
- {os: ubuntu-16.04, r: '3.4', cran: "https://demo.rstudiopm.com/all/__linux__/xenial/latest"}
- {os: ubuntu-16.04, r: '3.5', cran: "https://demo.rstudiopm.com/all/__linux__/xenial/latest"}
- {os: ubuntu-16.04, r: '3.6', cran: "https://demo.rstudiopm.com/all/__linux__/xenial/latest"}

env:
R_REMOTES_NO_ERRORS_FROM_WARNINGS: true
CRAN: ${{ matrix.config.cran }}

steps:
- uses: actions/checkout@v2

- uses: r-lib/actions/setup-r@master
with:
r-version: ${{ matrix.config.r }}

- uses: r-lib/actions/setup-pandoc@master

- name: Query dependencies
run: |
install.packages('remotes')
saveRDS(remotes::dev_package_deps(dependencies = TRUE), "depends.Rds", version = 2)
shell: Rscript {0}

- name: Cache R packages
if: runner.os != 'Windows'
uses: actions/cache@v1
with:
path: ${{ env.R_LIBS_USER }}
key: ${{ runner.os }}-r-${{ matrix.config.r }}-${{ hashFiles('depends.Rds') }}
restore-keys: ${{ runner.os }}-r-${{ matrix.config.r }}-

- name: Install system dependencies
if: runner.os == 'Linux'
env:
RHUB_PLATFORM: linux-x86_64-ubuntu-gcc
run: |
Rscript -e "remotes::install_github('r-hub/sysreqs')"
sysreqs=$(Rscript -e "cat(sysreqs::sysreq_commands('DESCRIPTION'))")
sudo -s eval "$sysreqs"
- name: Install dependencies
run: |
remotes::install_deps(dependencies = TRUE)
remotes::install_cran("rcmdcheck")
shell: Rscript {0}

- name: Check
run: rcmdcheck::rcmdcheck(args = "--no-manual", error_on = "warning", check_dir = "check")
shell: Rscript {0}

- name: Upload check results
if: failure()
uses: actions/upload-artifact@master
with:
name: ${{ runner.os }}-r${{ matrix.config.r }}-results
path: check

- name: Test coverage
if: matrix.config.os == 'macOS-latest' && matrix.config.r == '3.6'
run: covr::codecov(token = "${{secrets.CODECOV_TOKEN}}")
shell: Rscript {0}
24 changes: 24 additions & 0 deletions .github/workflows/pkgdown.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
on:
push:
branches: master

name: pkgdown

jobs:
pkgdown:
runs-on: macOS-latest
steps:
- uses: actions/checkout@v2
- uses: r-lib/actions/setup-r@master
- uses: r-lib/actions/setup-pandoc@master
- name: Install dependencies
run: |
install.packages("remotes")
remotes::install_deps(dependencies = TRUE)
remotes::install_dev("pkgdown")
shell: Rscript {0}
- name: Install package
run: R CMD INSTALL .
- name: Deploy package
run: pkgdown::deploy_to_branch(new_process = FALSE)
shell: Rscript {0}
52 changes: 52 additions & 0 deletions .github/workflows/pr-commands.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
on:
issue_comment:
types: [created]
name: Commands
jobs:
document:
if: startsWith(github.event.comment.body, '/document')
name: document
runs-on: macOS-latest
steps:
- uses: actions/checkout@v2
- uses: r-lib/actions/pr-fetch@master
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- uses: r-lib/actions/setup-r@master
- name: Install dependencies
run: Rscript -e 'install.packages(c("remotes", "roxygen2"))' -e 'remotes::install_deps(dependencies = TRUE)'
- name: Document
run: Rscript -e 'roxygen2::roxygenise()'
- name: commit
run: |
git add man/\* NAMESPACE
git commit -m 'Document'
- uses: r-lib/actions/pr-push@master
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
style:
if: startsWith(github.event.comment.body, '/style')
name: style
runs-on: macOS-latest
steps:
- uses: actions/checkout@v2
- uses: r-lib/actions/pr-fetch@master
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- uses: r-lib/actions/setup-r@master
- name: Install dependencies
run: Rscript -e 'install.packages("styler")'
- name: Style
run: Rscript -e 'styler::style_pkg()'
- name: commit
run: |
git add \*.R
git commit -m 'Style'
- uses: r-lib/actions/pr-push@master
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
# A mock job just to ensure we have a successful build status
finish:
runs-on: ubuntu-latest
steps:
- run: true
24 changes: 24 additions & 0 deletions .github/workflows/render-readme.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
on:
push:
paths:
- examples/README.Rmd
- examples/*yaml

name: Render README

jobs:
render:
name: Render README
runs-on: macOS-latest
steps:
- uses: actions/checkout@v2
- uses: r-lib/actions/setup-r@v1
- uses: r-lib/actions/setup-pandoc@v1
- name: Install rmarkdown
run: Rscript -e 'install.packages("rmarkdown")'
- name: Render README
run: Rscript -e 'rmarkdown::render("examples/README.Rmd")'
- name: Commit results
run: |
git commit examples/README.md -m 'Re-build README.Rmd' || echo "No changes to commit"
git push https://${{github.actor}}:${{secrets.GITHUB_TOKEN}}@github.com/${{github.repository}}.git HEAD:${{ github.ref }} || echo "No changes to commit"
18 changes: 0 additions & 18 deletions .travis.yml

This file was deleted.

3 changes: 2 additions & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,9 @@ Authors@R:
License: GPL-3
Encoding: UTF-8
LazyData: true
URL: https://github.com/septic-tank/ricu
Depends:
R (>= 3.1.0)
R (>= 3.2.0)
Imports:
data.table,
curl,
Expand Down
14 changes: 6 additions & 8 deletions README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -14,23 +14,21 @@ knitr::opts_chunk$set(
out.width = "100%"
)
```
# sepsr
# ricu

<!-- badges: start -->
[![Travis build status](https://travis-ci.com/septic-tank/sepsr.svg?branch=master)](https://travis-ci.com/septic-tank/sepsr)
[![Azure pipelines build status](https://img.shields.io/azure-devops/build/septic-tank/sepsr/2)](https://dev.azure.com/septic-tank/sepsr/_build/latest?definitionId=1&branchName=master)
[![Azure pipelines test status](https://img.shields.io/azure-devops/tests/septic-tank/sepsr/2?color=brightgreen&compact_message)](https://dev.azure.com/septic-tank/sepsr/_build/latest?definitionId=1&branchName=master)
[![Azure pipelines coverage status](https://img.shields.io/azure-devops/coverage/septic-tank/sepsr/2)](https://dev.azure.com/septic-tank/sepsr/_build/latest?definitionId=1&branchName=master)
[![R build status](https://github.com/septic-tank/ricu/workflows/R-CMD-check/badge.svg)](https://github.com/septic-tank/ricu/actions)
[![Codecov test coverage](https://codecov.io/gh/septic-tank/ricu/branch/master/graph/badge.svg)](https://codecov.io/gh/septic-tank/ricu?branch=master)
<!-- badges: end -->

The goal of sepsr is to ...
The goal of ricu is to ...

## Installation

You can install the released version of sepsr from [CRAN](https://CRAN.R-project.org) with:
You can install the released version of ricu from [CRAN](https://CRAN.R-project.org) with:

``` r
install.packages("sepsr")
install.packages("ricu")
```

## Example
Expand Down
62 changes: 0 additions & 62 deletions azure-pipelines.yml

This file was deleted.

12 changes: 12 additions & 0 deletions codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
comment: false

coverage:
status:
project:
default:
target: auto
threshold: 1%
patch:
default:
target: auto
threshold: 1%

0 comments on commit fddf6ed

Please sign in to comment.