Skip to content

Commit 9ed60b0

Browse files
committed
updated GHA
1 parent bf507af commit 9ed60b0

File tree

7 files changed

+155
-12
lines changed

7 files changed

+155
-12
lines changed

.Rbuildignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,4 @@ derby.log
1717
^\.github$
1818
^CODE_OF_CONDUCT\.md$
1919
^README\.html$
20+
^codecov\.yml$

.github/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
*.html

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

Lines changed: 40 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1-
on: [push, pull_request]
1+
on:
2+
push:
3+
pull_request:
4+
types: [opened, synchronize, reopened]
25

36
name: R-CMD-check
47

@@ -17,43 +20,68 @@ jobs:
1720
- { os: windows-latest, r: 'devel'}
1821
- { os: ubuntu-16.04, r: '3.5', cran: "https://demo.rstudiopm.com/all/__linux__/xenial/latest"}
1922
- { os: ubuntu-16.04, r: '3.6', cran: "https://demo.rstudiopm.com/all/__linux__/xenial/latest"}
23+
2024
env:
2125
R_REMOTES_NO_ERRORS_FROM_WARNINGS: true
22-
PIP_NO_WARN_SCRIPT_LOCATION: false
26+
RSPM: ${{ matrix.config.rspm }}
27+
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
2328

2429
steps:
25-
- uses: actions/checkout@v1
30+
- uses: actions/checkout@v2
2631

2732
- uses: r-lib/actions/setup-r@master
33+
with:
34+
r-version: ${{ matrix.config.r }}
2835

2936
- uses: r-lib/actions/setup-pandoc@master
3037

38+
- name: Query dependencies
39+
run: |
40+
install.packages('remotes')
41+
saveRDS(remotes::dev_package_deps(dependencies = TRUE), ".github/depends.Rds", version = 2)
42+
writeLines(sprintf("R-%i.%i", getRversion()$major, getRversion()$minor), ".github/R-version")
43+
shell: Rscript {0}
44+
3145
- name: Cache R packages
3246
if: runner.os != 'Windows'
3347
uses: actions/cache@v1
3448
with:
3549
path: ${{ env.R_LIBS_USER }}
36-
key: ${{ runner.os }}-r-${{ matrix.config.r }}-${{ hashFiles('DESCRIPTION') }}
50+
key: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-${{ hashFiles('.github/depends.Rds') }}
51+
restore-keys: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-
3752

3853
- name: Install system dependencies
3954
if: runner.os == 'Linux'
4055
env:
4156
RHUB_PLATFORM: linux-x86_64-ubuntu-gcc
4257
run: |
43-
Rscript -e "install.packages('remotes')" -e "remotes::install_github('r-hub/sysreqs')"
58+
Rscript -e "remotes::install_github('r-hub/sysreqs')"
4459
sysreqs=$(Rscript -e "cat(sysreqs::sysreq_commands('DESCRIPTION'))")
4560
sudo -s eval "$sysreqs"
61+
4662
- name: Install dependencies
47-
run: Rscript -e "install.packages('remotes')" -e "remotes::install_deps(dependencies = TRUE)" -e "remotes::install_cran('rcmdcheck')"
63+
run: |
64+
remotes::install_deps(dependencies = TRUE)
65+
remotes::install_cran("rcmdcheck")
66+
shell: Rscript {0}
4867

49-
- name: Install TensorFlow
68+
- name: Session info
5069
run: |
51-
Rscript -e "remotes::install_github('rstudio/reticulate') # TODO remove when reticulate 1.14 is on CRAN"
52-
Rscript -e "reticulate::install_miniconda()"
53-
Rscript -e "reticulate::conda_create('r-reticulate', packages = 'python==3.6.9')"
54-
Rscript -e "tensorflow::install_tensorflow(version='1.14.0')"
70+
options(width = 100)
71+
pkgs <- installed.packages()[, "Package"]
72+
sessioninfo::session_info(pkgs, include_base = TRUE)
73+
shell: Rscript {0}
74+
5575
- name: Check
56-
run: Rscript -e "rcmdcheck::rcmdcheck(args = '--no-manual', error_on = 'warning', check_dir = 'check')"
76+
env:
77+
_R_CHECK_CRAN_INCOMING_: false
78+
run: rcmdcheck::rcmdcheck(args = c("--no-manual", "--as-cran"), error_on = "warning", check_dir = "check")
79+
shell: Rscript {0}
80+
81+
- name: Show testthat output
82+
if: always()
83+
run: find check -name 'testthat.Rout*' -exec cat '{}' \; || true
84+
shell: bash
5785

