Skip to content

Commit bdfd584

Browse files
committed
ci: Update GitHub actions to match new environments
1 parent ffb4616 commit bdfd584

File tree

7 files changed

+108
-64
lines changed

7 files changed

+108
-64
lines changed

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

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
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]
66
pull_request:
77
branches: [main, master]
88
schedule:
9-
# * is a special character in YAML so you have to quote this string
109
- cron: '01 00 * * 3'
1110

1211
name: R-CMD-check
@@ -21,7 +20,7 @@ jobs:
2120
fail-fast: false
2221
matrix:
2322
config:
24-
- {os: macOS-latest, r: 'release'}
23+
- {os: macos-latest, r: 'release'}
2524
- {os: windows-latest, r: 'release'}
2625
- {os: windows-latest, r: 'devel'}
2726
- {os: ubuntu-latest, r: 'devel', http-user-agent: 'release'}
@@ -33,18 +32,22 @@ jobs:
3332
R_KEEP_PKG_SOURCE: yes
3433

3534
steps:
36-
- uses: actions/checkout@v2
35+
- uses: actions/checkout@v4
3736

38-
- uses: r-lib/actions/setup-pandoc@v1
37+
- uses: r-lib/actions/setup-pandoc@v2
3938

40-
- uses: r-lib/actions/setup-r@v1
39+
- uses: r-lib/actions/setup-r@v2
4140
with:
4241
r-version: ${{ matrix.config.r }}
4342
http-user-agent: ${{ matrix.config.http-user-agent }}
4443
use-public-rspm: true
4544

46-
- uses: r-lib/actions/setup-r-dependencies@v1
45+
- uses: r-lib/actions/setup-r-dependencies@v2
4746
with:
48-
extra-packages: rcmdcheck
47+
extra-packages: any::rcmdcheck
48+
needs: check
4949

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

.github/workflows/pkgdown.yaml

Lines changed: 26 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
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]
8+
schedule:
9+
- cron: '01 00 * * 3'
610
release:
711
types: [published]
812
workflow_dispatch:
@@ -12,25 +16,35 @@ name: pkgdown
1216
jobs:
1317
pkgdown:
1418
runs-on: ubuntu-latest
19+
# Only restrict concurrency for non-PR jobs
20+
concurrency:
21+
group: pkgdown-${{ github.event_name != 'pull_request' || github.run_id }}
1522
env:
1623
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
24+
permissions:
25+
contents: write
1726
steps:
18-
- uses: actions/checkout@v2
27+
- uses: actions/checkout@v4
1928

20-
- uses: r-lib/actions/setup-pandoc@v1
29+
- uses: r-lib/actions/setup-pandoc@v2
2130

22-
- uses: r-lib/actions/setup-r@v1
31+
- uses: r-lib/actions/setup-r@v2
2332
with:
2433
use-public-rspm: true
2534

26-
- uses: r-lib/actions/setup-r-dependencies@v1
35+
- uses: r-lib/actions/setup-r-dependencies@v2
2736
with:
28-
extra-packages: pkgdown
37+
extra-packages: any::pkgdown, local::.
2938
needs: website
3039

31-
- name: Deploy package
32-
run: |
33-
git config --local user.name "$GITHUB_ACTOR"
34-
git config --local user.email "$GITHUB_ACTOR@users.noreply.github.com"
35-
Rscript -e 'install.packages("remotes");remotes::install_github("ThinkR-open/thinkrtemplate", upgrade = "never")'
36-
Rscript -e 'pkgdown::deploy_to_branch(new_process = FALSE)'
40+
- name: Build site
41+
run: pkgdown::build_site_github_pages(new_process = FALSE, install = FALSE)
42+
shell: Rscript {0}
43+
44+
- name: Deploy to GitHub pages 🚀
45+
if: github.event_name != 'pull_request'
46+
uses: JamesIves/github-pages-deploy-action@v4.5.0
47+
with:
48+
clean: false
49+
branch: gh-pages
50+
folder: docs

.github/workflows/test-coverage.yaml

Lines changed: 28 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
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
schedule:
7-
# * is a special character in YAML so you have to quote this string
89
- cron: '01 00 * * 3'
910

1011
name: test-coverage
@@ -16,16 +17,36 @@ jobs:
1617
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
1718

1819
steps:
19-
- uses: actions/checkout@v2
20+
- uses: actions/checkout@v4
2021

21-
- uses: r-lib/actions/setup-r@v1
22+
- uses: r-lib/actions/setup-r@v2
2223
with:
2324
use-public-rspm: true
2425

25-
- uses: r-lib/actions/setup-r-dependencies@v1
26+
- uses: r-lib/actions/setup-r-dependencies@v2
2627
with:
27-
extra-packages: covr
28+
extra-packages: any::covr
29+
needs: coverage
2830

