Skip to content

Commit 7cb2eb5

Browse files
committed
use_tidy_github_actions()
1 parent bf35654 commit 7cb2eb5

File tree

7 files changed

+131
-43
lines changed

7 files changed

+131
-43
lines changed

.github/workflows/R-CMD-check.yaml

Lines changed: 26 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -18,18 +18,18 @@ jobs:
1818
fail-fast: false
1919
matrix:
2020
config:
21-
- { os: windows-latest, r: '3.6', sheets_auth: GOOGLESHEETS4_NOAUTH, error_on: 'warning'}
22-
- { os: macOS-latest, r: '3.6', sheets_auth: GOOGLESHEETS4_PASSWORD, error_on: 'warning'}
23-
- { os: macOS-latest, r: 'devel', sheets_auth: GOOGLESHEETS4_NOAUTH, error_on: 'warning'}
24-
- { os: ubuntu-16.04, r: '3.2', sheets_auth: GOOGLESHEETS4_NOAUTH, cran: "https://demo.rstudiopm.com/all/__linux__/xenial/latest", error_on: 'error'}
25-
- { os: ubuntu-16.04, r: '3.3', sheets_auth: GOOGLESHEETS4_NOAUTH, cran: "https://demo.rstudiopm.com/all/__linux__/xenial/latest", error_on: 'warning'}
26-
- { os: ubuntu-16.04, r: '3.4', sheets_auth: GOOGLESHEETS4_NOAUTH, cran: "https://demo.rstudiopm.com/all/__linux__/xenial/latest", error_on: 'warning'}
27-
- { os: ubuntu-16.04, r: '3.5', sheets_auth: GOOGLESHEETS4_NOAUTH, cran: "https://demo.rstudiopm.com/all/__linux__/xenial/latest", error_on: 'warning'}
28-
- { os: ubuntu-16.04, r: '3.6', sheets_auth: GOOGLESHEETS4_NOAUTH, cran: "https://demo.rstudiopm.com/all/__linux__/xenial/latest", error_on: 'warning'}
21+
- {os: windows-latest, r: '3.6', sheets_auth: GOOGLESHEETS4_NOAUTH}
22+
- {os: macOS-latest, r: '3.6', sheets_auth: GOOGLESHEETS4_PASSWORD}
23+
- {os: macOS-latest, r: 'devel', sheets_auth: GOOGLESHEETS4_NOAUTH}
24+
- {os: ubuntu-16.04, r: '3.2', sheets_auth: GOOGLESHEETS4_NOAUTH, rspm: "https://demo.rstudiopm.com/all/__linux__/xenial/latest"}
25+
- {os: ubuntu-16.04, r: '3.3', sheets_auth: GOOGLESHEETS4_NOAUTH, rspm: "https://demo.rstudiopm.com/all/__linux__/xenial/latest"}
26+
- {os: ubuntu-16.04, r: '3.4', sheets_auth: GOOGLESHEETS4_NOAUTH, rspm: "https://demo.rstudiopm.com/all/__linux__/xenial/latest"}
27+
- {os: ubuntu-16.04, r: '3.5', sheets_auth: GOOGLESHEETS4_NOAUTH, rspm: "https://demo.rstudiopm.com/all/__linux__/xenial/latest"}
28+
- {os: ubuntu-16.04, r: '3.6', sheets_auth: GOOGLESHEETS4_NOAUTH, rspm: "https://demo.rstudiopm.com/all/__linux__/xenial/latest"}
2929

3030
env:
3131
R_REMOTES_NO_ERRORS_FROM_WARNINGS: true
32-
CRAN: ${{ matrix.config.cran }}
32+
RSPM: ${{ matrix.config.rspm }}
3333
GOOGLESHEETS4_PASSWORD: ${{ secrets[matrix.config.sheets_auth] }}
3434

3535
steps:
@@ -42,7 +42,10 @@ jobs:
4242
- uses: r-lib/actions/setup-pandoc@master
4343

