Skip to content

Commit 97f038b

Browse files
committed
workflows: replace test-coverage and R-CMD-check standard for latest version in r-lib/actions, and small adjustment to r_ubuntuOnly.yml
1 parent a697927 commit 97f038b

3 files changed

Lines changed: 35 additions & 51 deletions

File tree

.github/workflows/r_codecov.yml

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@ on:
66
pull_request:
77
branches: [main, master]
88

9-
name: test-coverage
9+
name: test-coverage.yaml
10+
11+
permissions: read-all
1012

1113
jobs:
1214
test-coverage:
@@ -23,28 +25,39 @@ jobs:
2325

2426
- uses: r-lib/actions/setup-r-dependencies@v2
2527
with:
26-
extra-packages: any::covr
28+
extra-packages: any::covr, any::xml2
2729
needs: coverage
2830

2931
- name: Test coverage
3032
run: |
31-
covr::codecov(
33+
cov <- covr::package_coverage(
3234
quiet = FALSE,
3335
clean = FALSE,
3436
install_path = file.path(normalizePath(Sys.getenv("RUNNER_TEMP"), winslash = "/"), "package")
3537
)
38+
print(cov)
39+
covr::to_cobertura(cov)
3640
shell: Rscript {0}
3741

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

4558
- name: Upload test results
4659
if: failure()
4760
uses: actions/upload-artifact@v4
4861
with:
4962
name: coverage-test-failures
50-
path: ${{ runner.temp }}/package
63+
path: ${{ runner.temp }}/package

.github/workflows/r_multiOS.yml

Lines changed: 6 additions & 4 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: R-CMD-check
8+
name: R-CMD-check.yaml
9+
10+
permissions: read-all
1011

1112
jobs:
1213
R-CMD-check:
@@ -18,7 +19,7 @@ jobs:
1819
fail-fast: false
1920
matrix:
2021
config:
21-
- {os: macOS-latest, r: 'release'}
22+
- {os: macos-latest, r: 'release'}
2223
- {os: windows-latest, r: 'release'}
2324
- {os: ubuntu-latest, r: 'devel', http-user-agent: 'release'}
2425
- {os: ubuntu-latest, r: 'release'}
@@ -46,4 +47,5 @@ jobs:
4647

4748
- uses: r-lib/actions/check-r-package@v2
4849
with:
49-
upload-snapshots: true
50+
upload-snapshots: true
51+
build_args: 'c("--no-manual","--compact-vignettes=gs+qpdf")'

.github/workflows/r_ubuntuOnly.yml

Lines changed: 11 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,6 @@ jobs:
2323
- {os: ubuntu-latest, r: 'release', rspm: "https://packagemanager.rstudio.com/cran/__linux__/focal/latest"}
2424

2525
env:
26-
R_REMOTES_NO_ERRORS_FROM_WARNINGS: true
27-
RSPM: ${{ matrix.config.rspm }}
2826
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
2927

3028
steps:
@@ -33,47 +31,18 @@ jobs:
3331
- run: tlmgr --version
3432
- uses: r-lib/actions/setup-r@v2
3533
with:
36-
r-version: ${{ matrix.config.r }}
34+
r-version: 'release'
35+
use-public-rspm: true
3736

3837
- uses: r-lib/actions/setup-pandoc@v2
39-
40-
- name: Query dependencies
41-
run: |
42-
install.packages('remotes')
43-
saveRDS(remotes::dev_package_deps(dependencies = TRUE), ".github/depends.Rds", version = 2)
44-
writeLines(sprintf("R-%i.%i", getRversion()$major, getRversion()$minor), ".github/R-version")
45-
shell: Rscript {0}
46-
47-
- name: Cache R packages
48-
if: runner.os != 'Windows'
49-
uses: actions/cache@v4
38+
39+
- uses: r-lib/actions/setup-r-dependencies@v2
5040
with:
51-
path: ${{ env.R_LIBS_USER }}
52-
key: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-${{ hashFiles('.github/depends.Rds') }}
53-
54-
- name: Install system dependencies
55-
if: runner.os == 'Linux'
56-
run: |
57-
while read -r cmd
58-
do
59-
eval sudo $cmd
60-
done < <(Rscript -e 'writeLines(remotes::system_requirements("ubuntu", "20.04"))')
61-
62-
- name: Install dependencies
63-
run: |
64-
remotes::install_deps(dependencies = TRUE)
65-
remotes::install_cran("rcmdcheck")
66-
shell: Rscript {0}
67-
68-
- name: Check
69-
env:
70-
_R_CHECK_CRAN_INCOMING_REMOTE_: false
71-
run: rcmdcheck::rcmdcheck(args = c("--no-manual"), check_dir = "check")
72-
shell: Rscript {0}
73-
74-
- name: Upload check results
75-
if: failure()
76-
uses: actions/upload-artifact@main
41+
extra-packages: any::rcmdcheck
42+
needs: check
43+
cache-version: 2
44+
use-public-rspm: true
45+
46+
- uses: r-lib/actions/check-r-package@v2
7747
with:
78-
name: ${{ runner.os }}-r${{ matrix.config.r }}-results
79-
path: check
48+
upload-snapshots: true

0 commit comments

Comments
 (0)