Skip to content
This repository was archived by the owner on Jun 30, 2023. It is now read-only.

Commit e714c18

Browse files
committed
Update actions
1 parent 49480f6 commit e714c18

2 files changed

Lines changed: 45 additions & 102 deletions

File tree

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

Lines changed: 20 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
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-
- main
5-
- master
5+
branches: [main, master]
66
pull_request:
7-
branches:
8-
- main
9-
- master
7+
branches: [main, master]
108

119
name: R-CMD-check
1210

@@ -20,80 +18,32 @@ jobs:
2018
fail-fast: false
2119
matrix:
2220
config:
21+
- {os: macos-latest, r: 'release'}
2322
- {os: windows-latest, r: 'release'}
24-
- {os: macOS-latest, r: 'release'}
25-
- {os: ubuntu-20.04, r: 'release', rspm: "https://packagemanager.rstudio.com/cran/__linux__/focal/latest"}
26-
- {os: ubuntu-20.04, r: 'devel', rspm: "https://packagemanager.rstudio.com/cran/__linux__/focal/latest"}
27-
- {os: ubuntu-20.04, r: 'oldrel', rspm: "https://packagemanager.rstudio.com/cran/__linux__/focal/latest"}
28-
- {os: ubuntu-18.04, r: '3.4', "https://packagemanager.rstudio.com/cran/__linux__/bionic/latest"}
29-
23+
- {os: ubuntu-latest, r: 'devel', http-user-agent: 'release'}
24+
- {os: ubuntu-latest, r: 'release'}
25+
- {os: ubuntu-latest, r: 'oldrel-1'}
26+
3027
env:
31-
RSPM: ${{ matrix.config.rspm }}
3228
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
33-
TWITTER_BEARER: ${{ secrets.TWITTER_BEARER }}
29+
R_KEEP_PKG_SOURCE: yes
3430

3531
steps:
36-
- uses: actions/checkout@v2
32+
- uses: actions/checkout@v3
33+
34+
- uses: r-lib/actions/setup-pandoc@v2
3735

38-
- uses: r-lib/actions/setup-r@v1
39-
id: install-r
36+
- uses: r-lib/actions/setup-r@v2
4037
with:
4138
r-version: ${{ matrix.config.r }}
4239
http-user-agent: ${{ matrix.config.http-user-agent }}
40+
use-public-rspm: true
4341

