Skip to content

Commit

Permalink
Switch to gh actions (#20)
Browse files Browse the repository at this point in the history
* Add github workflow

* Enable pkgdown

* Remove travis

* Update README page badge + vignette links.

* Bump requirement to R 3.5.0

* Only run actions on R >= 3.5
  • Loading branch information
coatless committed Mar 18, 2020
1 parent 7a0a947 commit acf01df
Show file tree
Hide file tree
Showing 7 changed files with 134 additions and 44 deletions.
2 changes: 2 additions & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,5 @@
^_pkgdown\.yml$
^docs$
^pkgdown$
^\.github/workflows/R-CMD-check\.yaml$
^\.github/workflows/pkgdown\.yaml$
78 changes: 78 additions & 0 deletions .github/workflows/R-CMD-check.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
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: 'release'}
- {os: macOS-latest, r: 'release'}
- {os: macOS-latest, r: 'devel'}
- {os: ubuntu-16.04, r: '3.5', rspm: "https://demo.rstudiopm.com/all/__linux__/xenial/latest"}
- {os: ubuntu-16.04, r: 'release', rspm: "https://demo.rstudiopm.com/all/__linux__/xenial/latest"}

env:
R_REMOTES_NO_ERRORS_FROM_WARNINGS: true
RSPM: ${{ matrix.config.rspm }}

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
42 changes: 42 additions & 0 deletions .github/workflows/pkgdown.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
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: Query dependencies
run: |
install.packages('remotes')
saveRDS(remotes::dev_package_deps(dependencies = TRUE), "depends.Rds", version = 2)
shell: Rscript {0}

- name: Cache R packages
uses: actions/cache@v1
with:
path: ${{ env.R_LIBS_USER }}
key: macOS-r-3.6-${{ hashFiles('depends.Rds') }}
restore-keys: macOS-r-3.6-

- 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}
34 changes: 0 additions & 34 deletions .travis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ URL: https://tmsalab.github.io/simcdm, https://github.com/tmsalab/simcdm
BugReports: https://github.com/tmsalab/simcdm/issues
License: GPL (>= 2)
Depends:
R (>= 3.4.0)
R (>= 3.5.0)
Imports: Rcpp (>= 1.0.0)
LinkingTo: Rcpp,
RcppArmadillo (>= 0.9.200)
Expand Down
8 changes: 4 additions & 4 deletions README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ knitr::opts_chunk$set(
# simcdm

<!-- badges: start -->
[![Build Status](https://travis-ci.com/tmsalab/simcdm.svg)](https://travis-ci.com/tmsalab/simcdm)
[![R build status](https://github.com/tmsalab/simcdm/workflows/R-CMD-check/badge.svg)](https://github.com/tmsalab/simcdm/actions)
[![Package-License](http://img.shields.io/badge/license-GPL%20(%3E=2)-brightgreen.svg?style=flat)](http://www.gnu.org/licenses/gpl-2.0.html)
[![CRAN Version Badge](http://www.r-pkg.org/badges/version/simcdm)](https://cran.r-project.org/package=simcdm)
[![CRAN Status](https://cranchecks.info/badges/worst/simcdm)](https://cran.r-project.org/web/checks/check_results_simcdm.html)
Expand Down Expand Up @@ -60,15 +60,15 @@ a later time, the `attribute_*()` will likely be moved to a different package.

For more details, please see the [package vignettes](vignettes/):

- [Overview of `simcdm`](vignettes/overview-simcdm.html)
- [Using `simcdm` in R packages](vignettes/simcdm-in-packages.html)
- [Overview of `simcdm`](https://tmsalab.github.io/simcdm/articles/overview-simcdm.html)
- [Using `simcdm` in R packages](https://tmsalab.github.io/simcdm/articles/simcdm-in-packages.html)

## Authors

James Joseph Balamuta and Steven Andrew Culpepper
with contributions from Aaron Hudson.

## Citing the `simcdm` package
## Citing the simcdm package

To ensure future development of the package, please cite `simcdm` package if
used during the analysis or simulations. Citation information for the package
Expand Down
12 changes: 7 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@

<!-- badges: start -->

[![Build
Status](https://travis-ci.com/tmsalab/simcdm.svg)](https://travis-ci.com/tmsalab/simcdm)
[![R build
status](https://github.com/tmsalab/simcdm/workflows/R-CMD-check/badge.svg)](https://github.com/tmsalab/simcdm/actions)
[![Package-License](http://img.shields.io/badge/license-GPL%20\(%3E=2\)-brightgreen.svg?style=flat)](http://www.gnu.org/licenses/gpl-2.0.html)
[![CRAN Version
Badge](http://www.r-pkg.org/badges/version/simcdm)](https://cran.r-project.org/package=simcdm)
Expand Down Expand Up @@ -59,15 +59,17 @@ likely be moved to a different package.

For more details, please see the [package vignettes](vignettes/):

- [Overview of `simcdm`](vignettes/overview-simcdm.html)
- [Using `simcdm` in R packages](vignettes/simcdm-in-packages.html)
- [Overview of
`simcdm`](https://tmsalab.github.io/simcdm/articles/overview-simcdm.html)
- [Using `simcdm` in R
packages](https://tmsalab.github.io/simcdm/articles/simcdm-in-packages.html)

## Authors

James Joseph Balamuta and Steven Andrew Culpepper with contributions
from Aaron Hudson.

## Citing the `simcdm` package
## Citing the simcdm package

To ensure future development of the package, please cite `simcdm`
package if used during the analysis or simulations. Citation information
Expand Down

0 comments on commit acf01df

Please sign in to comment.