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

Commit 2ab3132

Browse files
committed
Add new GH Actions
Merge remote-tracking branch 'origin' into impressions # Please enter a commit message to explain why this merge is necessary, # especially if it merges an updated upstream into a topic branch. # # Lines starting with '#' will be ignored, and an empty message aborts # the commit.
2 parents 7fd2bd3 + 7423ce0 commit 2ab3132

2 files changed

Lines changed: 45 additions & 100 deletions

File tree

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

Lines changed: 20 additions & 69 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,33 @@ 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 }}
3329
TWITTER_BEARER: ${{ secrets.TWITTER_BEARER }}
30+
R_KEEP_PKG_SOURCE: yes
3431

3532
steps:
36-
- uses: actions/checkout@v2
33+
- uses: actions/checkout@v3
34+
35+
- uses: r-lib/actions/setup-pandoc@v2
3736

38-
- uses: r-lib/actions/setup-r@v1
39-
id: install-r
37+
- uses: r-lib/actions/setup-r@v2
4038
with:
4139
r-version: ${{ matrix.config.r }}
4240
http-user-agent: ${{ matrix.config.http-user-agent }}
41+
use-public-rspm: true
4342

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
43+
- uses: r-lib/actions/setup-r-dependencies@v2
5444
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}
45+
extra-packages: any::rcmdcheck
46+
needs: check
9347

94-
- name: Upload check results
95-
if: failure()
96-
uses: actions/upload-artifact@main
48+
- uses: r-lib/actions/check-r-package@v2
9749
with:
98-
name: ${{ matrix.config.os }}-r${{ matrix.config.r }}-results
99-
path: check
50+
upload-snapshots: true
Lines changed: 25 additions & 31 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:
@@ -14,44 +14,38 @@ jobs:
1414
env:
1515
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
1616
TWITTER_BEARER: ${{ secrets.TWITTER_BEARER }}
17-
17+
1818
steps:
19-
- uses: actions/checkout@v2
19+
- uses: actions/checkout@v3
2020

21-
- uses: r-lib/actions/setup-r@v1
21+
- uses: r-lib/actions/setup-r@v2
2222
with:
2323
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
24+
25+
- uses: r-lib/actions/setup-r-dependencies@v2
3126
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-
27+
extra-packages: any::covr
28+
needs: coverage
3729

38-
- name: Install system dependencies
39-
if: runner.os == 'Linux'
30+
- name: Test coverage
4031
run: |
41-
pak::local_system_requirements(execute = TRUE)
42-
pak::pkg_system_requirements("rcmdcheck", execute = TRUE)
32+
covr::codecov(
33+
quiet = FALSE,
34+
clean = FALSE,
35+
install_path = file.path(Sys.getenv("RUNNER_TEMP"), "package")
36+
)
4337
shell: Rscript {0}
44-
- name: Install dependencies
38+
39+
- name: Show testthat output
40+
if: always()
4541
run: |
46-
pak::local_install_dev_deps(upgrade = TRUE)
47-
pak::pkg_install("covr")
48-
shell: Rscript {0}
42+
## --------------------------------------------------------------------
43+
find ${{ runner.temp }}/package -name 'testthat.Rout*' -exec cat '{}' \; || true
44+
shell: bash
4945

50-
- uses: r-lib/actions/setup-r-dependencies@v1
46+
- name: Upload test results
47+
if: failure()
48+
uses: actions/upload-artifact@v3
5149
with:
52-
extra-packages: covr
53-
54-
- name: Test coverage
55-
run: covr::codecov()
56-
shell: Rscript {0}
57-
50+
name: coverage-test-failures
51+
path: ${{ runner.temp }}/package

0 commit comments

Comments
 (0)