Skip to content

Commit 604430f

Browse files
committed
GHA update
1 parent 3240c7d commit 604430f

File tree

7 files changed

+92
-221
lines changed

7 files changed

+92
-221
lines changed

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

Lines changed: 29 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,17 @@
1+
# NOTE: This workflow is overkill for most R packages
2+
# check-standard.yaml is likely a better choice
3+
# usethis::use_github_action("check-standard") will install it.
4+
#
5+
# For help debugging build failures open an issue on the RStudio community with the 'github-actions' tag.
6+
# https://community.rstudio.com/new-topic?category=Package%20development&tags=github-actions
17
on:
28
push:
39
branches:
10+
- main
411
- master
512
pull_request:
613
branches:
14+
- main
715
- master
816

917
name: R-CMD-check
@@ -21,70 +29,50 @@ jobs:
2129
- {os: macOS-latest, r: 'release'}
2230
- {os: windows-latest, r: 'release'}
2331
- {os: windows-latest, r: '3.6'}
24-
- {os: ubuntu-16.04, r: 'devel', rspm: "https://packagemanager.rstudio.com/cran/__linux__/xenial/latest", http-user-agent: "R/4.0.0 (ubuntu-16.04) R (4.0.0 x86_64-pc-linux-gnu x86_64 linux-gnu) on GitHub Actions" }
25-
- {os: ubuntu-16.04, r: 'release', rspm: "https://packagemanager.rstudio.com/cran/__linux__/xenial/latest"}
26-
- {os: ubuntu-16.04, r: 'oldrel', rspm: "https://packagemanager.rstudio.com/cran/__linux__/xenial/latest"}
27-
- {os: ubuntu-16.04, r: '3.5', rspm: "https://packagemanager.rstudio.com/cran/__linux__/xenial/latest"}
32+
- {os: ubuntu-18.04, r: 'devel', rspm: "https://packagemanager.rstudio.com/cran/__linux__/bionic/latest", http-user-agent: "R/4.0.0 (ubuntu-18.04) R (4.0.0 x86_64-pc-linux-gnu x86_64 linux-gnu) on GitHub Actions" }
33+
- {os: ubuntu-18.04, r: 'release', rspm: "https://packagemanager.rstudio.com/cran/__linux__/bionic/latest"}
2834

2935
env:
30-
R_REMOTES_NO_ERRORS_FROM_WARNINGS: true
3136
RSPM: ${{ matrix.config.rspm }}
3237
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
3338

3439
steps:
3540
- uses: actions/checkout@v2
3641

37-
- uses: r-lib/actions/setup-r@master
42+
- uses: r-lib/actions/setup-r@v1
43+
id: install-r
3844
with:
3945
r-version: ${{ matrix.config.r }}
4046
http-user-agent: ${{ matrix.config.http-user-agent }}
4147

42-
- uses: r-lib/actions/setup-pandoc@master
48+
- uses: r-lib/actions/setup-pandoc@v1
4349

44-
- name: Query dependencies
50+
- name: Install pak and query dependencies
4551
run: |
46-
install.packages('remotes')
47-
saveRDS(remotes::dev_package_deps(dependencies = TRUE), ".github/depends.Rds", version = 2)
48-
writeLines(sprintf("R-%i.%i", getRversion()$major, getRversion()$minor), ".github/R-version")
52+
install.packages("pak", repos = "https://r-lib.github.io/p/pak/dev/")
53+
saveRDS(pak::pkg_deps("local::.", dependencies = TRUE), ".github/r-depends.rds")
4954
shell: Rscript {0}
5055

51-
- name: Cache R packages
52-
if: runner.os != 'Windows'
53-
uses: actions/cache@v1
56+
- name: Restore R package cache
57+
uses: actions/cache@v2
5458
with:
5559
path: ${{ env.R_LIBS_USER }}
56-
key: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-${{ hashFiles('.github/depends.Rds') }}
57-
restore-keys: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-
60+
key: ${{ matrix.config.os }}-${{ steps.install-r.outputs.installed-r-version }}-1-${{ hashFiles('.github/r-depends.rds') }}
61+
restore-keys: ${{ matrix.config.os }}-${{ steps.install-r.outputs.installed-r-version }}-1-
5862

