Skip to content

Commit 2c9b57a

Browse files
committed
GHA update
1 parent 07be16b commit 2c9b57a

File tree

4 files changed

+87
-46
lines changed

4 files changed

+87
-46
lines changed

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

Lines changed: 19 additions & 15 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
#
44
# NOTE: This workflow is overkill for most R packages and
@@ -22,37 +22,41 @@ jobs:
2222
fail-fast: false
2323
matrix:
2424
config:
25-
- {os: macOS-latest, r: 'release'}
25+
- {os: macos-latest, r: 'release'}
2626

2727
- {os: windows-latest, r: 'release'}
2828
# Use 3.6 to trigger usage of RTools35
2929
- {os: windows-latest, r: '3.6'}
30+
# use 4.1 to check with rtools40's older compiler
31+
- {os: windows-latest, r: '4.1'}
3032

31-
# Use older ubuntu to maximise backward compatibility
32-
- {os: ubuntu-18.04, r: 'devel', http-user-agent: 'release'}
33-
- {os: ubuntu-18.04, r: 'release'}
34-
- {os: ubuntu-18.04, r: 'oldrel-1'}
35-
- {os: ubuntu-18.04, r: 'oldrel-2'}
36-
- {os: ubuntu-18.04, r: 'oldrel-3'}
37-
- {os: ubuntu-18.04, r: 'oldrel-4'}
33+
- {os: ubuntu-latest, r: 'devel', http-user-agent: 'release'}
34+
- {os: ubuntu-latest, r: 'release'}
35+
- {os: ubuntu-latest, r: 'oldrel-1'}
36+
- {os: ubuntu-latest, r: 'oldrel-2'}
37+
- {os: ubuntu-latest, r: 'oldrel-3'}
38+
- {os: ubuntu-latest, r: 'oldrel-4'}
3839

3940
env:
4041
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
4142
R_KEEP_PKG_SOURCE: yes
4243

4344
steps:
44-
- uses: actions/checkout@v2
45+
- uses: actions/checkout@v3
4546

46-
- uses: r-lib/actions/setup-pandoc@v1
47+
- uses: r-lib/actions/setup-pandoc@v2
4748

48-
- uses: r-lib/actions/setup-r@v1
49+
- uses: r-lib/actions/setup-r@v2
4950
with:
5051
r-version: ${{ matrix.config.r }}
5152
http-user-agent: ${{ matrix.config.http-user-agent }}
5253
use-public-rspm: true
5354

54-
- uses: r-lib/actions/setup-r-dependencies@v1
55+
- uses: r-lib/actions/setup-r-dependencies@v2
5556
with:
56-
extra-packages: rcmdcheck
57+
extra-packages: any::rcmdcheck
58+
needs: check
5759

58-
- uses: r-lib/actions/check-r-package@v1
60+
- uses: r-lib/actions/check-r-package@v2
61+
with:
62+
upload-snapshots: true

.github/workflows/pkgdown.yaml

Lines changed: 24 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
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:
55
branches: [main, master]
6+
pull_request:
7+
branches: [main, master]
68
release:
79
types: [published]
810
workflow_dispatch:
@@ -12,24 +14,35 @@ name: pkgdown
1214
jobs:
1315
pkgdown:
1416
runs-on: ubuntu-latest
17+
# Only restrict concurrency for non-PR jobs
18+
concurrency:
19+
group: pkgdown-${{ github.event_name != 'pull_request' || github.run_id }}
1520
env:
1621
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
22+
permissions:
23+
contents: write
1724
steps:
18-
- uses: actions/checkout@v2
25+
- uses: actions/checkout@v3
1926

20-
- uses: r-lib/actions/setup-pandoc@v1
27+
- uses: r-lib/actions/setup-pandoc@v2
2128

22-
- uses: r-lib/actions/setup-r@v1
29+
- uses: r-lib/actions/setup-r@v2
2330
with:
2431
use-public-rspm: true
2532

26-
- uses: r-lib/actions/setup-r-dependencies@v1
33+
- uses: r-lib/actions/setup-r-dependencies@v2
2734
with:
28-
extra-packages: pkgdown
35+
extra-packages: any::pkgdown, local::.
2936
needs: website
3037

