Skip to content

Commit 0b637fc

Browse files
committed
Use shiny-workflows
1 parent 4e38b23 commit 0b637fc

File tree

1 file changed

+11
-96
lines changed

1 file changed

+11
-96
lines changed

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

Lines changed: 11 additions & 96 deletions
Original file line numberDiff line numberDiff line change
@@ -1,104 +1,19 @@
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.
1+
# Workflow derived from https://github.com/rstudio/shiny-workflows
42
#
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
3+
# NOTE: This Shiny team GHA workflow is overkill for most R packages.
4+
# For most R packages it is better to use https://github.com/r-lib/actions
75
on:
86
push:
9-
branches:
10-
- master
7+
branches: [main, rc-**]
118
pull_request:
12-
branches:
13-
- master
9+
branches: [main]
10+
schedule:
11+
- cron: '0 13 * * 1' # every monday
1412

15-
name: R-CMD-check
13+
name: Package checks
1614

1715
jobs:
16+
routine:
17+
uses: rstudio/shiny-workflows/.github/workflows/routine.yaml@v1
1818
R-CMD-check:
19-
runs-on: ${{ matrix.config.os }}
20-
21-
name: ${{ matrix.config.os }} (${{ matrix.config.r }})
22-
23-
strategy:
24-
fail-fast: false
25-
matrix:
26-
config:
27-
- {os: macOS-latest, r: 'release'}
28-
- {os: windows-latest, r: 'release'}
29-
- {os: windows-latest, r: '3.6'}
30-
- {os: ubuntu-20.04, r: 'devel', rspm: "https://packagemanager.rstudio.com/cran/__linux__/focal/latest", http-user-agent: "R/4.3.0 (ubuntu-20.04) R (4.0.0 x86_64-pc-linux-gnu x86_64 linux-gnu) on GitHub Actions" }
31-
- {os: ubuntu-20.04, r: 'release', rspm: "https://packagemanager.rstudio.com/cran/__linux__/focal/latest"}
32-
- {os: ubuntu-20.04, r: 'oldrel', rspm: "https://packagemanager.rstudio.com/cran/__linux__/focal/latest"}
33-
- {os: ubuntu-20.04, r: '3.5', rspm: "https://packagemanager.rstudio.com/cran/__linux__/focal/latest"}
34-
- {os: ubuntu-20.04, r: '3.4', rspm: "https://packagemanager.rstudio.com/cran/__linux__/focal/latest"}
35-
- {os: ubuntu-20.04, r: '3.3', rspm: "https://packagemanager.rstudio.com/cran/__linux__/focal/latest"}
36-
37-
env:
38-
R_REMOTES_NO_ERRORS_FROM_WARNINGS: true
39-
RSPM: ${{ matrix.config.rspm }}
40-
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
41-
42-
steps:
43-
- uses: actions/checkout@v2
44-
45-
- uses: r-lib/actions/setup-r@master
46-
with:
47-
r-version: ${{ matrix.config.r }}
48-
http-user-agent: ${{ matrix.config.http-user-agent }}
49-
50-
- uses: r-lib/actions/setup-pandoc@master
51-
52-
- name: Query dependencies
53-
run: |
54-
install.packages('remotes')
55-
saveRDS(remotes::dev_package_deps(dependencies = TRUE), ".github/depends.Rds", version = 2)
56-
writeLines(sprintf("R-%i.%i", getRversion()$major, getRversion()$minor), ".github/R-version")
57-
shell: Rscript {0}
58-
59-
- name: Cache R packages
60-
if: runner.os != 'Windows'
61-
uses: actions/cache@v2
62-
with:
63-
path: ${{ env.R_LIBS_USER }}
64-
key: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-${{ hashFiles('.github/depends.Rds') }}
65-
restore-keys: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-
66-
67-
- name: Install system dependencies
68-
if: runner.os == 'Linux'
69-
run: |
70-
while read -r cmd
71-
do
72-
eval sudo $cmd
73-
done < <(Rscript -e 'writeLines(remotes::system_requirements("ubuntu", "16.04"))')
74-
75-
- name: Install dependencies
76-
run: |
77-
remotes::install_deps(dependencies = TRUE)
78-
remotes::install_cran("rcmdcheck")
79-
shell: Rscript {0}
80-
81-
- name: Session info
82-
run: |
83-
options(width = 100)
84-
pkgs <- installed.packages()[, "Package"]
85-
sessioninfo::session_info(pkgs, include_base = TRUE)
86-
shell: Rscript {0}
87-
88-
- name: Check
89-
env:
90-
_R_CHECK_CRAN_INCOMING_: false
91-
run: rcmdcheck::rcmdcheck(args = c("--no-manual", "--as-cran"), error_on = "warning", check_dir = "check")
92-
shell: Rscript {0}
93-
94-
- name: Show testthat output
95-
if: always()
96-
run: find check -name 'testthat.Rout*' -exec cat '{}' \; || true
97-
shell: bash
98-
99-
- name: Upload check results
100-
if: failure()
101-
uses: actions/upload-artifact@main
102-
with:
103-
name: ${{ runner.os }}-r${{ matrix.config.r }}-results
104-
path: check
19+
uses: rstudio/shiny-workflows/.github/workflows/R-CMD-check.yaml@v1

0 commit comments

Comments
 (0)