5963
- name: Install system dependencies
6064
if: runner.os == 'Linux'
6165
run: |
62-
while read -r cmd
63-
do
64-
eval sudo $cmd
65-
done < <(Rscript -e 'cat(remotes::system_requirements("ubuntu", "16.04"), sep = "\n")')
66+
pak::local_system_requirements(execute = TRUE)
67+
pak::pkg_system_requirements("rcmdcheck", execute = TRUE)
68+
shell: Rscript {0}
6669

6770
- name: Install dependencies
6871
run: |
69-
remotes::install_deps(dependencies = TRUE)
70-
remotes::install_cran("rcmdcheck")
72+
pak::local_install_dev_deps(upgrade = TRUE)
73+
pak::pkg_install("rcmdcheck")
7174
shell: Rscript {0}
7275

73-
- name: Install Miniconda
74-
run: |
75-
Rscript -e "remotes::install_github('rstudio/reticulate')"
76-
Rscript -e "reticulate::install_miniconda()"
77-
78-
- name: Find Miniconda on macOS
79-
if: runner.os == 'macOS'
80-
run: echo "options(reticulate.conda_binary = reticulate:::miniconda_conda())" >> .Rprofile
81-
82-
- name: Install TensorFlow
83-
run: |
84-
reticulate::conda_create('r-reticulate', packages = c('python==3.6.9'))
85-
tensorflow::install_tensorflow(version='1.14.0')
86-
shell: Rscript {0}
87-
8876
- name: Session info
8977
run: |
9078
options(width = 100)
@@ -95,7 +83,9 @@ jobs:
9583
- name: Check
9684
env:
9785
_R_CHECK_CRAN_INCOMING_: false
98-
run: rcmdcheck::rcmdcheck(args = c("--no-manual", "--as-cran"), error_on = "warning", check_dir = "check")
86+
run: |
87+
options(crayon.enabled = TRUE)
88+
rcmdcheck::rcmdcheck(args = c("--no-manual", "--as-cran"), error_on = "warning", check_dir = "check")
9989
shell: Rscript {0}
10090

10191
- name: Show testthat output
@@ -107,5 +97,5 @@ jobs:
10797
if: failure()
10898
uses: actions/upload-artifact@main
10999
with:
110-
name: ${{ runner.os }}-r${{ matrix.config.r }}-results
100+
name: ${{ matrix.config.os }}-r${{ matrix.config.r }}-results
111101
path: check

.github/workflows/check-pak.yaml

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

.github/workflows/pkgdown.yaml

Lines changed: 22 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,64 +1,57 @@
11
on:
22
push:
33
branches:
4-
- master
54
- main
6-
pull_request:
7-
branches:
85
- master
9-
- main
106

117
name: pkgdown
128

139
jobs:
1410
pkgdown:
15-
runs-on: macOS-latest
11+
runs-on: ubuntu-18.04
1612
env:
13+
RSPM: https://packagemanager.rstudio.com/cran/__linux__/bionic/latest
1714
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
15+
1816
steps:
1917
- uses: actions/checkout@v2
2018

2119
- uses: r-lib/actions/setup-r@v1
20+
id: install-r
2221

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

25-
- name: System dependencies
26-
run: brew install harfbuzz fribidi
27-
28-
- name: Query dependencies
24+
- name: Install pak and query dependencies
2925
run: |
30-
install.packages('remotes')
31-
saveRDS(remotes::dev_package_deps(dependencies = TRUE), ".github/depends.Rds", version = 2)
32-
writeLines(sprintf("R-%i.%i", getRversion()$major, getRversion()$minor), ".github/R-version")
26+
install.packages("pak", repos = "https://r-lib.github.io/p/pak/dev/")
27+
saveRDS(pak::pkg_deps("local::.", dependencies = TRUE), ".github/r-depends.rds")
3328
shell: Rscript {0}
3429

