Skip to content

Commit 88dd0bb

Browse files
committed
use_tidy_github_actions()
Fixes #493. Closes #495
1 parent 4e47684 commit 88dd0bb

9 files changed

+228
-71
lines changed

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

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
on:
2+
push:
3+
branches:
4+
- master
5+
pull_request:
6+
branches:
7+
- master
8+
9+
name: R-CMD-check
10+
11+
jobs:
12+
R-CMD-check:
13+
runs-on: ${{ matrix.config.os }}
14+
15+
name: ${{ matrix.config.os }} (${{ matrix.config.r }})
16+
17+
strategy:
18+
fail-fast: false
19+
matrix:
20+
config:
21+
- {os: windows-latest, r: '3.6'}
22+
- {os: macOS-latest, r: '3.6'}
23+
- {os: macOS-latest, r: 'devel'}
24+
- {os: ubuntu-16.04, r: '3.2', rspm: "https://demo.rstudiopm.com/all/__linux__/xenial/latest"}
25+
- {os: ubuntu-16.04, r: '3.3', rspm: "https://demo.rstudiopm.com/all/__linux__/xenial/latest"}
26+
- {os: ubuntu-16.04, r: '3.4', rspm: "https://demo.rstudiopm.com/all/__linux__/xenial/latest"}
27+
- {os: ubuntu-16.04, r: '3.5', rspm: "https://demo.rstudiopm.com/all/__linux__/xenial/latest"}
28+
- {os: ubuntu-16.04, r: '3.6', rspm: "https://demo.rstudiopm.com/all/__linux__/xenial/latest"}
29+
30+
env:
31+
R_REMOTES_NO_ERRORS_FROM_WARNINGS: true
32+
RSPM: ${{ matrix.config.rspm }}
33+
34+
steps:
35+
- uses: actions/checkout@v2
36+
37+
- uses: r-lib/actions/setup-r@master
38+
with:
39+
r-version: ${{ matrix.config.r }}
40+
41+
- uses: r-lib/actions/setup-pandoc@master
42+
43+
- name: Query dependencies
44+
run: |
45+
install.packages('remotes')
46+
saveRDS(remotes::dev_package_deps(dependencies = TRUE), ".github/depends.Rds", version = 2)
47+
shell: Rscript {0}
48+
49+
- name: Cache R packages
50+
if: runner.os != 'Windows'
51+
uses: actions/cache@v1
52+
with:
53+
path: ${{ env.R_LIBS_USER }}
54+
key: ${{ runner.os }}-r-${{ matrix.config.r }}-${{ hashFiles('.github/depends.Rds') }}
55+
restore-keys: ${{ runner.os }}-r-${{ matrix.config.r }}-
56+
57+
- name: Install system dependencies
58+
if: runner.os == 'Linux'
59+
env:
60+
RHUB_PLATFORM: linux-x86_64-ubuntu-gcc
61+
run: |
62+
Rscript -e "remotes::install_github('r-hub/sysreqs')"
63+
sysreqs=$(Rscript -e "cat(sysreqs::sysreq_commands('DESCRIPTION'))")
64+
sudo -s eval "$sysreqs"
65+
66+
- name: Install dependencies
67+
run: |
68+
remotes::install_deps(dependencies = TRUE)
69+
remotes::install_cran("rcmdcheck")
70+
shell: Rscript {0}
71+
72+
- name: Check
73+
env:
74+
_R_CHECK_CRAN_INCOMING_REMOTE_: false
75+
run: rcmdcheck::rcmdcheck(args = c("--no-manual", "--as-cran"), error_on = "warning", check_dir = "check")
76+
shell: Rscript {0}
77+
78+
- name: Upload check results
79+
if: failure()
80+
uses: actions/upload-artifact@master
81+
with:
82+
name: ${{ runner.os }}-r${{ matrix.config.r }}-results
83+
path: check