5886
- name: Upload check results
5987
if: failure()

.github/workflows/pr-commands.yaml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
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+
env:
11+
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
12+
steps:
13+
- uses: actions/checkout@v2
14+
- uses: r-lib/actions/pr-fetch@master
15+
with:
16+
repo-token: ${{ secrets.GITHUB_TOKEN }}
17+
- uses: r-lib/actions/setup-r@master
18+
- name: Install dependencies
19+
run: Rscript -e 'install.packages(c("remotes", "roxygen2"))' -e 'remotes::install_deps(dependencies = TRUE)'
20+
- name: Document
21+
run: Rscript -e 'roxygen2::roxygenise()'
22+
- name: commit
23+
run: |
24+
git add man/\* NAMESPACE
25+
git commit -m 'Document'
26+
- uses: r-lib/actions/pr-push@master
27+
with:
28+
repo-token: ${{ secrets.GITHUB_TOKEN }}
29+
style:
30+
if: startsWith(github.event.comment.body, '/style')
31+
name: style
32+
runs-on: macOS-latest
33+
env:
34+
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
35+
steps:
36+
- uses: actions/checkout@v2
37+
- uses: r-lib/actions/pr-fetch@master
38+
with:
39+
repo-token: ${{ secrets.GITHUB_TOKEN }}
40+
- uses: r-lib/actions/setup-r@master
41+
- name: Install dependencies
42+
run: Rscript -e 'install.packages("styler")'
43+
- name: Style
44+
run: Rscript -e 'styler::style_pkg()'
45+
- name: commit
46+
run: |
47+
git add \*.R
48+
git commit -m 'Style'
49+
- uses: r-lib/actions/pr-push@master
50+
with:
51+
repo-token: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/test-coverage.yaml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
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+
env:
15+
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
16+
steps:
17+
- uses: actions/checkout@v2
18+
19+
- uses: r-lib/actions/setup-r@master
20+
21+
- uses: r-lib/actions/setup-pandoc@master
22+
23+
- name: Query dependencies
24+
run: |
25+
install.packages('remotes')
26+
saveRDS(remotes::dev_package_deps(dependencies = TRUE), ".github/depends.Rds", version = 2)
27+
writeLines(sprintf("R-%i.%i", getRversion()$major, getRversion()$minor), ".github/R-version")
28+
shell: Rscript {0}
29+
30+
- name: Cache R packages
31+
uses: actions/cache@v1
32+
with:
33+
path: ${{ env.R_LIBS_USER }}
34+
key: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-${{ hashFiles('.github/depends.Rds') }}
35+
restore-keys: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-
36+
37+
- name: Install dependencies
38+
run: |
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: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ knitr::opts_chunk$set(
2222
[![Downloads](http://cranlogs.r-pkg.org/badges/parsnip)](https://cran.rstudio.com/package=parsnip)
2323
[![lifecycle](https://img.shields.io/badge/lifecycle-maturing-blue.svg)](https://www.tidyverse.org/lifecycle/#maturing)
2424

25+
[![Codecov test coverage](https://codecov.io/gh/tidymodels/parsnip/branch/master/graph/badge.svg)](https://codecov.io/gh/tidymodels/parsnip?branch=master)
26+
[![R build status](https://github.com/tidymodels/parsnip/workflows/R-CMD-check/badge.svg)](https://github.com/tidymodels/parsnip/actions)
2527
<!-- badges: end -->
2628

2729
## Introduction

codecov.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
comment: false
2+
3+
coverage:
4+
status:
5+
project:
6+
default:
7+
target: auto
8+
threshold: 1%
9+
informational: true
10+
patch:
11+
default:
12+
target: auto
13+
threshold: 1%
14+
informational: true

0 commit comments

Comments
 (0)