4444
- name: Query dependencies
45-
run: Rscript -e "install.packages('remotes')" -e "saveRDS(remotes::dev_package_deps(dependencies = TRUE), 'depends.Rds', version = 2)"
45+
run: |
46+
install.packages('remotes')
47+
saveRDS(remotes::dev_package_deps(dependencies = TRUE), "depends.Rds", version = 2)
48+
shell: Rscript {0}
4649

4750
- name: Cache R packages
4851
if: runner.os != 'Windows'
@@ -52,7 +55,7 @@ jobs:
5255
key: ${{ runner.os }}-r-${{ matrix.config.r }}-${{ hashFiles('depends.Rds') }}
5356
restore-keys: ${{ runner.os }}-r-${{ matrix.config.r }}-
5457

55-
- name: Install linux system dependencies
58+
- name: Install system dependencies
5659
if: runner.os == 'Linux'
5760
env:
5861
RHUB_PLATFORM: linux-x86_64-ubuntu-gcc
@@ -61,15 +64,21 @@ jobs:
6164
sysreqs=$(Rscript -e "cat(sysreqs::sysreq_commands('DESCRIPTION'))")
6265
sudo -s eval "$sysreqs"
6366
64-
- name: Install macOS system dependencies
65-
if: matrix.config.os == 'macOS-latest' && matrix.config.r == 'devel'
66-
run: brew install libsodium
67-
67+
- name: Install libsodium on devel macOS
68+
if: runner.os == 'macOS' && matrix.config.r == 'devel'
69+
run: brew install libsodium
70+
x
6871
- name: Install dependencies
69-
run: Rscript -e "library(remotes)" -e "update(readRDS('depends.Rds'))" -e "remotes::install_cran('rcmdcheck')" -e "remotes::install_cran('tidyverse')" -e "remotes::install_github('hadley/emo')"
72+
run: |
73+
remotes::install_deps(dependencies = TRUE)
74+
remotes::install_cran("rcmdcheck")
75+
remotes::install_cran("tidyverse")
76+
remotes::install_github("hadley/emo")
77+
shell: Rscript {0}
7078

7179
- name: Check
72-
run: Rscript -e "rcmdcheck::rcmdcheck(args = c('--no-manual', '--ignore-vignettes', '--no-examples'), build_args = '--no-build-vignettes', error_on = '${{ matrix.config.error_on }}', check_dir = 'check')"
80+
run: rcmdcheck::rcmdcheck(args = c("--no-manual", "--ignore-vignettes", "--no-examples"), build_args = "--no-build-vignettes", error_on = "${{ matrix.config.error_on }}", check_dir = "check")
81+
shell: Rscript {0}
7382

7483
- name: Upload check results
7584
if: failure()

.github/workflows/pkgdown.yaml

Lines changed: 23 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ on:
22
push:
33
branches: master
44

5-
name: Pkgdown
5+
name: pkgdown
66

77
jobs:
88
pkgdown:
@@ -13,25 +13,37 @@ jobs:
1313

1414
steps:
1515
- uses: actions/checkout@v2
16+
1617
- uses: r-lib/actions/setup-r@master
18+
1719
- uses: r-lib/actions/setup-pandoc@master
1820

19-
- name: Install macOS system dependencies
20-
run: brew install libsodium
21+
- name: Query dependencies
22+
run: |
23+
install.packages('remotes')
24+
saveRDS(remotes::dev_package_deps(dependencies = TRUE), "depends.Rds", version = 2)
25+
shell: Rscript {0}
26+
27+
- name: Cache R packages
28+
uses: actions/cache@v1
29+
with:
30+
path: ${{ env.R_LIBS_USER }}
31+
key: macOS-r-3.6-${{ hashFiles('depends.Rds') }}
32+
restore-keys: macOS-r-3.6-
2133

