Skip to content

Commit 0f1004b

Browse files
committed
Update github actions
1 parent ff1c8b8 commit 0f1004b

File tree

2 files changed

+50
-17
lines changed

2 files changed

+50
-17
lines changed

.github/workflows/pkgdown.yaml

+24-11
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@v4
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/test-coverage.yaml

+26-6
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@v4
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@v4
48+
with:
49+
name: coverage-test-failures
50+
path: ${{ runner.temp }}/package

0 commit comments

Comments
 (0)