Skip to content

Commit 34c19e1

Browse files
Merge pull request #33 from rOpenGov/32-update-github-actions
Update actions and lintr
2 parents 1a5d986 + fd82f64 commit 34c19e1

8 files changed

+176
-94
lines changed

.github/dependabot.yml

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: "github-actions"
4+
directory: "/"
5+
schedule:
6+
interval: "weekly"

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

+26-29
Original file line numberDiff line numberDiff line change
@@ -1,62 +1,59 @@
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:
5-
branches:
6-
- main
7-
- master
5+
branches: main
86
pull_request:
9-
branches:
10-
- main
11-
- master
7+
workflow_dispatch:
8+
schedule:
9+
- cron: "30 17 * * 6"
1210

1311
name: R-CMD-check
1412

13+
permissions: read-all
14+
1515
jobs:
1616
R-CMD-check:
1717
runs-on: ${{ matrix.config.os }}
1818

1919
name: ${{ matrix.config.os }} (${{ matrix.config.r }})
2020

2121
strategy:
22-
fail-fast: false
22+
fail-fast: true
2323
matrix:
2424
config:
25+
- {os: macos-latest, r: 'release'}
2526
- {os: windows-latest, r: 'release'}
26-
- {os: macOS-latest, r: 'release'}
27-
- {os: ubuntu-20.04, r: 'devel', http-user-agent: 'release'}
28-
- {os: ubuntu-20.04, r: 'release'}
29-
- {os: ubuntu-20.04, r: 'oldrel-1'}
27+
- {os: ubuntu-22.04, r: 'release'}
28+
- {os: ubuntu-24.04, r: 'devel', http-user-agent: 'release'}
29+
- {os: ubuntu-24.04, r: 'release'}
30+
- {os: ubuntu-24.04, r: 'oldrel-1'}
31+
3032

3133
env:
3234
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
3335
R_KEEP_PKG_SOURCE: yes
3436

3537
steps:
36-
- uses: actions/checkout@v2
38+
- uses: actions/checkout@v4
3739

38-
- uses: r-lib/actions/setup-pandoc@master
40+
- uses: r-lib/actions/setup-pandoc@v2
3941

40-
- uses: r-lib/actions/setup-r@master
42+
- uses: r-lib/actions/setup-r@v2
4143
with:
4244
r-version: ${{ matrix.config.r }}
4345
http-user-agent: ${{ matrix.config.http-user-agent }}
4446
use-public-rspm: true
4547

46-
- uses: r-lib/actions/setup-r-dependencies@master
48+
- uses: r-lib/actions/setup-r-dependencies@v2
4749
with:
48-
extra-packages: rcmdcheck
49-
50-
- uses: r-lib/actions/check-r-package@master
51-
52-
- name: Show testthat output
53-
if: always()
54-
run: find check -name 'testthat.Rout*' -exec cat '{}' \; || true
55-
shell: bash
50+
cache-version: 3
51+
extra-packages: |
52+
any::rcmdcheck
53+
needs: |
54+
check
5655
57-
- name: Upload check results
58-
if: failure()
59-
uses: actions/upload-artifact@main
56+
- uses: r-lib/actions/check-r-package@v2
6057
with:
61-
name: ${{ runner.os }}-r${{ matrix.config.r }}-results
62-
path: check
58+
upload-snapshots: true
59+
build_args: 'c("--no-manual","--compact-vignettes=gs+qpdf")'

.github/workflows/document.yaml

+60
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
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
3+
on:
4+
push:
5+
paths:
6+
- "R/**"
7+
- "README.Rmd"
8+
- '.github/workflows/document.yaml'
9+
workflow_dispatch:
10+
11+
name: document.yaml
12+
13+
permissions: read-all
14+
15+
jobs:
16+
document:
17+
runs-on: ubuntu-24.04
18+
env:
19+
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
20+
permissions:
21+
contents: write
22+
steps:
23+
- name: Checkout repo
24+
uses: actions/checkout@v4
25+
with:
26+
fetch-depth: 0
27+
28+
- name: Setup R
29+
uses: r-lib/actions/setup-r@v2
30+
with:
31+
use-public-rspm: true
32+
r-version: 'renv'
33+
34+
- name: Install dependencies
35+
uses: r-lib/actions/setup-r-dependencies@v2
36+
with:
37+
cache-version: 2
38+
extra-packages: |
39+
any::roxygen2
40+
any::devtools
41+
needs: |
42+
roxygen2
43+
devtools
44+
45+
- name: Document
46+
run: roxygen2::roxygenise()
47+
shell: Rscript {0}
48+
49+
- name: Build readme
50+
run: devtools::build_readme()
51+
shell: Rscript {0}
52+
53+
- name: Commit and push changes
54+
run: |
55+
git config --local user.name "$GITHUB_ACTOR"
56+
git config --local user.email "[email protected]"
57+
git add man/\* NAMESPACE DESCRIPTION
58+
git commit -m "(Github Actions): Update documentation" || echo "No changes to commit"
59+
git pull --ff-only
60+
git push origin