35-
- name: Cache R packages
30+
- name: Restore R package cache
3631
uses: actions/cache@v2
3732
with:
3833
path: ${{ env.R_LIBS_USER }}
39-
key: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-${{ hashFiles('.github/depends.Rds') }}
40-
restore-keys: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-
34+
key: ubuntu-18.04-${{ steps.install-r.outputs.installed-r-version }}-1-${{ hashFiles('.github/r-depends.rds') }}
35+
restore-keys: ubuntu-18.04-${{ steps.install-r.outputs.installed-r-version }}-1-
36+
37+
- name: Install system dependencies
38+
if: runner.os == 'Linux'
39+
run: |
40+
pak::local_system_requirements(execute = TRUE)
41+
pak::pkg_system_requirements("pkgdown", execute = TRUE)
42+
shell: Rscript {0}
4143

4244
- name: Install dependencies
4345
run: |
44-
remotes::install_deps(dependencies = TRUE)
45-
remotes::install_github("tidyverse/tidytemplate")
46-
remotes::install_cran("tidymodels")
47-
remotes::install_cran("C50")
48-
install.packages("pkgdown", type = "binary")
46+
pak::local_install_dev_deps(upgrade = TRUE)
47+
pak::pkg_install("pkgdown")
4948
shell: Rscript {0}
5049

5150
- name: Install package
5251
run: R CMD INSTALL .
5352

54-
- name: Build site
55-
if: github.event_name == 'pull_request'
56-
run: |
57-
Rscript -e 'pkgdown::build_site()'
58-
59-
- name: Deploy package
60-
if: github.event_name == 'push'
53+
- name: Build and deploy pkgdown site
6154
run: |
62-
git config --local user.email "[email protected]"
63-
git config --local user.name "GitHub Actions"
55+
git config --local user.name "$GITHUB_ACTOR"
56+
git config --local user.email "[email protected]"
6457
Rscript -e 'pkgdown::deploy_to_branch(new_process = FALSE)'

.github/workflows/pr-commands.yaml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@ jobs:
1111
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
1212
steps:
1313
- uses: actions/checkout@v2
14-
- uses: r-lib/actions/pr-fetch@master
14+
- uses: r-lib/actions/pr-fetch@v1
1515
with:
1616
repo-token: ${{ secrets.GITHUB_TOKEN }}
17-
- uses: r-lib/actions/setup-r@master
17+
- uses: r-lib/actions/setup-r@v1
1818
- name: Install dependencies
1919
run: Rscript -e 'install.packages(c("remotes", "roxygen2"))' -e 'remotes::install_deps(dependencies = TRUE)'
2020
- name: Document
@@ -25,7 +25,7 @@ jobs:
2525
git config --local user.name "GitHub Actions"
2626
git add man/\* NAMESPACE
2727
git commit -m 'Document'
28-
- uses: r-lib/actions/pr-push@master
28+
- uses: r-lib/actions/pr-push@v1
2929
with:
3030
repo-token: ${{ secrets.GITHUB_TOKEN }}
3131
style:
@@ -36,10 +36,10 @@ jobs:
3636
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
3737
steps:
3838
- uses: actions/checkout@v2
39-
- uses: r-lib/actions/pr-fetch@master
39+
- uses: r-lib/actions/pr-fetch@v1
4040
with:
4141
repo-token: ${{ secrets.GITHUB_TOKEN }}
42-
- uses: r-lib/actions/setup-r@master
42+
- uses: r-lib/actions/setup-r@v1
4343
- name: Install dependencies
4444
run: Rscript -e 'install.packages("styler")'
4545
- name: Style
@@ -50,6 +50,6 @@ jobs:
5050
git config --local user.name "GitHub Actions"
5151
git add \*.R
5252
git commit -m 'Style'
53-
- uses: r-lib/actions/pr-push@master
53+
- uses: r-lib/actions/pr-push@v1
5454
with:
5555
repo-token: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)