.github/workflows/pkgdown.yaml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
on:
2+
push:
3+
branches: master
4+
5+
name: pkgdown
6+
7+
jobs:
8+
pkgdown:
9+
runs-on: macOS-latest
10+
steps:
11+
- uses: actions/checkout@v2
12+
13+
- uses: r-lib/actions/setup-r@master
14+
15+
- uses: r-lib/actions/setup-pandoc@master
16+
17+
- name: Query dependencies
18+
run: |
19+
install.packages('remotes')
20+
saveRDS(remotes::dev_package_deps(dependencies = TRUE), ".github/depends.Rds", version = 2)
21+
shell: Rscript {0}
22+
23+
- name: Cache R packages
24+
uses: actions/cache@v1
25+
with:
26+
path: ${{ env.R_LIBS_USER }}
27+
key: macOS-r-3.6-${{ hashFiles('.github/depends.Rds') }}
28+
restore-keys: macOS-r-3.6-
29+
30+
- name: Install dependencies
31+
run: |
32+
install.packages("remotes")
33+
remotes::install_deps(dependencies = TRUE)
34+
remotes::install_dev("pkgdown")
35+
shell: Rscript {0}
36+
37+
- name: Install package
38+
run: R CMD INSTALL .
39+
40+
- name: Deploy package
41+
run: pkgdown::deploy_to_branch(new_process = FALSE)
42+
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: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
on:
2+
push:
3+
branches:
4+
- master
5+
pull_request:
6+
branches:
7+
- master
8+
9+
name: test-coverage
10+
11+
jobs:
12+
test-coverage:
13+
runs-on: macOS-latest
14+
steps:
15+
- uses: actions/checkout@v2
16+
17+
- uses: r-lib/actions/setup-r@master
18+
19+
- uses: r-lib/actions/setup-pandoc@master
20+
21+
- name: Query dependencies
22+
run: |
23+
install.packages('remotes')
24+
saveRDS(remotes::dev_package_deps(dependencies = TRUE), ".github/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('.github/depends.Rds') }}
32+
restore-keys: macOS-r-3.6-
33+
34+
- name: Install dependencies
35+
run: |
36+
install.packages(c("remotes"))
37+
remotes::install_deps(dependencies = TRUE)
38+
remotes::install_cran("covr")
39+
shell: Rscript {0}
40+
41+
- name: Test coverage
42+
run: covr::codecov()
43+
shell: Rscript {0}

.travis.yml

Lines changed: 0 additions & 22 deletions
This file was deleted.

README.Rmd

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,7 @@ knitr::opts_chunk$set(
1717

1818
<!-- badges: start -->
1919
[![CRAN status](https://www.r-pkg.org/badges/version/haven)](https://cran.r-project.org/package=haven)
20-
[![Travis build status](https://travis-ci.org/tidyverse/haven.svg?branch=master)](https://travis-ci.org/tidyverse/haven)
21-
[![AppVeyor build status](https://ci.appveyor.com/api/projects/status/github/tidyverse/haven?branch=master&svg=true)](https://ci.appveyor.com/project/tidyverse/haven)
20+
[![R build status](https://github.com/tidyverse/haven/workflows/R-CMD-check/badge.svg)](https://github.com/tidyverse/haven/actions)
2221
[![Codecov test coverage](https://codecov.io/gh/tidyverse/haven/branch/master/graph/badge.svg)](https://codecov.io/gh/tidyverse/haven?branch=master)
2322
<!-- badges: end -->
2423

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,8 @@
77

88
[![CRAN
99
status](https://www.r-pkg.org/badges/version/haven)](https://cran.r-project.org/package=haven)
10-
[![Travis build
11-
status](https://travis-ci.org/tidyverse/haven.svg?branch=master)](https://travis-ci.org/tidyverse/haven)
12-
[![AppVeyor build
13-
status](https://ci.appveyor.com/api/projects/status/github/tidyverse/haven?branch=master&svg=true)](https://ci.appveyor.com/project/tidyverse/haven)
10+
[![R build
11+
status](https://github.com/tidyverse/haven/workflows/R-CMD-check/badge.svg)](https://github.com/tidyverse/haven/actions)
1412
[![Codecov test
1513
coverage](https://codecov.io/gh/tidyverse/haven/branch/master/graph/badge.svg)](https://codecov.io/gh/tidyverse/haven?branch=master)
1614
<!-- badges: end -->
@@ -90,4 +88,6 @@ write_dta(mtcars, "mtcars.dta")
9088

9189
## Code of Conduct
9290

93-
Please note that the haven project is released with a [Contributor Code of Conduct](https://haven.tidyverse.org/CODE_OF_CONDUCT.html). By contributing to this project, you agree to abide by its terms.
91+
Please note that the haven project is released with a [Contributor Code
92+
of Conduct](https://haven.tidyverse.org/CODE_OF_CONDUCT.html). By
93+
contributing to this project, you agree to abide by its terms.

appveyor.yml

Lines changed: 0 additions & 42 deletions
This file was deleted.

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)