Skip to content

Commit

Permalink
Get current with tidyverse GitHub Actions setup
Browse files Browse the repository at this point in the history
- drop the tibble 1.4.2 run
- split test coverage into own workflow
- restore installation of tidyverse and devtools for pkgdown
- restore previous covr line exclusions from .travis.yml
  • Loading branch information
jennybc committed Apr 22, 2020
1 parent f922381 commit 294b476
Show file tree
Hide file tree
Showing 9 changed files with 181 additions and 47 deletions.
2 changes: 0 additions & 2 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,3 @@
^investigations$
^src/patch-to-libxls-upstream\.R$
^LICENSE\.md$
^\.github/workflows/R-CMD-check\.yaml$
^\.github/workflows/pkgdown\.yaml$
1 change: 1 addition & 0 deletions .github/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.html
49 changes: 24 additions & 25 deletions .github/workflows/R-CMD-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,28 +12,27 @@ jobs:
R-CMD-check:
runs-on: ${{ matrix.config.os }}

name: ${{ matrix.config.os }} (${{ matrix.config.r }}) ${{ matrix.config.tibble_version }}
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: '3.6', tibble_version: 'tibble 1.4.2'}
- { 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"}
- {os: windows-latest, r: '3.6'}
- {os: macOS-latest, r: '3.6'}
- {os: macOS-latest, r: 'devel'}
- {os: ubuntu-16.04, r: '3.2', rspm: "https://demo.rstudiopm.com/all/__linux__/xenial/latest"}
- {os: ubuntu-16.04, r: '3.3', rspm: "https://demo.rstudiopm.com/all/__linux__/xenial/latest"}
- {os: ubuntu-16.04, r: '3.4', rspm: "https://demo.rstudiopm.com/all/__linux__/xenial/latest"}
- {os: ubuntu-16.04, r: '3.5', rspm: "https://demo.rstudiopm.com/all/__linux__/xenial/latest"}
- {os: ubuntu-16.04, r: '3.6', rspm: "https://demo.rstudiopm.com/all/__linux__/xenial/latest"}

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

steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v2

- uses: r-lib/actions/setup-r@master
with:
Expand All @@ -42,14 +41,17 @@ jobs:
- uses: r-lib/actions/setup-pandoc@master

- name: Query dependencies
run: Rscript -e "install.packages('remotes')" -e "saveRDS(remotes::dev_package_deps(dependencies = TRUE), 'depends.Rds', version = 2)"
run: |
install.packages('remotes')
saveRDS(remotes::dev_package_deps(dependencies = TRUE), ".github/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') }}
key: ${{ runner.os }}-r-${{ matrix.config.r }}-${{ hashFiles('.github/depends.Rds') }}
restore-keys: ${{ runner.os }}-r-${{ matrix.config.r }}-

- name: Install system dependencies
Expand All @@ -62,23 +64,20 @@ jobs:
sudo -s eval "$sysreqs"
- name: Install dependencies
run: Rscript -e "library(remotes)" -e "update(readRDS('depends.Rds'))" -e "remotes::install_cran('rcmdcheck')"

- name: Install tibble 1.4.2
if: matrix.config.tibble_version == 'tibble 1.4.2'
run: Rscript -e "remotes::install_github('tidyverse/tibble', ref = 'v1.4.2')"
run: |
remotes::install_deps(dependencies = TRUE)
remotes::install_cran("rcmdcheck")
shell: Rscript {0}

- name: Check
run: Rscript -e "rcmdcheck::rcmdcheck(args = '--no-manual', error_on = 'warning', check_dir = '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@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: |
Rscript -e 'covr::codecov(token = "${{secrets.CODECOV_TOKEN}}")'
36 changes: 28 additions & 8 deletions .github/workflows/pkgdown.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,44 @@ on:
push:
branches: master

name: Pkgdown
name: pkgdown

jobs:
pkgdown:
runs-on: macOS-latest
steps:
- uses: actions/checkout@master
- 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), ".github/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('.github/depends.Rds') }}
restore-keys: macOS-r-3.6-

- name: Install dependencies
run: |
Rscript -e 'install.packages("remotes")' \
-e 'remotes::install_deps(dependencies = TRUE)' \
-e 'remotes::install_github("jimhester/pkgdown@github-actions-deploy")' \
-e 'remotes::install_github("tidyverse/tidytemplate")'
install.packages("remotes")
remotes::install_deps(dependencies = TRUE)
remotes::install_dev("pkgdown")
remotes::install_github("tidyverse/tidytemplate")
remotes::install_cran("tidyverse")
remotes::install_cran("devtools")
shell: Rscript {0}

- name: Install package
run: R CMD INSTALL .

- name: Deploy package
run: |
pkgdown:::deploy_local(new_process = FALSE, remote_url = 'https://x-access-token:${{secrets.DEPLOY_PAT}}@github.com/${{github.repository}}.git')
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
43 changes: 43 additions & 0 deletions .github/workflows/test-coverage.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
on:
push:
branches:
- master
pull_request:
branches:
- master

name: test-coverage

jobs:
test-coverage:
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), ".github/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('.github/depends.Rds') }}
restore-keys: macOS-r-3.6-