2234
- name: Install dependencies
2335
run: |
24-
Rscript -e 'install.packages("remotes")' \
25-
-e 'remotes::install_deps(dependencies = TRUE)' \
26-
-e 'remotes::install_cran("tidyverse")' \
27-
-e 'remotes::install_github("tidyverse/tidytemplate")' \
28-
-e 'remotes::install_github("hadley/emo")' \
29-
-e 'remotes::install_github("jimhester/pkgdown@github-actions-deploy")'
36+
install.packages("remotes")
37+
remotes::install_deps(dependencies = TRUE)
38+
remotes::install_cran("tidyverse")
39+
remotes::install_github("tidyverse/tidytemplate")
40+
remotes::install_github("hadley/emo")
41+
remotes::install_dev("pkgdown")
42+
shell: Rscript {0}
3043

3144
- name: Install package
3245
run: R CMD INSTALL .
3346

3447
- name: Deploy package
35-
run: |
36-
pkgdown:::deploy_local(new_process = FALSE, remote_url = 'https://x-access-token:${{secrets.DEPLOY_PAT}}@github.com/${{github.repository}}.git')
48+
run: pkgdown::deploy_to_branch(new_process = FALSE)
3749
shell: Rscript {0}

.github/workflows/pr-commands.yaml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
on:
2+
issue_comment:
3+
types: [created]
4+
name: Commands
5+
jobs:
6+
document:
7+
if: startsWith(github.event.comment.body, '/document')
8+
name: document
9+
runs-on: macOS-latest
10+
steps:
11+
- uses: actions/checkout@v2
12+
- uses: r-lib/actions/pr-fetch@master
13+
with:
14+
repo-token: ${{ secrets.GITHUB_TOKEN }}
15+
- uses: r-lib/actions/setup-r@master
16+
- name: Install dependencies
17+
run: Rscript -e 'install.packages(c("remotes", "roxygen2"))' -e 'remotes::install_deps(dependencies = TRUE)'
18+
- name: Document
19+
run: Rscript -e 'roxygen2::roxygenise()'
20+
- name: commit
21+
run: |
22+
git add man/\* NAMESPACE
23+
git commit -m 'Document'
24+
- uses: r-lib/actions/pr-push@master
25+
with:
26+
repo-token: ${{ secrets.GITHUB_TOKEN }}
27+
style:
28+
if: startsWith(github.event.comment.body, '/style')
29+
name: style
30+
runs-on: macOS-latest
31+
steps:
32+
- uses: actions/checkout@v2
33+
- uses: r-lib/actions/pr-fetch@master
34+
with:
35+
repo-token: ${{ secrets.GITHUB_TOKEN }}
36+
- uses: r-lib/actions/setup-r@master
37+
- name: Install dependencies
38+
run: Rscript -e 'install.packages("styler")'
39+
- name: Style
40+
run: Rscript -e 'styler::style_pkg()'
41+
- name: commit
42+
run: |
43+
git add \*.R
44+
git commit -m 'Style'
45+
- uses: r-lib/actions/pr-push@master
46+
with:
47+
repo-token: ${{ secrets.GITHUB_TOKEN }}
48+
# A mock job just to ensure we have a successful build status
49+
finish:
50+
runs-on: ubuntu-latest
51+
steps:
52+
- run: true

.github/workflows/test-coverage.yaml

Lines changed: 22 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ on:
55
# https://crontab.guru is your friend
66
- cron: '0 11 * * *'
77

8-
name: Test-coverage
8+
name: test-coverage
99

1010
jobs:
1111
test-coverage:
@@ -16,19 +16,31 @@ jobs:
1616

1717
steps:
1818
- uses: actions/checkout@v2
19+
1920
- uses: r-lib/actions/setup-r@master
2021

21-
- name: Install macOS system dependencies
22-
run: brew install libsodium
22+
- uses: r-lib/actions/setup-pandoc@master
2323

24-
- name: Install dependencies
24+
- name: Query dependencies
2525
run: |
26-
Rscript -e 'install.packages("remotes")' \
27-
-e 'remotes::install_deps(dependencies = TRUE)'
26+
install.packages('remotes')
27+
saveRDS(remotes::dev_package_deps(dependencies = TRUE), "depends.Rds", version = 2)
28+
shell: Rscript {0}
2829