31-
- name: Deploy package
32-
run: |
33-
git config --local user.name "$GITHUB_ACTOR"
34-
git config --local user.email "[email protected]"
35-
Rscript -e 'pkgdown::deploy_to_branch(new_process = FALSE)'
38+
- name: Build site
39+
run: pkgdown::build_site_github_pages(new_process = FALSE, install = FALSE)
40+
shell: Rscript {0}
41+
42+
- name: Deploy to GitHub pages 🚀
43+
if: github.event_name != 'pull_request'
44+
uses: JamesIves/[email protected]
45+
with:
46+
clean: false
47+
branch: gh-pages
48+
folder: docs

.github/workflows/pr-commands.yaml

Lines changed: 18 additions & 14 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
issue_comment:
@@ -14,22 +14,24 @@ jobs:
1414
env:
1515
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
1616
steps:
17-
- uses: actions/checkout@v2
17+
- uses: actions/checkout@v3
1818

19-
- uses: r-lib/actions/pr-fetch@v1
19+
- uses: r-lib/actions/pr-fetch@v2
2020
with:
2121
repo-token: ${{ secrets.GITHUB_TOKEN }}
2222

23-
- uses: r-lib/actions/setup-r@v1
23+
- uses: r-lib/actions/setup-r@v2
2424
with:
2525
use-public-rspm: true
2626

27-
- uses: r-lib/actions/setup-r-dependencies@v1
27+
- uses: r-lib/actions/setup-r-dependencies@v2
2828
with:
29-
extra-packages: roxygen2
29+
extra-packages: any::roxygen2
30+
needs: pr-document
3031

3132
- name: Document
32-
run: Rscript -e 'roxygen2::roxygenise()'
33+
run: roxygen2::roxygenise()
34+
shell: Rscript {0}
3335

3436
- name: commit
3537
run: |
@@ -38,7 +40,7 @@ jobs:
3840
git add man/\* NAMESPACE
3941
git commit -m 'Document'
4042
41-
- uses: r-lib/actions/pr-push@v1
43+
- uses: r-lib/actions/pr-push@v2
4244
with:
4345
repo-token: ${{ secrets.GITHUB_TOKEN }}
4446

@@ -49,19 +51,21 @@ jobs:
4951
env:
5052
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
5153
steps:
52-
- uses: actions/checkout@v2
54+
- uses: actions/checkout@v3
5355

54-
- uses: r-lib/actions/pr-fetch@v1
56+
- uses: r-lib/actions/pr-fetch@v2
5557
with:
5658
repo-token: ${{ secrets.GITHUB_TOKEN }}
5759

58-
- uses: r-lib/actions/setup-r@v1
60+
- uses: r-lib/actions/setup-r@v2
5961

6062
- name: Install dependencies
61-
run: Rscript -e 'install.packages("styler")'
63+
run: install.packages("styler")
64+
shell: Rscript {0}
6265

6366
- name: Style
64-
run: Rscript -e 'styler::style_pkg()'
67+
run: styler::style_pkg()
68+
shell: Rscript {0}
6569

6670
- name: commit
6771
run: |
@@ -70,6 +74,6 @@ jobs:
7074
git add \*.R
7175
git commit -m 'Style'
7276
73-
- uses: r-lib/actions/pr-push@v1
77+
- uses: r-lib/actions/pr-push@v2
7478
with:
7579
repo-token: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/test-coverage.yaml

Lines changed: 26 additions & 6 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:
@@ -15,16 +15,36 @@ jobs:
1515
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
1616

1717
steps:
18-
- uses: actions/checkout@v2
18+
- uses: actions/checkout@v3
1919

20-
- uses: r-lib/actions/setup-r@v1
20+
- uses: r-lib/actions/setup-r@v2
2121
with:
2222
use-public-rspm: true
2323

24-
- uses: r-lib/actions/setup-r-dependencies@v1
24+
- uses: r-lib/actions/setup-r-dependencies@v2
2525
with:
26-
extra-packages: covr
26+
extra-packages: any::covr
27+
needs: coverage
2728

2829
- name: Test coverage
29-
run: covr::codecov()
30+
run: |
31+
covr::codecov(
32+
quiet = FALSE,
33+
clean = FALSE,
34+
install_path = file.path(normalizePath(Sys.getenv("RUNNER_TEMP"), winslash = "/"), "package")
35+
)
3036
shell: Rscript {0}
37+
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)