- 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(line_exclusions = c("src/xls.c", "src/xlstool.c", "src/rapidxml.h", "src/rapidxml_print.h", "src/endian.c", "src/ole.c", "src/libxls/brdb.h"))
shell: Rscript {0}
7 changes: 6 additions & 1 deletion README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,12 @@ knitr::opts_chunk$set(

# readxl <img src='man/figures/logo.png' align="right" height="139" />

[![CRAN_Status_Badge](https://www.r-pkg.org/badges/version/readxl)](https://cran.r-project.org/package=readxl) [![R build status](https://github.com/tidyverse/readxl/workflows/R-CMD-check/badge.svg)](https://github.com/tidyverse/readxl) [![Coverage Status](https://img.shields.io/codecov/c/github/tidyverse/readxl/master.svg)](https://codecov.io/github/tidyverse/readxl?branch=master) [![lifecycle](https://img.shields.io/badge/lifecycle-stable-brightgreen.svg)](https://www.tidyverse.org/lifecycle/#stable)
<!-- badges: start -->
[![CRAN_Status_Badge](https://www.r-pkg.org/badges/version/readxl)](https://cran.r-project.org/package=readxl)
[![R build status](https://github.com/tidyverse/readxl/workflows/R-CMD-check/badge.svg)](https://github.com/tidyverse/readxl/actions)
[![Codecov test coverage](https://codecov.io/gh/tidyverse/readxl/branch/master/graph/badge.svg)](https://codecov.io/gh/tidyverse/readxl?branch=master)
[![lifecycle](https://img.shields.io/badge/lifecycle-stable-brightgreen.svg)](https://www.tidyverse.org/lifecycle/#stable)
<!-- badges: end -->

## Overview

Expand Down
25 changes: 14 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,15 @@

# readxl <img src='man/figures/logo.png' align="right" height="139" />

<!-- badges: start -->

[![CRAN\_Status\_Badge](https://www.r-pkg.org/badges/version/readxl)](https://cran.r-project.org/package=readxl)
[![R build
status](https://github.com/tidyverse/readxl/workflows/R-CMD-check/badge.svg)](https://github.com/tidyverse/readxl)
[![Coverage
Status](https://img.shields.io/codecov/c/github/tidyverse/readxl/master.svg)](https://codecov.io/github/tidyverse/readxl?branch=master)
status](https://github.com/tidyverse/readxl/workflows/R-CMD-check/badge.svg)](https://github.com/tidyverse/readxl/actions)
[![Codecov test
coverage](https://codecov.io/gh/tidyverse/readxl/branch/master/graph/badge.svg)](https://codecov.io/gh/tidyverse/readxl?branch=master)
[![lifecycle](https://img.shields.io/badge/lifecycle-stable-brightgreen.svg)](https://www.tidyverse.org/lifecycle/#stable)
<!-- badges: end -->

## Overview

Expand Down Expand Up @@ -65,7 +68,7 @@ readxl_example()
#> [5] "deaths.xls" "deaths.xlsx" "geometry.xls" "geometry.xlsx"
#> [9] "type-me.xls" "type-me.xlsx"
readxl_example("clippy.xls")
#> [1] "C:/Users/salbers/R/win-library/3.6/readxl/extdata/clippy.xls"
#> [1] "/Users/jenny/Library/R/3.6/library/readxl/extdata/clippy.xls"
```

`read_excel()` reads both xls and xlsx files and detects the format from
Expand All @@ -80,7 +83,7 @@ read_excel(xlsx_example)
#> 1 5.1 3.5 1.4 0.2 setosa
#> 2 4.9 3 1.4 0.2 setosa
#> 3 4.7 3.2 1.3 0.2 setosa
#> # ... with 147 more rows
#> # with 147 more rows

xls_example <- readxl_example("datasets.xls")
read_excel(xls_example)
Expand All @@ -90,7 +93,7 @@ read_excel(xls_example)
#> 1 5.1 3.5 1.4 0.2 setosa
#> 2 4.9 3 1.4 0.2 setosa
#> 3 4.7 3.2 1.3 0.2 setosa
#> # ... with 147 more rows
#> # with 147 more rows
```

List the sheet names with `excel_sheets()`.
Expand All @@ -110,15 +113,15 @@ read_excel(xlsx_example, sheet = "chickwts")
#> 1 179 horsebean
#> 2 160 horsebean
#> 3 136 horsebean
#> # ... with 68 more rows
#> # with 68 more rows
read_excel(xls_example, sheet = 4)
#> # A tibble: 1,000 x 5
#> lat long depth mag stations
#> <dbl> <dbl> <dbl> <dbl> <dbl>
#> 1 -20.4 182. 562 4.8 41
#> 2 -20.6 181. 650 4.2 15
#> 3 -26 184. 42 5.4 43
#> # ... with 997 more rows
#> # with 997 more rows
```

There are various ways to control which cells are read. You can even
Expand Down Expand Up @@ -153,15 +156,15 @@ read_excel(xlsx_example, range = cell_cols("B:D"))
#> 1 3.5 1.4 0.2
#> 2 3 1.4 0.2
#> 3 3.2 1.3 0.2
#> # ... with 147 more rows
#> # with 147 more rows
read_excel(xlsx_example, range = "mtcars!B1:D5")
#> # A tibble: 4 x 3
#> cyl disp hp
#> <dbl> <dbl> <dbl>
#> 1 6 160 110
#> 2 6 160 110
#> 3 4 108 93
#> # ... with 1 more row
#> # with 1 more row
```

If `NA`s are represented by something other than blank cells, set the
Expand All @@ -175,7 +178,7 @@ read_excel(xlsx_example, na = "setosa")
#> 1 5.1 3.5 1.4 0.2 <NA>
#> 2 4.9 3 1.4 0.2 <NA>
#> 3 4.7 3.2 1.3 0.2 <NA>
#> # ... with 147 more rows
#> # with 147 more rows
```

If you are new to the tidyverse conventions for data import, you may
Expand Down
13 changes: 13 additions & 0 deletions codecov.yml
Original file line number Diff line number Diff line change
@@ -1 +1,14 @@
comment: false

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

0 comments on commit 294b476

Please sign in to comment.