Skip to content

Commit

Permalink
minor version bump, set up GH actions, retire Travis
Browse files Browse the repository at this point in the history
  • Loading branch information
clauswilke committed Dec 15, 2020
1 parent 901173d commit 5f2256e
Show file tree
Hide file tree
Showing 8 changed files with 148 additions and 38 deletions.
83 changes: 83 additions & 0 deletions .github/workflows/R-CMD-check.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
on:
push:
branches:
- main
- master
pull_request:
branches:
- main
- 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', vdiffr: true}
- {os: macOS-latest, r: 'release', vdiffr: true}
- {os: ubuntu-20.04, r: 'release', vdiffr: true, rspm: "https://packagemanager.rstudio.com/cran/__linux__/focal/latest"}
- {os: ubuntu-20.04, r: 'devel', vdiffr: false, rspm: "https://packagemanager.rstudio.com/cran/__linux__/focal/latest"}

env:
R_REMOTES_NO_ERRORS_FROM_WARNINGS: true
RSPM: ${{ matrix.config.rspm }}
VDIFFR_RUN_TESTS: ${{ matrix.config.vdiffr }}
VDIFFR_LOG_PATH: "../vdiffr.Rout.fail"

steps:
- uses: actions/checkout@v2

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

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

- name: Query dependencies
run: |
install.packages('remotes')
saveRDS(remotes::dev_package_deps(dependencies = TRUE), ".github/depends.Rds", version = 2)
writeLines(sprintf("R-%i.%i", getRversion()$major, getRversion()$minor), ".github/R-version")
shell: Rscript {0}

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

- name: Install system dependencies
if: runner.os == 'Linux'
run: |
while read -r cmd
do
eval sudo $cmd
done < <(Rscript -e 'writeLines(remotes::system_requirements("ubuntu", "20.04"))')
- name: Install dependencies
run: |
remotes::install_deps(dependencies = TRUE)
remotes::install_cran("rcmdcheck")
shell: Rscript {0}

- name: Check
env:
_R_CHECK_CRAN_INCOMING_REMOTE_: false
run: rcmdcheck::rcmdcheck(args = c("--no-manual", "--as-cran"), error_on = "warning", check_dir = "check")
shell: Rscript {0}

- name: Upload check results
if: failure()
uses: actions/upload-artifact@main
with:
name: ${{ runner.os }}-r${{ matrix.config.r }}-results
path: check
48 changes: 48 additions & 0 deletions .github/workflows/test-coverage.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
on:
push:
branches:
- main
- master
pull_request:
branches:
- main
- master

name: test-coverage

jobs:
test-coverage:
runs-on: macOS-latest

steps:
- uses: actions/checkout@v2

- uses: r-lib/actions/setup-r@v1

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

- name: Query dependencies
run: |
install.packages('remotes')
saveRDS(remotes::dev_package_deps(dependencies = TRUE), ".github/depends.Rds", version = 2)
writeLines(sprintf("R-%i.%i", getRversion()$major, getRversion()$minor), ".github/R-version")
shell: Rscript {0}

- name: Cache R packages
uses: actions/cache@v2
with:
path: ${{ env.R_LIBS_USER }}
key: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-${{ hashFiles('.github/depends.Rds') }}
restore-keys: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-

- name: Install dependencies
run: |
install.packages(c("remotes"))
remotes::install_deps(dependencies = TRUE)
remotes::install_cran("covr")
shell: Rscript {0}

- name: Test coverage
run: covr::codecov()
shell: Rscript {0}

25 changes: 0 additions & 25 deletions .travis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: cowplot
Title: Streamlined Plot Theme and Plot Annotations for 'ggplot2'
Version: 1.1.0
Version: 1.1.1
Authors@R:
person(
given = "Claus O.",
Expand Down
4 changes: 4 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# cowplot 1.1.1

- Make sure tests don't fail if vdiffr is missing.

# cowplot 1.1.0

- `plot_grid()` now accepts `byrow` as an argument to place plots by row or by column onto the plot area (@BrianLang, #162).
Expand Down
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
# cowplot – Streamlined plot theme and plot annotations for ggplot2

<!-- badges: start -->

[![Build Status](https://travis-ci.org/wilkelab/cowplot.svg?branch=master)](https://travis-ci.org/wilkelab/cowplot)
[![R build status](https://github.com/wilkelab/cowplot/workflows/R-CMD-check/badge.svg)](https://github.com/wilkelab/cowplot/actions)
[![Coverage Status](https://img.shields.io/codecov/c/github/wilkelab/cowplot/master.svg)](https://codecov.io/github/wilkelab/cowplot?branch=master)
[![CRAN\_Status\_Badge](https://www.r-pkg.org/badges/version/cowplot)](https://CRAN.R-project.org/package=cowplot)
[![CRAN\_Downloads\_Badge](https://cranlogs.r-pkg.org/badges/cowplot)](https://cranlogs.r-pkg.org/downloads/total/last-month/cowplot)
Expand Down
12 changes: 7 additions & 5 deletions cran-comments.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
This is a minor release fixing a few bugs and adding a few
minor features. No downstream breakage is expected.
Make sure tests don't fail just because vdiffr couldn't be installed, per request by Brian Ripley.

## Test environments
* R devel on win-builder [ via devtools::check_win_devel() ]
* R devel and R release on Linux (via Travis CI)

* ubuntu 20.04, devel and release
* windows, release
* macOS, release

## R CMD check results
There were no ERRORs, WARNINGs, or NOTEs.

0 errors | 0 warnings | 0 notes
9 changes: 4 additions & 5 deletions tests/testthat/helper-vdiffr.R
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# vdiffr ignores failures when
# - VDIFFR_RUN_TESTS is "false" (on Travis CI with older versions and dev version of R)
# - CI is not set (on CRAN)

expect_doppelganger <- vdiffr::expect_doppelganger
expect_doppelganger <- function(title, fig, path = NULL, ...) {
testthat::skip_if_not_installed("vdiffr")
vdiffr::expect_doppelganger(title, fig, path = path, ...)
}

0 comments on commit 5f2256e

Please sign in to comment.