Skip to content

Commit 674b532

Browse files
authored
Merge pull request #76 from bcgov/update-actions
Update GH actions + readme badge url
2 parents c3066e1 + 8d644e3 commit 674b532

File tree

3 files changed

+47
-73
lines changed

3 files changed

+47
-73
lines changed

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

+24-58
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,14 @@
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

13-
name: R-CMD-check
9+
name: R-CMD-check.yaml
10+
11+
permissions: read-all
1412

1513
jobs:
1614
R-CMD-check:
@@ -22,65 +20,33 @@ jobs:
2220
fail-fast: false
2321
matrix:
2422
config:
23+
- {os: macos-latest, r: 'release'}
2524
- {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-20.04, r: 'devel', rspm: "https://packagemanager.rstudio.com/cran/__linux__/focal/latest"}
25+
- {os: ubuntu-latest, r: 'devel', http-user-agent: 'release'}
26+
- {os: ubuntu-latest, r: 'release'}
27+
- {os: ubuntu-latest, r: 'oldrel-1'}
2928

3029
env:
31-
R_REMOTES_NO_ERRORS_FROM_WARNINGS: true
32-
RSPM: ${{ matrix.config.rspm }}
3330
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
31+
R_KEEP_PKG_SOURCE: yes
3432

3533
steps:
36-
- uses: actions/checkout@v2
34+
- uses: actions/checkout@v4
35+
36+
- uses: r-lib/actions/setup-pandoc@v2
3737

38-
- uses: r-lib/actions/setup-r@v1
38+
- uses: r-lib/actions/setup-r@v2
3939
with:
4040
r-version: ${{ matrix.config.r }}
41+
http-user-agent: ${{ matrix.config.http-user-agent }}
42+
use-public-rspm: true
4143

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

81-
- name: Upload check results
82-
if: failure()
83-
uses: actions/upload-artifact@main
49+
- uses: r-lib/actions/check-r-package@v2
8450
with:
85-
name: ${{ runner.os }}-r${{ matrix.config.r }}-results
86-
path: check
51+
upload-snapshots: true
52+
build_args: 'c("--no-manual","--compact-vignettes=gs+qpdf")'

README.Rmd

+6-2
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,13 @@ knitr::opts_chunk$set(
1616
```
1717

1818
# bcgovr <img src="tools/readme/logo.png" align="right" />
19-
[![img](https://img.shields.io/badge/Lifecycle-Stable-97ca00)](https://github.com/bcgov/repomountie/blob/master/doc/lifecycle-badges.md)
20-
[![R-CMD-check](https://github.com/bcgov/bcgovr/workflows/R-CMD-check/badge.svg)](https://github.com/bcgov/bcgovr/actions)
19+
20+
<!-- badges: start -->
2121
[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
22+
[![img](https://img.shields.io/badge/Lifecycle-Stable-97ca00)](https://github.com/bcgov/repomountie/blob/master/doc/lifecycle-badges.md)
23+
[![R-CMD-check](https://github.com/bcgov/bcgovr/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/bcgov/bcgovr/actions/workflows/R-CMD-check.yaml)
24+
25+
<!-- badges: end -->
2226

2327

2428
## Overview

README.md

+17-13
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,13 @@
33

44
# bcgovr <img src="tools/readme/logo.png" align="right" />
55

6-
[![img](https://img.shields.io/badge/Lifecycle-Stable-97ca00)](https://github.com/bcgov/repomountie/blob/master/doc/lifecycle-badges.md)
7-
[![R-CMD-check](https://github.com/bcgov/bcgovr/workflows/R-CMD-check/badge.svg)](https://github.com/bcgov/bcgovr/actions)
6+
<!-- badges: start -->
7+
88
[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
9+
[![img](https://img.shields.io/badge/Lifecycle-Stable-97ca00)](https://github.com/bcgov/repomountie/blob/master/doc/lifecycle-badges.md)
10+
[![R-CMD-check](https://github.com/bcgov/bcgovr/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/bcgov/bcgovr/actions/workflows/R-CMD-check.yaml)
11+
12+
<!-- badges: end -->
913

1014
## Overview
1115

@@ -74,16 +78,16 @@ required bcgov GitHub files and initialise Git version control.
7478
The `bcgovr` package installs a set of [RStudio
7579
Addins](https://rstudio.github.io/rstudioaddins/):
7680

77-
1. Insert the [boiler-plate Apache 2.0 license
81+
1) Insert the [boiler-plate Apache 2.0 license
7882
header](https://github.com/bcgov/BC-Policy-Framework-For-GitHub/blob/master/BC-Open-Source-Development-Employee-Guide/Licenses.md)
7983
into the comments header of a source file (uses
8084
`insert_bcgov_apache_header()`).
81-
2. Insert the [boiler-plate Creative Commons Attribution 4.0
85+
2) Insert the [boiler-plate Creative Commons Attribution 4.0
8286
International License
8387
header](https://github.com/bcgov/BC-Policy-Framework-For-GitHub/blob/master/BC-Open-Source-Development-Employee-Guide/Licenses.md)
8488
into the comments header of a source file (uses
8589
`insert_bcgov_cc_header()`).
86-
3. Insert a [bcgov project lifecycle
90+
3) Insert a [bcgov project lifecycle
8791
badge](https://github.com/bcgov/repomountie/blob/master/doc/lifecycle-badges.md)
8892
into an .Rmd or .md file to indicate the current state of a project
8993
(uses `insert_bcgov_lifecycle_badge()`).
@@ -332,16 +336,16 @@ There are several options you can specify in your `.Rprofile` file to
332336
customise the default behaviour when using the `create_bcgov_` and
333337
`use_bcgov_` functions in `bcgovr`.
334338

335-
- `bcgovr.coc.email`: Code of Conduct contact email address
339+
- `bcgovr.coc.email`: Code of Conduct contact email address
336340

337-
- `bcgovr.dir.struct`: Alternative project directory structure for
338-
`create_bcgov_project()`. This should be specified as a character
339-
vector of directory (i.e. folders) and file paths, relative to the
340-
root of the project. Directories should be identified by having a
341-
trailing forward-slash (e.g., `"dir/"`).
341+
- `bcgovr.dir.struct`: Alternative project directory structure for
342+
`create_bcgov_project()`. This should be specified as a character
343+
vector of directory (i.e. folders) and file paths, relative to the
344+
root of the project. Directories should be identified by having a
345+
trailing forward-slash (e.g., `"dir/"`).
342346

343-
The default is:
344-
`c("R/", "data/", "out/", "01_load.R", "02_clean.R", "03_analysis.R", "04_output.R", "internal.R", "run_all.R")`.
347+
The default is:
348+
`c("R/", "data/", "out/", "01_load.R", "02_clean.R", "03_analysis.R", "04_output.R", "internal.R", "run_all.R")`.
345349

346350
To make use of these options, there should be a section in your
347351
`.Rprofile` file that looks something like this:

0 commit comments

Comments
 (0)