44-
- uses: r-lib/actions/setup-pandoc@v1
45-
46-
- name: Install pak and query dependencies
47-
run: |
48-
install.packages("pak", repos = "https://r-lib.github.io/p/pak/dev/")
49-
saveRDS(pak::pkg_deps("local::.", dependencies = TRUE), ".github/r-depends.rds")
50-
shell: Rscript {0}
51-
52-
- name: Restore R package cache
53-
uses: actions/cache@v2
42+
- uses: r-lib/actions/setup-r-dependencies@v2
5443
with:
55-
path: |
56-
${{ env.R_LIBS_USER }}/*
57-
!${{ env.R_LIBS_USER }}/pak
58-
key: ${{ matrix.config.os }}-${{ steps.install-r.outputs.installed-r-version }}-1-${{ hashFiles('.github/r-depends.rds') }}
59-
restore-keys: ${{ matrix.config.os }}-${{ steps.install-r.outputs.installed-r-version }}-1-
60-
61-
- name: Install system dependencies
62-
if: runner.os == 'Linux'
63-
run: |
64-
pak::local_system_requirements(execute = TRUE)
65-
pak::pkg_system_requirements("rcmdcheck", execute = TRUE)
66-
shell: Rscript {0}
67-
68-
- name: Install libgit2 for Mac
69-
if: runner.os == 'macOS-latest'
70-
run: brew install libgit2
71-
72-
- name: Install dependencies
73-
run: |
74-
pak::local_install_dev_deps(upgrade = TRUE)
75-
pak::pkg_install("rcmdcheck")
76-
pak::pkg_install("devtools")
77-
shell: Rscript {0}
78-
79-
- name: Session info
80-
run: |
81-
options(width = 100)
82-
pkgs <- installed.packages()[, "Package"]
83-
sessioninfo::session_info(pkgs, include_base = TRUE)
84-
shell: Rscript {0}
85-
86-
- name: Check
87-
env:
88-
_R_CHECK_CRAN_INCOMING_: false
89-
run: |
90-
options(crayon.enabled = TRUE)
91-
rcmdcheck::rcmdcheck(args = c("--no-manual", "--as-cran"), error_on = "warning", check_dir = "check")
92-
shell: Rscript {0}
44+
extra-packages: any::rcmdcheck
45+
needs: check
9346

94-
- name: Upload check results
95-
if: failure()
96-
uses: actions/upload-artifact@main
47+
- uses: r-lib/actions/check-r-package@v2
9748
with:
98-
name: ${{ matrix.config.os }}-r${{ matrix.config.r }}-results
99-
path: check
49+
upload-snapshots: true
Lines changed: 25 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Workflow derived from https://github.com/r-lib/actions/tree/master/examples
1+
# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples
22
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
33
on:
44
push:
@@ -13,45 +13,38 @@ jobs:
1313
runs-on: ubuntu-latest
1414
env:
1515
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
16-
TWITTER_BEARER: ${{ secrets.TWITTER_BEARER }}
1716

1817
steps:
19-
- uses: actions/checkout@v2
18+
- uses: actions/checkout@v3
2019

21-
- uses: r-lib/actions/setup-r@v1
20+
- uses: r-lib/actions/setup-r@v2
2221
with:
2322
use-public-rspm: true
24-
- name: Install pak and query dependencies
25-
run: |
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")
28-
shell: Rscript {0}
29-
- name: Restore R package cache
30-
uses: actions/cache@v2
31-
with:
32-
path: |
33-
${{ env.R_LIBS_USER }}/*
34-
!${{ env.R_LIBS_USER }}/pak
35-
key: ${{ matrix.config.os }}-${{ steps.install-r.outputs.installed-r-version }}-1-${{ hashFiles('.github/r-depends.rds') }}
36-
restore-keys: ${{ matrix.config.os }}-${{ steps.install-r.outputs.installed-r-version }}-1-
37-
38-
- name: Install system dependencies
39-
if: runner.os == 'Linux'
40-
run: |
41-
pak::local_system_requirements(execute = TRUE)
42-
pak::pkg_system_requirements("rcmdcheck", execute = TRUE)
43-
shell: Rscript {0}
44-
- name: Install dependencies
45-
run: |
46-
pak::local_install_dev_deps(upgrade = TRUE)
47-
pak::pkg_install("covr")
48-
shell: Rscript {0}
4923

50-
- uses: r-lib/actions/setup-r-dependencies@v1
24+
- uses: r-lib/actions/setup-r-dependencies@v2
5125
with:
52-
extra-packages: covr
26+
extra-packages: any::covr
27+
needs: coverage
5328

5429
- name: Test coverage
55-
run: covr::codecov()
30+
run: |
31+
covr::codecov(
32+
quiet = FALSE,
33+
clean = FALSE,
34+
install_path = file.path(Sys.getenv("RUNNER_TEMP"), "package")
35+
)
5636
shell: Rscript {0}
5737

38+
- name: Show testthat output
39+
if: always()
40+
run: |
41+
## --------------------------------------------------------------------
42+
find ${{ runner.temp }}/package -name 'testthat.Rout*' -exec cat '{}' \; || true
43+
shell: bash
44+
45+
- name: Upload test results
46+
if: failure()
47+
uses: actions/upload-artifact@v3
48+
with:
49+
name: coverage-test-failures
50+
path: ${{ runner.temp }}/package

0 commit comments

Comments
 (0)