Skip to content

Commit dac4825

Browse files
committed
github action update
1 parent 4dd065e commit dac4825

File tree

5 files changed

+123
-22
lines changed

5 files changed

+123
-22
lines changed

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

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,17 @@
11
# 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
3+
#
4+
# NOTE: This workflow is overkill for most R packages and
5+
# check-standard.yaml is likely a better choice.
6+
# usethis::use_github_action("check-standard") will install it.
37
on:
48
push:
59
branches: [main, master]
610
pull_request:
7-
branches: [main, master]
811

9-
name: R-CMD-check
12+
name: R-CMD-check.yaml
13+
14+
permissions: read-all
1015

1116
jobs:
1217
R-CMD-check:
@@ -19,10 +24,17 @@ jobs:
1924
matrix:
2025
config:
2126
- {os: macos-latest, r: 'release'}
27+
2228
- {os: windows-latest, r: 'release'}
23-
- {os: ubuntu-latest, r: 'devel', http-user-agent: 'release'}
24-
- {os: ubuntu-latest, r: 'release'}
25-
- {os: ubuntu-latest, r: 'oldrel-1'}
29+
# use 4.0 or 4.1 to check with rtools40's older compiler
30+
- {os: windows-latest, r: 'oldrel-4'}
31+
32+
- {os: ubuntu-latest, r: 'devel', http-user-agent: 'release'}
33+
- {os: ubuntu-latest, r: 'release'}
34+
- {os: ubuntu-latest, r: 'oldrel-1'}
35+
- {os: ubuntu-latest, r: 'oldrel-2'}
36+
- {os: ubuntu-latest, r: 'oldrel-3'}
37+
- {os: ubuntu-latest, r: 'oldrel-4'}
2638

2739
env:
2840
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/pkgdown.yaml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,13 @@ on:
44
push:
55
branches: [main, master]
66
pull_request:
7-
branches: [main, master]
87
release:
98
types: [published]
109
workflow_dispatch:
1110

12-
name: pkgdown
11+
name: pkgdown.yaml
12+
13+
permissions: read-all
1314

1415
jobs:
1516
pkgdown:

.github/workflows/pr-commands.yaml

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
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+
issue_comment:
5+
types: [created]
6+
7+
name: pr-commands.yaml
8+
9+
permissions: read-all
10+
11+
jobs:
12+
document:
13+
if: ${{ github.event.issue.pull_request && (github.event.comment.author_association == 'MEMBER' || github.event.comment.author_association == 'OWNER') && startsWith(github.event.comment.body, '/document') }}
14+
name: document
15+
runs-on: ubuntu-latest
16+
env:
17+
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
18+
permissions:
19+
contents: write
20+
steps:
21+
- uses: actions/checkout@v4
22+
23+
- uses: r-lib/actions/pr-fetch@v2
24+
with:
25+
repo-token: ${{ secrets.GITHUB_TOKEN }}
26+
27+
- uses: r-lib/actions/setup-r@v2
28+
with:
29+
use-public-rspm: true
30+
31+
- uses: r-lib/actions/setup-r-dependencies@v2
32+
with:
33+
extra-packages: any::roxygen2
34+
needs: pr-document
35+
36+
- name: Document
37+
run: roxygen2::roxygenise()
38+
shell: Rscript {0}
39+
40+
- name: commit
41+
run: |
42+
git config --local user.name "$GITHUB_ACTOR"
43+
git config --local user.email "[email protected]"
44+
git add man/\* NAMESPACE
45+
git commit -m 'Document'
46+
47+
- uses: r-lib/actions/pr-push@v2
48+
with:
49+
repo-token: ${{ secrets.GITHUB_TOKEN }}
50+
51+
style:
52+
if: ${{ github.event.issue.pull_request && (github.event.comment.author_association == 'MEMBER' || github.event.comment.author_association == 'OWNER') && startsWith(github.event.comment.body, '/style') }}
53+
name: style
54+
runs-on: ubuntu-latest
55+
env:
56+
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
57+
permissions:
58+
contents: write
59+
steps:
60+
- uses: actions/checkout@v4
61+
62+
- uses: r-lib/actions/pr-fetch@v2
63+
with:
64+
repo-token: ${{ secrets.GITHUB_TOKEN }}
65+
66+
- uses: r-lib/actions/setup-r@v2
67+
68+
- name: Install dependencies
69+
run: install.packages("styler")
70+
shell: Rscript {0}
71+
72+
- name: Style
73+
run: styler::style_pkg()
74+
shell: Rscript {0}
75+
76+
- name: commit
77+
run: |
78+
git config --local user.name "$GITHUB_ACTOR"
79+
git config --local user.email "[email protected]"
80+
git add \*.R
81+
git commit -m 'Style'
82+
83+
- uses: r-lib/actions/pr-push@v2
84+
with:
85+
repo-token: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/test-coverage.yaml

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,10 @@ on:
44
push:
55
branches: [main, master]
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:
@@ -23,23 +24,34 @@ jobs:
2324

2425
- uses: r-lib/actions/setup-r-dependencies@v2
2526
with:
26-
extra-packages: any::covr
27+
extra-packages: any::covr, any::xml2
2728
needs: coverage
2829

2930
- name: Test coverage
3031
run: |
31-
covr::codecov(
32+
cov <- covr::package_coverage(
3233
quiet = FALSE,
3334
clean = FALSE,
34-
install_path = file.path(Sys.getenv("RUNNER_TEMP"), "package")
35+
install_path = file.path(normalizePath(Sys.getenv("RUNNER_TEMP"), winslash = "/"), "package")
3536
)
37+
print(cov)
38+
covr::to_cobertura(cov)
3639
shell: Rscript {0}
3740

41+
- uses: codecov/codecov-action@v5
42+
with:
43+
# Fail if error if not on PR, or if on PR and token is given
44+
fail_ci_if_error: ${{ github.event_name != 'pull_request' || secrets.CODECOV_TOKEN }}
45+
files: ./cobertura.xml
46+
plugins: noop
47+
disable_search: true
48+
token: ${{ secrets.CODECOV_TOKEN }}
49+
3850
- name: Show testthat output
3951
if: always()
4052
run: |
4153
## --------------------------------------------------------------------
42-
find ${{ runner.temp }}/package -name 'testthat.Rout*' -exec cat '{}' \; || true
54+
find '${{ runner.temp }}/package' -name 'testthat.Rout*' -exec cat '{}' \; || true
4355
shell: bash
4456

4557
- name: Upload test results

.travis.yml

Lines changed: 0 additions & 9 deletions
This file was deleted.

0 commit comments

Comments
 (0)