Skip to content

Commit 240a4d0

Browse files
committed
ci: update GHA workflows
1 parent 1740647 commit 240a4d0

File tree

4 files changed

+31
-14
lines changed

4 files changed

+31
-14
lines changed

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

+5-3
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:
@@ -29,7 +30,7 @@ jobs:
2930
R_KEEP_PKG_SOURCE: yes
3031

3132
steps:
32-
- uses: actions/checkout@v3
33+
- uses: actions/checkout@v4
3334

3435
- uses: r-lib/actions/setup-pandoc@v2
3536

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

.github/workflows/test-coverage.yaml

+19-7
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,47 @@ 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,
3435
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@v4
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+
file: ./cobertura.xml
46+
plugin: 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
4658
if: failure()
47-
uses: actions/upload-artifact@v3
59+
uses: actions/upload-artifact@v4
4860
with:
4961
name: coverage-test-failures
5062
path: ${{ runner.temp }}/package

README.Rmd

+1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ knitr::opts_chunk$set(
1717

1818
<!-- badges: start -->
1919
[![R-CMD-check](https://github.com/maelle/saperlipopette/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/maelle/saperlipopette/actions/workflows/R-CMD-check.yaml)
20+
[![Codecov test coverage](https://codecov.io/gh/maelle/saperlipopette/graph/badge.svg)](https://app.codecov.io/gh/maelle/saperlipopette)
2021
<!-- badges: end -->
2122

2223
The goal of saperlipopette is to hold functions creating Git messes, that users

README.md

+6-4
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
<!-- badges: start -->
77

88
[![R-CMD-check](https://github.com/maelle/saperlipopette/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/maelle/saperlipopette/actions/workflows/R-CMD-check.yaml)
9+
[![Codecov test
10+
coverage](https://codecov.io/gh/maelle/saperlipopette/graph/badge.svg)](https://app.codecov.io/gh/maelle/saperlipopette)
911
<!-- badges: end -->
1012

1113
The goal of saperlipopette is to hold functions creating Git messes,
@@ -47,10 +49,10 @@ This is a basic example which shows you how to solve a common problem:
4749
library("saperlipopette")
4850
parent_path <- withr::local_tempdir()
4951
path <- exo_one_small_change(parent_path)
50-
#> ℹ Follow along in /tmp/RtmpsiMrDj/file3e4f6663be0d/one-small-change!
52+
#> ℹ Follow along in /tmp/RtmprB2S8E/file10b5d656dc3da/one-small-change!
5153
# what's in path
5254
fs::dir_tree(path)
53-
#> /tmp/RtmpsiMrDj/file3e4f6663be0d/one-small-change
55+
#> /tmp/RtmprB2S8E/file10b5d656dc3da/one-small-change
5456
#> ├── R
5557
#> └── bla
5658
# with Git in a command line: git log
@@ -102,7 +104,7 @@ building documentation.
102104
``` r
103105
parent_path <- withr::local_tempdir()
104106
path <- exo_one_small_change(parent_path)
105-
#> ℹ Follow along in /tmp/RtmpsiMrDj/file3e4f474cb413/one-small-change!
107+
#> ℹ Follow along in /tmp/RtmprB2S8E/file10b5d3fcba991/one-small-change!
106108
gert::git_log(repo = path)
107109
#> # A tibble: 2 × 6
108110
#> commit author time files merge message
@@ -111,7 +113,7 @@ gert::git_log(repo = path)
111113
#> 2 e227ecc55e421f70b6e30602e6a2ee… Jane … 2023-12-15 16:25:00 2 FALSE "First…
112114
parent_path2 <- withr::local_tempdir()
113115
path2 <- exo_one_small_change(parent_path2)
114-
#> ℹ Follow along in /tmp/RtmpsiMrDj/file3e4f65cbaffc/one-small-change!
116+
#> ℹ Follow along in /tmp/RtmprB2S8E/file10b5d92f231a/one-small-change!
115117
gert::git_log(repo = path2)
116118
#> # A tibble: 2 × 6
117119
#> commit author time files merge message

0 commit comments

Comments
 (0)