.github/workflows/lint.yaml

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
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
3+
on:
4+
pull_request:
5+
6+
name: lint.yaml
7+
8+
permissions: read-all
9+
10+
jobs:
11+
lint:
12+
runs-on: ubuntu-24.04
13+
env:
14+
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
15+
steps:
16+
- uses: actions/checkout@v4
17+
18+
- uses: r-lib/actions/setup-r@v2
19+
with:
20+
use-public-rspm: true
21+
r-version: 'renv'
22+
23+
- uses: r-lib/actions/setup-r-dependencies@v2
24+
with:
25+
cache-version: 2
26+
extra-packages: any::lintr, local::.
27+
needs: lint
28+
29+
- name: Lint
30+
run: lintr::lint_package()
31+
shell: Rscript {0}
32+
env:
33+
LINTR_ERROR_ON_LINT: true

.github/workflows/render-readme.yaml

-50
This file was deleted.

.github/workflows/rogtemplate-gh-pages.yaml

+6-5
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ on:
44
push:
55
branches: [main, master]
66
tags: ['*']
7-
paths-ignore:
7+
paths-ignore:
88
- 'README.Rmd'
99
repository_dispatch:
1010
types: [trigger-pkgdown-workflow]
@@ -18,15 +18,16 @@ jobs:
1818
env:
1919
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
2020
steps:
21-
- uses: actions/checkout@v2
21+
- uses: actions/checkout@v4
2222

23-
- uses: r-lib/actions/setup-pandoc@v1
23+
- uses: r-lib/actions/setup-pandoc@v2
2424

25-
- uses: r-lib/actions/setup-r@v1
25+
- uses: r-lib/actions/setup-r@v2
2626
with:
2727
use-public-rspm: true
28+
r-version: 'renv'
2829

29-
- uses: r-lib/actions/setup-r-dependencies@v1
30+
- uses: r-lib/actions/setup-r-dependencies@v2
3031
with:
3132
extra-packages: |
3233
magick

.github/workflows/test-coverage.yaml

+43-10
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,63 @@
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:
5-
branches: [main, master]
5+
branches: main
66
pull_request:
7-
branches: [main, master]
87

9-
name: test-coverage
8+
name: test-coverage.yaml
9+
10+
permissions: read-all
1011

1112
jobs:
1213
test-coverage:
13-
runs-on: ubuntu-latest
14+
runs-on: ubuntu-24.04
15+
# runs-on: macos-latest
1416
env:
1517
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
1618

1719
steps:
18-
- uses: actions/checkout@v2
20+
- uses: actions/checkout@v4
1921

20-
- uses: r-lib/actions/setup-r@v1
22+
- uses: r-lib/actions/setup-r@v2
2123
with:
2224
use-public-rspm: true
25+
r-version: 'renv'
2326

24-
- uses: r-lib/actions/setup-r-dependencies@v1
27+
- uses: r-lib/actions/setup-r-dependencies@v2
2528
with:
26-
extra-packages: covr
29+
cache-version: 2
30+
extra-packages: any::covr, any::xml2
31+
needs: coverage
2732

2833
- name: Test coverage
29-
run: covr::codecov()
34+
run: |
35+
cov <- covr::package_coverage(
36+
quiet = FALSE,
37+
clean = FALSE,
38+
install_path = file.path(normalizePath(Sys.getenv("RUNNER_TEMP"), winslash = "/"), "package")
39+
)
40+
covr::to_cobertura(cov)
3041
shell: Rscript {0}
42+
43+
- uses: codecov/codecov-action@v4
44+
with:
45+
fail_ci_if_error: ${{ github.event_name != 'pull_request' && true || false }}
46+
file: ./cobertura.xml
47+
plugin: noop
48+
disable_search: true
49+
token: ${{ secrets.CODECOV_TOKEN }}
50+
51+
- name: Show testthat output
52+
if: always()
53+
run: |
54+
## --------------------------------------------------------------------
55+
find '${{ runner.temp }}/package' -name 'testthat.Rout*' -exec cat '{}' \; || true
56+
shell: bash
57+
58+
- name: Upload test results
59+
if: failure()
60+
uses: actions/upload-artifact@v4
61+
with:
62+
name: coverage-test-failures
63+
path: ${{ runner.temp }}/package

.lintr

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
linters: linters_with_defaults() # see vignette("lintr")
2+
encoding: "UTF-8"

0 commit comments

Comments
 (0)