Skip to content

Commit b884c93

Browse files
authored
Merge pull request #72 from ropensci/update-gha
2 parents b729022 + 3903f15 commit b884c93

File tree

3 files changed

+52
-88
lines changed

3 files changed

+52
-88
lines changed

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

Lines changed: 20 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,10 @@
1-
# For help debugging build failures open an issue on the RStudio community with the 'github-actions' tag.
2-
# https://community.rstudio.com/new-topic?category=Package%20development&tags=github-actions
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
33
on:
44
push:
5-
branches:
6-
- main
7-
- master
5+
branches: [main, master]
86
pull_request:
9-
branches:
10-
- main
11-
- master
7+
branches: [main, master]
128

139
name: R-CMD-check
1410

@@ -22,66 +18,32 @@ jobs:
2218
fail-fast: false
2319
matrix:
2420
config:
21+
- {os: macos-latest, r: 'release'}
2522
- {os: windows-latest, r: 'release'}
26-
- {os: macOS-latest, r: 'release'}
27-
- {os: ubuntu-20.04, r: 'release', rspm: "https://packagemanager.rstudio.com/cran/__linux__/focal/latest"}
28-
- {os: ubuntu-18.04, r: 'release', rspm: "https://packagemanager.rstudio.com/cran/__linux__/bionic/latest"}
29-
- {os: ubuntu-20.04, r: 'devel', rspm: "https://packagemanager.rstudio.com/cran/__linux__/focal/latest"}
23+
- {os: ubuntu-latest, r: 'devel', http-user-agent: 'release'}
24+
- {os: ubuntu-latest, r: 'release'}
25+
- {os: ubuntu-latest, r: 'oldrel-1'}
3026

3127
env:
32-
R_REMOTES_NO_ERRORS_FROM_WARNINGS: true
33-
RSPM: ${{ matrix.config.rspm }}
3428
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
29+
R_KEEP_PKG_SOURCE: yes
3530

3631
steps:
37-
- uses: actions/checkout@v2
32+
- uses: actions/checkout@v3
3833

39-
- uses: r-lib/actions/setup-r@v1
34+
- uses: r-lib/actions/setup-pandoc@v2
35+
36+
- uses: r-lib/actions/setup-r@v2
4037
with:
4138
r-version: ${{ matrix.config.r }}
39+
http-user-agent: ${{ matrix.config.http-user-agent }}
40+
use-public-rspm: true
4241

43-
- uses: r-lib/actions/setup-pandoc@v1
44-
45-
- name: Query dependencies
46-
run: |
47-
install.packages('remotes')
48-
saveRDS(remotes::dev_package_deps(dependencies = TRUE), ".github/depends.Rds", version = 2)
49-
writeLines(sprintf("R-%i.%i", getRversion()$major, getRversion()$minor), ".github/R-version")
50-
shell: Rscript {0}
51-
52-
- name: Cache R packages
53-
if: runner.os != 'Windows'
54-
uses: actions/cache@v2
42+
- uses: r-lib/actions/setup-r-dependencies@v2
5543
with:
56-
path: ${{ env.R_LIBS_USER }}
57-
key: ${{ matrix.config.os }}-${{ hashFiles('.github/R-version') }}-1-${{ hashFiles('.github/depends.Rds') }}
58-
restore-keys: ${{ matrix.config.os }}-${{ hashFiles('.github/R-version') }}-1-
59-
60-
- name: Install system dependencies
61-
if: runner.os == 'Linux'
62-
run: |
63-
while read -r cmd
64-
do
65-
eval sudo $cmd
66-
done < <(Rscript -e 'writeLines(remotes::system_requirements("ubuntu", "20.04"))')
67-
68-
- name: Install dependencies
69-
run: |
70-
remotes::install_deps(dependencies = TRUE)
71-
remotes::install_cran("rcmdcheck")
72-
shell: Rscript {0}
73-
74-
- name: Check
75-
env:
76-
_R_CHECK_CRAN_INCOMING_REMOTE_: false
77-
run: |
78-
options(crayon.enabled = TRUE)
79-
rcmdcheck::rcmdcheck(args = c("--no-manual", "--as-cran"), error_on = "warning", check_dir = "check")
80-
shell: Rscript {0}
44+
extra-packages: any::rcmdcheck
45+
needs: check
8146

82-
- name: Upload check results
83-
if: failure()
84-
uses: actions/upload-artifact@main
47+
- uses: r-lib/actions/check-r-package@v2
8548
with:
86-
name: ${{ matrix.config.os }}-r${{ matrix.config.r }}-results
87-
path: check
49+
upload-snapshots: true

.github/workflows/test-coverage.yaml

Lines changed: 31 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,50 @@
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: test-coverage
1210

1311
jobs:
1412
test-coverage:
15-
runs-on: macOS-latest
13+
runs-on: ubuntu-latest
1614
env:
1715
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
16+
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
21+
with:
22+
use-public-rspm: true
2223

23-
- uses: r-lib/actions/setup-pandoc@v1
24+
- uses: r-lib/actions/setup-r-dependencies@v2
25+
with:
26+
extra-packages: any::covr
27+
needs: coverage
2428

25-
- name: Query dependencies
29+
- name: Test coverage
2630
run: |
27-
install.packages('remotes')
28-
saveRDS(remotes::dev_package_deps(dependencies = TRUE), ".github/depends.Rds", version = 2)
29-
writeLines(sprintf("R-%i.%i", getRversion()$major, getRversion()$minor), ".github/R-version")
31+
covr::codecov(
32+
quiet = FALSE,
33+
clean = FALSE,
34+
install_path = file.path(Sys.getenv("RUNNER_TEMP"), "package")
35+
)
3036
shell: Rscript {0}
3137

32-
- name: Cache R packages
33-
uses: actions/cache@v2
34-
with:
35-
path: ${{ env.R_LIBS_USER }}
36-
key: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-${{ hashFiles('.github/depends.Rds') }}
37-
restore-keys: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-
38-
39-
- name: Install dependencies
38+
- name: Show testthat output
39+
if: always()
4040
run: |
41-
install.packages(c("remotes"))
42-
remotes::install_deps(dependencies = TRUE)
43-
remotes::install_cran("covr")
44-
shell: Rscript {0}
41+
## --------------------------------------------------------------------
42+
find ${{ runner.temp }}/package -name 'testthat.Rout*' -exec cat '{}' \; || true
43+
shell: bash
4544

46-
- name: Test coverage
47-
run: covr::codecov()
48-
shell: Rscript {0}
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

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<!-- badges: start -->
44
[![Project Status: Active – The project has reached a stable, usable state and is being actively developed.](https://www.repostatus.org/badges/latest/active.svg)](https://www.repostatus.org/#active)
5-
[![Build Status](https://travis-ci.org/ropensci/jsonvalidate.svg?branch=master)](https://travis-ci.org/ropensci/jsonvalidate)
5+
[![R-CMD-check](https://github.com/ropensci/jsonvalidate/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/ropensci/jsonvalidate/actions/workflows/R-CMD-check.yaml)
66
[![codecov.io](https://codecov.io/github/ropensci/jsonvalidate/coverage.svg?branch=master)](https://codecov.io/github/ropensci/jsonvalidate?branch=master)
77
[![](http://www.r-pkg.org/badges/version/jsonvalidate)](https://cran.r-project.org/package=jsonvalidate)
88
<!-- badges: end -->

0 commit comments

Comments
 (0)