2931
- name: Test coverage
30-
run: covr::codecov()
32+
run: |
33+
covr::codecov(
34+
quiet = FALSE,
35+
clean = FALSE,
36+
install_path = file.path(normalizePath(Sys.getenv("RUNNER_TEMP"), winslash = "/"), "package")
37+
)
3138
shell: Rscript {0}
39+
40+
- name: Show testthat output
41+
if: always()
42+
run: |
43+
## --------------------------------------------------------------------
44+
find '${{ runner.temp }}/package' -name 'testthat.Rout*' -exec cat '{}' \; || true
45+
shell: bash
46+
47+
- name: Upload test results
48+
if: failure()
49+
uses: actions/upload-artifact@v4
50+
with:
51+
name: coverage-test-failures
52+
path: ${{ runner.temp }}/package

README.Rmd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ file.copy(list.files("reference/figures", full.names = TRUE),
2424
# gitdown <img src="man/figures/logo.png" align="right" alt="" width="120" />
2525

2626
<!-- badges: start -->
27-
[![R-CMD-check](https://github.com/ThinkR-open/gitdown/workflows/R-CMD-check/badge.svg)](https://github.com/ThinkR-open/gitdown/actions)
27+
[![R-CMD-check](https://github.com/ThinkR-open/gitdown/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/ThinkR-open/gitdown/actions/workflows/R-CMD-check.yaml)
2828
[![Coverage status](https://codecov.io/gh/ThinkR-open/gitdown/branch/main/graph/badge.svg)](https://codecov.io/github/ThinkR-open/gitdown?branch=main)
2929
[![CRAN status](https://www.r-pkg.org/badges/version/gitdown)](https://CRAN.R-project.org/package=gitdown)
3030
<!-- badges: end -->

README.md

Lines changed: 33 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
<!-- badges: start -->
77

8-
[![R-CMD-check](https://github.com/ThinkR-open/gitdown/workflows/R-CMD-check/badge.svg)](https://github.com/ThinkR-open/gitdown/actions)
8+
[![R-CMD-check](https://github.com/ThinkR-open/gitdown/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/ThinkR-open/gitdown/actions/workflows/R-CMD-check.yaml)
99
[![Coverage
1010
status](https://codecov.io/gh/ThinkR-open/gitdown/branch/main/graph/badge.svg)](https://codecov.io/github/ThinkR-open/gitdown?branch=main)
1111
[![CRAN
@@ -40,9 +40,9 @@ remotes::install_github("ThinkR-open/gitdown")
4040
Create a versioned directory with some commits and a NEWS.md in a
4141
temporary directory
4242

43-
- Some commits mention an issue with `#`
44-
- Some commits mention a ticket with `ticket`
45-
- A commit is associated with a tag
43+
- Some commits mention an issue with `#`
44+
- Some commits mention a ticket with `ticket`
45+
- A commit is associated with a tag
4646

4747
``` r
4848
library(dplyr)
@@ -109,17 +109,17 @@ get_commits_pattern(repo, pattern = "#[[:digit:]]+", ref = "main") %>%
109109
select(pattern.content, everything())
110110
#> 4 commits found.
111111
#> # A tibble: 7 × 12
112-
#> pattern.content sha summary message author email when order
113-
#> <chr> <chr> <chr> <chr> <chr> <chr> <dttm> <int>
114-
#> 1 #32 8790c… Add NE… "Add NE… Alice alic… 2022-03-04 15:31:14 4
115-
#> 2 #1 8790c… Add NE… "Add NE… Alice alic… 2022-03-04 15:31:14 4
116-
#> 3 #12 8790c… Add NE… "Add NE… Alice alic… 2022-03-04 15:31:14 4
117-
#> 4 #2 c0870… Third … "Third … Alice alic… 2022-03-04 15:31:14 3
118-
#> 5 #145 c0870… Third … "Third … Alice alic… 2022-03-04 15:31:14 3
119-
#> 6 #1 a97db… exampl… "exampl… Alice alic… 2022-03-04 15:31:14 2
120-
#> 7 <NA> b27b5… First … "First … Alice alic… 2022-03-04 15:31:14 1
121-
#> # … with 4 more variables: tag.name <chr>, tag.message <chr>,
122-
#> # pattern.type <chr>, pattern.title <chr>
112+
#> pattern.content sha summary message author email when order
113+
#> <chr> <chr> <chr> <chr> <chr> <chr> <dttm> <int>
114+
#> 1 #32 1fd238… Add NE… "Add N… Alice alic… 2024-02-28 13:22:16 4
115+
#> 2 #1 1fd238… Add NE… "Add N… Alice alic… 2024-02-28 13:22:16 4
116+
#> 3 #12 1fd238… Add NE… "Add N… Alice alic… 2024-02-28 13:22:16 4
117+
#> 4 #2 91e2c1… Third … "Third… Alice alic… 2024-02-28 13:22:16 3
118+
#> 5 #145 91e2c1… Third … "Third… Alice alic… 2024-02-28 13:22:16 3
119+
#> 6 #1 7e998d… exampl… "examp… Alice alic… 2024-02-28 13:22:16 2
120+
#> 7 <NA> 1b6cc5… First … "First… Alice alic… 2024-02-28 13:22:16 1
121+
#> # 4 more variables: tag.name <chr>, tag.message <chr>, pattern.type <chr>,
122+
#> # pattern.title <chr>
123123
```
124124

125125
Get commits with issues and specific home-made pattern. Use a named
@@ -134,21 +134,21 @@ get_commits_pattern(
134134
select(pattern.type, pattern.content, everything())
135135
#> 4 commits found.
136136
#> # A tibble: 12 × 12
137-
#> pattern.type pattern.content sha summary message author email
138-
#> <chr> <chr> <chr> <chr> <chr> <chr> <chr>
139-
#> 1 Tickets ticket6789 8790cc60… Add NEWS "Add NEWS\n\n… Alice alice
140-
#> 2 Tickets ticket1234 8790cc60… Add NEWS "Add NEWS\n\n… Alice alice
141-
#> 3 Issues #32 8790cc60… Add NEWS "Add NEWS\n\n… Alice alice
142-
#> 4 Issues #1 8790cc60… Add NEWS "Add NEWS\n\n… Alice alice
143-
#> 5 Issues #12 8790cc60… Add NEWS "Add NEWS\n\n… Alice alice
144-
#> 6 Tickets <NA> c0870ab4… Third co… "Third commit… Alice alice
145-
#> 7 Issues #2 c0870ab4… Third co… "Third commit… Alice alice
146-
#> 8 Issues #145 c0870ab4… Third co… "Third commit… Alice alice
147-
#> 9 Tickets ticket1234 a97db45b… example:… "example: mod… Alice alice
148-
#> 10 Issues #1 a97db45b… example:… "example: mod… Alice alice
149-
#> 11 Tickets <NA> b27b55fe… First co… "First commit… Alice alice
150-
#> 12 Issues <NA> b27b55fe… First co… "First commit… Alice alice
151-
#> # … with 5 more variables: when <dttm>, order <int>, tag.name <chr>,
137+
#> pattern.type pattern.content sha summary message author email
138+
#> <chr> <chr> <chr> <chr> <chr> <chr> <chr>
139+
#> 1 Tickets ticket6789 1fd238efc602f52946… Add NE… "Add N… Alice alic
140+
#> 2 Tickets ticket1234 1fd238efc602f52946… Add NE… "Add N… Alice alic
141+
#> 3 Issues #32 1fd238efc602f52946… Add NE… "Add N… Alice alic
142+
#> 4 Issues #1 1fd238efc602f52946… Add NE… "Add N… Alice alic
143+
#> 5 Issues #12 1fd238efc602f52946… Add NE… "Add N… Alice alic
144+
#> 6 Tickets <NA> 91e2c152a0525fc589… Third … "Third… Alice alic
145+
#> 7 Issues #2 91e2c152a0525fc589… Third … "Third… Alice alic
146+
#> 8 Issues #145 91e2c152a0525fc589… Third … "Third… Alice alic
147+
#> 9 Tickets ticket1234 7e998d8e673e331274… exampl… "examp… Alice alic
148+
#> 10 Issues #1 7e998d8e673e331274… exampl… "examp… Alice alic
149+
#> 11 Tickets <NA> 1b6cc5d04920de4a60… First … "First… Alice alic
150+
#> 12 Issues <NA> 1b6cc5d04920de4a60… First … "First… Alice alic
151+
#> # 5 more variables: when <dttm>, order <int>, tag.name <chr>,
152152
#> # tag.message <chr>, pattern.title <chr>
153153
```
154154

@@ -166,9 +166,9 @@ With this example, the vignette will show this content:
166166

167167
| File | Tracked in git | Date of creation | Last modification |
168168
|:------------|:---------------|:--------------------|:--------------------|
169-
| NEWS.md | Yes | 2022-03-04 16:31:14 | 2022-03-04 16:31:14 |
170-
| example.txt | Yes | 2022-03-04 16:31:14 | 2022-03-04 16:31:14 |
171-
| R/my_mean.R | No | NA | 2022-03-04 16:31:14 |
169+
| NEWS.md | Yes | 2024-02-28 13:22:17 | 2024-02-28 13:22:17 |
170+
| example.txt | Yes | 2024-02-28 13:22:17 | 2024-02-28 13:22:17 |
171+
| R/my_mean.R | No | NA | 2024-02-28 13:22:17 |
172172

173173
## Sponsor
174174

_pkgdown.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,10 @@ home:
33
description: Read all commit messages and sort them according to
44
tags or specific text pattern.
55
template:
6-
package: thinkrtemplate
6+
bootstrap: 5
7+
bslib:
8+
bg: "#ffffff"
9+
fg: "#3b4450"
10+
primary: "#DE633C"
11+
secondary: "#15b7d6"
12+
body-color: "#28292B"

dev_history.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ checkhelper::print_globals(globals)
6262
# travis_endpoint = ".org")
6363
# # usethis::use_travis()
6464
# usethis::use_appveyor()
65-
usethis::use_github_action_check_standard()
65+
usethis::use_github_action("check-standard")
6666
usethis::use_github_action("pkgdown")
6767
usethis::use_github_action("test-coverage")
6868

0 commit comments

Comments
 (0)