Skip to content

Commit ced6562

Browse files
committed
Update GHA workflow files
1 parent 931b83d commit ced6562

File tree

4 files changed

+27
-16
lines changed

4 files changed

+27
-16
lines changed

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

+6-7
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@ on:
66
pull_request:
77
branches: [main, master]
88

9-
name: R-CMD-check
9+
name: R-CMD-check.yaml
10+
11+
permissions: read-all
1012

1113
jobs:
1214
R-CMD-check:
@@ -29,7 +31,7 @@ jobs:
2931
R_KEEP_PKG_SOURCE: yes
3032

3133
steps:
32-
- uses: actions/checkout@v3
34+
- uses: actions/checkout@v4
3335

3436
- uses: r-lib/actions/setup-pandoc@v2
3537

@@ -41,13 +43,10 @@ jobs:
4143

4244
- uses: r-lib/actions/setup-r-dependencies@v2
4345
with:
44-
extra-packages: |
45-
any::rcmdcheck
46+
extra-packages: any::rcmdcheck
4647
needs: check
4748

4849
- uses: r-lib/actions/check-r-package@v2
4950
with:
5051
upload-snapshots: true
51-
args: c("--ignore-vignettes", "--no-manual", "--as-cran")
52-
build_args: c("--no-build-vignettes")
53-
52+
build_args: 'c("--no-manual", "--no-build-vignettes")'

.github/workflows/test-coverage.yaml

+19-8
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:
@@ -15,36 +16,46 @@ jobs:
1516
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
1617

1718
steps:
18-
- uses: actions/checkout@v3
19+
- uses: actions/checkout@v4
1920

2021
- uses: r-lib/actions/setup-r@v2
2122
with:
2223
use-public-rspm: true
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+
covr::to_cobertura(cov)
3638
shell: Rscript {0}
3739

40+
- uses: codecov/codecov-action@v4
41+
with:
42+
# Fail if error if not on PR, or if on PR and token is given
43+
fail_ci_if_error: ${{ github.event_name != 'pull_request' || secrets.CODECOV_TOKEN }}
44+
file: ./cobertura.xml
45+
plugin: noop
46+
disable_search: true
47+
token: ${{ secrets.CODECOV_TOKEN }}
48+
3849
- name: Show testthat output
3950
if: always()
4051
run: |
4152
## --------------------------------------------------------------------
42-
find ${{ runner.temp }}/package -name 'testthat.Rout*' -exec cat '{}' \; || true
53+
find '${{ runner.temp }}/package' -name 'testthat.Rout*' -exec cat '{}' \; || true
4354
shell: bash
4455

4556
- name: Upload test results
4657
if: failure()
47-
uses: actions/upload-artifact@v3
58+
uses: actions/upload-artifact@v4
4859
with:
4960
name: coverage-test-failures
5061
path: ${{ runner.temp }}/package

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
[![CRAN_Status_Badge](https://www.r-pkg.org/badges/version/loo?color=blue)](https://cran.r-project.org/web/packages/loo)
55
[![RStudio_CRAN_mirror_downloads_badge](https://cranlogs.r-pkg.org/badges/loo?color=blue)](https://cran.r-project.org/web/packages/loo)
66
[![codecov](https://codecov.io/gh/stan-dev/loo/branch/master/graph/badge.svg)](https://codecov.io/github/stan-dev/loo?branch=master)
7-
[![R-CMD-check](https://github.com/stan-dev/loo/workflows/R-CMD-check/badge.svg)](https://github.com/stan-dev/loo/actions)
7+
[![R-CMD-check](https://github.com/stan-dev/loo/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/stan-dev/loo/actions/workflows/R-CMD-check.yaml)
88
<!-- badges: end -->
99

1010
### Efficient approximate leave-one-out cross-validation for fitted Bayesian models

loo.Rproj

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
Version: 1.0
2+
ProjectId: 34c704c1-360c-424e-857d-7999a94e1037
23

34
RestoreWorkspace: Default
45
SaveWorkspace: Default

0 commit comments

Comments
 (0)