Skip to content

Commit f59c4a0

Browse files
committed
Update GitHub actions job builders
1 parent cdeef2b commit f59c4a0

File tree

2 files changed

+51
-75
lines changed

2 files changed

+51
-75
lines changed

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

Lines changed: 21 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
1+
# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples
2+
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
13
on:
24
push:
3-
branches:
4-
- master
5+
branches: [main, master]
56
pull_request:
6-
branches:
7-
- master
7+
branches: [main, master]
8+
workflow_dispatch:
89

910
name: R-CMD-check
1011

@@ -18,61 +19,32 @@ jobs:
1819
fail-fast: false
1920
matrix:
2021
config:
22+
- {os: macOS-latest, r: 'release'}
2123
- {os: windows-latest, r: 'release'}
22-
- {os: macOS-latest, r: 'release'}
23-
- {os: macOS-latest, r: 'devel'}
24-
- {os: ubuntu-16.04, r: '3.5', rspm: "https://demo.rstudiopm.com/all/__linux__/xenial/latest"}
25-
- {os: ubuntu-16.04, r: 'release', rspm: "https://demo.rstudiopm.com/all/__linux__/xenial/latest"}
24+
- {os: ubuntu-latest, r: 'devel', http-user-agent: 'release'}
25+
- {os: ubuntu-latest, r: 'release'}
26+
- {os: ubuntu-latest, r: 'oldrel-1'}
2627

2728
env:
28-
R_REMOTES_NO_ERRORS_FROM_WARNINGS: true
29-
RSPM: ${{ matrix.config.rspm }}
29+
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
30+
R_KEEP_PKG_SOURCE: yes
3031

3132
steps:
3233
- uses: actions/checkout@v2
3334

34-
- uses: r-lib/actions/setup-r@master
35+
- uses: r-lib/actions/setup-pandoc@v2
36+
37+
- uses: r-lib/actions/setup-r@v2
3538
with:
3639
r-version: ${{ matrix.config.r }}
40+
http-user-agent: ${{ matrix.config.http-user-agent }}
41+
use-public-rspm: true
3742

38-
- uses: r-lib/actions/setup-pandoc@master
39-
40-
- name: Query dependencies
41-
run: |
42-
install.packages('remotes')
43-
saveRDS(remotes::dev_package_deps(dependencies = TRUE), "depends.Rds", version = 2)
44-
shell: Rscript {0}
45-
46-
- name: Cache R packages
47-
if: runner.os != 'Windows'
48-
uses: actions/cache@v1
43+
- uses: r-lib/actions/setup-r-dependencies@v2
4944
with:
50-
path: ${{ env.R_LIBS_USER }}
51-
key: ${{ runner.os }}-r-${{ matrix.config.r }}-${{ hashFiles('depends.Rds') }}
52-
restore-keys: ${{ runner.os }}-r-${{ matrix.config.r }}-
53-
54-
- name: Install system dependencies
55-
if: runner.os == 'Linux'
56-
env:
57-
RHUB_PLATFORM: linux-x86_64-ubuntu-gcc
58-
run: |
59-
Rscript -e "remotes::install_github('r-hub/sysreqs')"
60-
sysreqs=$(Rscript -e "cat(sysreqs::sysreq_commands('DESCRIPTION'))")
61-
sudo -s eval "$sysreqs"
62-
63-
- name: Install dependencies
64-
run: |
65-
remotes::install_deps(dependencies = TRUE)
66-
remotes::install_cran("rcmdcheck")
67-
shell: Rscript {0}
68-
69-
- name: Check
70-
run: rcmdcheck::rcmdcheck(args = "--no-manual", error_on = "warning", check_dir = "check")
71-
shell: Rscript {0}
45+
extra-packages: any::rcmdcheck
46+
needs: check
7247

73-
- name: Upload check results
74-
if: failure()
75-
uses: actions/upload-artifact@master
48+
- uses: r-lib/actions/check-r-package@v2
7649
with:
77-
name: ${{ runner.os }}-r${{ matrix.config.r }}-results
78-
path: check
50+
upload-snapshots: true

.github/workflows/pkgdown.yaml

Lines changed: 30 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,46 @@
1+
# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples
2+
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
13
on:
24
push:
3-
branches: master
5+
branches: [main, master]
6+
pull_request:
7+
branches: [main, master]
8+
release:
9+
types: [published]
10+
workflow_dispatch:
411

512
name: pkgdown
613

714
jobs:
815
pkgdown:
9-
runs-on: macOS-latest
16+
runs-on: ubuntu-latest
17+
# Only restrict concurrency for non-PR jobs
18+
concurrency:
19+
group: pkgdown-${{ github.event_name != 'pull_request' || github.run_id }}
20+
env:
21+
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
1022
steps:
1123
- uses: actions/checkout@v2
1224

13-
- uses: r-lib/actions/setup-r@master
25+
- uses: r-lib/actions/setup-pandoc@v2
1426

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), "depends.Rds", version = 2)
21-
shell: Rscript {0}
27+
- uses: r-lib/actions/setup-r@v2
28+
with:
29+
use-public-rspm: true
2230

23-
- name: Cache R packages
24-
uses: actions/cache@v1
31+
- uses: r-lib/actions/setup-r-dependencies@v2
2532
with:
26-
path: ${{ env.R_LIBS_USER }}
27-
key: macOS-r-3.6-${{ hashFiles('depends.Rds') }}
28-
restore-keys: macOS-r-3.6-
33+
extra-packages: any::pkgdown, local::.
34+
needs: website
2935

30-
- name: Install dependencies
31-
run: |
32-
install.packages("remotes")
33-
remotes::install_deps(dependencies = TRUE)
34-
remotes::install_dev("pkgdown")
36+
- name: Build site
37+
run: pkgdown::build_site_github_pages(new_process = FALSE, install = FALSE)
3538
shell: Rscript {0}
3639

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}
40+
- name: Deploy to GitHub pages 🚀
41+
if: github.event_name != 'pull_request'
42+
uses: JamesIves/github-pages-deploy-action@4.1.4
43+
with:
44+
clean: false
45+
branch: gh-pages
46+
folder: docs

0 commit comments

Comments
 (0)