29-
- name: Install package
30-
run: R CMD INSTALL .
30+
- name: Cache R packages
31+
uses: actions/cache@v1
32+
with:
33+
path: ${{ env.R_LIBS_USER }}
34+
key: macOS-r-3.6-${{ hashFiles('depends.Rds') }}
35+
restore-keys: macOS-r-3.6-
3136

32-
- name: Test coverage
37+
- name: Install dependencies
3338
run: |
34-
Rscript -e 'covr::codecov(token = "${{secrets.CODECOV_TOKEN}}")'
39+
install.packages(c("remotes"))
40+
remotes::install_deps(dependencies = TRUE)
41+
remotes::install_cran("covr")
42+
shell: Rscript {0}
43+
44+
- name: Test coverage
45+
run: covr::codecov()
46+
shell: Rscript {0}

README.Rmd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ googlesheets4:::sheets_auth_docs()
3232
[![lifecycle](https://img.shields.io/badge/lifecycle-experimental-orange.svg)](https://www.tidyverse.org/lifecycle/#experimental)
3333
[![CRAN status](https://www.r-pkg.org/badges/version/googlesheets4)](https://CRAN.R-project.org/package=googlesheets4)
3434
[![R build status](https://github.com/tidyverse/googlesheets4/workflows/R-CMD-check/badge.svg)](https://github.com/tidyverse/googlesheets4/actions)
35-
[![Coverage status](https://codecov.io/gh/tidyverse/googlesheets4/branch/master/graph/badge.svg)](https://codecov.io/github/tidyverse/googlesheets4?branch=master)
35+
[![Codecov test coverage](https://codecov.io/gh/tidyverse/googlesheets4/branch/master/graph/badge.svg)](https://codecov.io/gh/tidyverse/googlesheets4?branch=master)
3636
<!-- badges: end -->
3737

3838
## Overview

README.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
status](https://www.r-pkg.org/badges/version/googlesheets4)](https://CRAN.R-project.org/package=googlesheets4)
1111
[![R build
1212
status](https://github.com/tidyverse/googlesheets4/workflows/R-CMD-check/badge.svg)](https://github.com/tidyverse/googlesheets4/actions)
13-
[![Coverage
14-
status](https://codecov.io/gh/tidyverse/googlesheets4/branch/master/graph/badge.svg)](https://codecov.io/github/tidyverse/googlesheets4?branch=master)
13+
[![Codecov test
14+
coverage](https://codecov.io/gh/tidyverse/googlesheets4/branch/master/graph/badge.svg)](https://codecov.io/gh/tidyverse/googlesheets4?branch=master)
1515
<!-- badges: end -->
1616

1717
## Overview
@@ -130,8 +130,9 @@ send some initial data.
130130

131131
``` r
132132
(ss <- sheets_create("fluffy-bunny", sheets = list(flowers = head(iris))))
133+
#> Creating new Sheet: "fluffy-bunny"
133134
#> Spreadsheet name: fluffy-bunny
134-
#> ID: 1Gl1dCldb7VWKE0B-p5RrhZfPRvZklkSNnln4nWpr5CA
135+
#> ID: 1hlQJdgx7Eh6kKfijQm7fKQTDq6nOBzx1l517zHFwi5s
135136
#> Locale: en_US
136137
#> Time zone: Etc/GMT
137138
#> # of sheets: 1
@@ -150,7 +151,7 @@ head(mtcars) %>%
150151
#> Writing to sheet "autos"
151152
ss
152153
#> Spreadsheet name: fluffy-bunny
153-
#> ID: 1Gl1dCldb7VWKE0B-p5RrhZfPRvZklkSNnln4nWpr5CA
154+
#> ID: 1hlQJdgx7Eh6kKfijQm7fKQTDq6nOBzx1l517zHFwi5s
154155
#> Locale: en_US
155156
#> Time zone: Etc/GMT
156157
#> # of sheets: 2

codecov.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@ coverage:
66
default:
77
target: auto
88
threshold: 1%
9+
informational: true
910
patch:
1011
default:
1112
target: auto
1213
threshold: 1%
14+
informational: true

0 commit comments

Comments
 (0)