Skip to content

Commit a4f435b

Browse files
committed
Use new v2 GitHub actions
1 parent 29541a6 commit a4f435b

File tree

3 files changed

+63
-37
lines changed

3 files changed

+63
-37
lines changed

.github/workflows/check-standard.yaml

Lines changed: 10 additions & 19 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:
@@ -18,7 +18,7 @@ jobs:
1818
fail-fast: false
1919
matrix:
2020
config:
21-
- {os: macOS-latest, r: 'release'}
21+
- {os: macos-latest, r: 'release'}
2222
- {os: windows-latest, r: 'release'}
2323
- {os: ubuntu-latest, r: 'devel', http-user-agent: 'release'}
2424
- {os: ubuntu-latest, r: 'release'}
@@ -29,30 +29,21 @@ jobs:
2929
R_KEEP_PKG_SOURCE: yes
3030

3131
steps:
32-
- uses: actions/checkout@v2
32+
- uses: actions/checkout@v3
3333

34-
- uses: r-lib/actions/setup-pandoc@v1
34+
- uses: r-lib/actions/setup-pandoc@v2
3535

36-
- uses: r-lib/actions/setup-r@v1
36+
- uses: r-lib/actions/setup-r@v2
3737
with:
3838
r-version: ${{ matrix.config.r }}
3939
http-user-agent: ${{ matrix.config.http-user-agent }}
4040
use-public-rspm: true
4141

42-
- uses: r-lib/actions/setup-r-dependencies@v1
42+
- uses: r-lib/actions/setup-r-dependencies@v2
4343
with:
44-
extra-packages: rcmdcheck
44+
extra-packages: any::rcmdcheck
45+
needs: check
4546

46-
- uses: r-lib/actions/check-r-package@v1
47-
48-
- name: Show testthat output
49-
if: always()
50-
run: find check -name 'testthat.Rout*' -exec cat '{}' \; || true
51-
shell: bash
52-
53-
- name: Upload check results
54-
if: failure()
55-
uses: actions/upload-artifact@main
47+
- uses: r-lib/actions/check-r-package@v2
5648
with:
57-
name: ${{ runner.os }}-r${{ matrix.config.r }}-results
58-
path: check
49+
upload-snapshots: true

.github/workflows/pkgdown.yaml

Lines changed: 27 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,48 @@
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-
tags: ['*']
6+
pull_request:
7+
branches: [main, master]
8+
release:
9+
types: [published]
10+
workflow_dispatch:
711

812
name: pkgdown
913

1014
jobs:
1115
pkgdown:
1216
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 }}
1320
env:
1421
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
22+
permissions:
23+
contents: write
1524
steps:
16-
- uses: actions/checkout@v2
25+
- uses: actions/checkout@v3
1726

18-
- uses: r-lib/actions/setup-pandoc@v1
27+
- uses: r-lib/actions/setup-pandoc@v2
1928

20-
- uses: r-lib/actions/setup-r@v1
29+
- uses: r-lib/actions/setup-r@v2
2130
with:
2231
use-public-rspm: true
2332

24-
- uses: r-lib/actions/setup-r-dependencies@v1
33+
- uses: r-lib/actions/setup-r-dependencies@v2
2534
with:
26-
extra-packages: pkgdown
35+
extra-packages: any::pkgdown, local::.
2736
needs: website
2837

29-
- name: Deploy package
30-
run: |
31-
git config --local user.name "$GITHUB_ACTOR"
32-
git config --local user.email "$GITHUB_ACTOR@users.noreply.github.com"
33-
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/github-pages-deploy-action@v4.4.1
45+
with:
46+
clean: false
47+
branch: gh-pages
48+
folder: docs

.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(Sys.getenv("RUNNER_TEMP"), "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)