Skip to content

Commit 21e7a47

Browse files
committed
Merge branch 'main' into replace-devtools-with-pak
2 parents bd04b23 + 9993cb3 commit 21e7a47

File tree

8 files changed

+191
-21
lines changed

8 files changed

+191
-21
lines changed

.github/workflows/build-check-install.yaml

Lines changed: 22 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -694,9 +694,12 @@ jobs:
694694
if: inputs.skip-r-cmd-check != true
695695
run: |
696696
find ${{ env.PKGNAME }}.Rcheck -type f -regextype posix-egrep \
697-
-regex '.*00install.out|.*00check.log|.*00build.out' -print0 | while IFS= read -r -d $'\0' file; do
698-
printf "==================================\n$file\n==================================\n"
699-
cat $file
697+
-regex '.*00install.out|.*00check.log|.*00build.out|.*-Ex.Rout|.*tests/testthat\.Rout.*' \
698+
-print0 | while IFS= read -r -d $'\0' file; do
699+
# Grouping allows to collapse/expand logs when needed.
700+
echo "::group::$file"
701+
cat $file
702+
echo "::endgroup::"
700703
done
701704
shell: bash
702705

@@ -782,6 +785,18 @@ jobs:
782785
path: ${{ github.event.repository.name }}/${{ inputs.package-subdirectory }}/${{ env.PKGBUILD }}
783786
name: ${{ env.PKGBUILD }}
784787

788+
- name: Upload logs artifact 🗞️
789+
uses: actions/upload-artifact@v4
790+
with:
791+
path: |
792+
${{ env.PKGNAME }}.Rcheck/*00install.out
793+
${{ env.PKGNAME }}.Rcheck/*00check.log
794+
${{ env.PKGNAME }}.Rcheck/*00build.out
795+
${{ env.PKGNAME }}.Rcheck/*-Ex.Rout
796+
${{ env.PKGNAME }}.Rcheck/tests/testthat.Rout
797+
${{ env.PKGNAME }}.Rcheck/tests/testthat.Rout.fail
798+
name: check-logs-${{ env.PKGNAME }}-${{ inputs.concurrency-group }}
799+
785800
publish-junit-html-report:
786801
name: Publish JUnit HTML report 📰
787802
runs-on: ubuntu-latest
@@ -813,7 +828,7 @@ jobs:
813828

814829
- name: Upload JUnit HTML report to GitHub pages 🗞️
815830
if: needs.build-install-check.outputs.multiversion-docs == 'true'
816-
uses: peaceiris/actions-gh-pages@v3
831+
uses: peaceiris/actions-gh-pages@v4
817832
with:
818833
github_token: ${{ steps.github-token.outputs.token }}
819834
publish_dir: ./unit-test-report
@@ -823,7 +838,7 @@ jobs:
823838
if: >
824839
needs.build-install-check.outputs.is-latest-tag == 'true'
825840
&& needs.build-install-check.outputs.multiversion-docs == 'true'
826-
uses: peaceiris/actions-gh-pages@v3
841+
uses: peaceiris/actions-gh-pages@v4
827842
with:
828843
github_token: ${{ steps.github-token.outputs.token }}
829844
publish_dir: ./unit-test-report
@@ -833,15 +848,15 @@ jobs:
833848
if: >
834849
needs.build-install-check.outputs.is-rc-tag == 'true'
835850
&& needs.build-install-check.outputs.multiversion-docs == 'true'
836-
uses: peaceiris/actions-gh-pages@v3
851+
uses: peaceiris/actions-gh-pages@v4
837852
with:
838853
github_token: ${{ steps.github-token.outputs.token }}
839854
publish_dir: ./unit-test-report
840855
destination_dir: ${{ inputs.release-candidate-alt-name }}/unit-test-report
841856

842857
- name: Upload JUnit HTML report to GitHub pages (non-multiversion) 🗞️
843858
if: needs.build-install-check.outputs.multiversion-docs == 'false'
844-
uses: peaceiris/actions-gh-pages@v3
859+
uses: peaceiris/actions-gh-pages@v4
845860
with:
846861
github_token: ${{ steps.github-token.outputs.token }}
847862
publish_dir: ./unit-test-report

.github/workflows/links.yaml

Lines changed: 74 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,29 @@ on:
1616
workflow_dispatch:
1717
workflow_call:
1818
inputs:
19-
additional_args:
19+
lychee-additional-args:
2020
description: Additional arguments to pass to lychee
2121
required: false
2222
type: string
23+
default: "--exclude-private"
24+
lychee-fail:
25+
description: Fail workflow run on error (i.e. when lychee exit code is not 0)
26+
required: false
27+
type: boolean
28+
default: false
29+
package-subdirectory:
30+
description: Subdirectory in the repository, where the R package is located.
31+
required: false
32+
type: string
2333
default: ""
34+
link-checking-method:
35+
description: |
36+
Which link checking method should be used? Supported methods are:
37+
lychee
38+
urlchecker
39+
required: false
40+
type: string
41+
default: "urlchecker"
2442

2543
concurrency:
2644
group: links-${{ github.event.pull_request.number || github.ref }}
@@ -33,6 +51,7 @@ jobs:
3351
if: >
3452
!contains(github.event.commits[0].message, '[skip links]')
3553
&& github.event.pull_request.draft == false
54+
&& inputs.link-checking-method == 'lychee'
3655
steps:
3756
- name: Get branch names 🌿
3857
id: branch-name
@@ -65,18 +84,69 @@ jobs:
6584
SKIP_INSTRUCTION: "[skip links]"
6685

6786
- name: Check URLs in docs 🔬
68-
uses: lycheeverse/lychee-action@v1.8.0
87+
uses: lycheeverse/lychee-action@v1.10.0
6988
with:
7089
args: >-
71-
--exclude-private
7290
--exclude "https://github.com.*.git|https://insightsengineering.github.io.*|lewagon.*|knightdave.*|.*users.noreply.github.com|lycheeverse.*"
7391
--verbose
7492
--no-progress
75-
${{ inputs.additional_args }}
93+
${{ inputs.lychee-additional-args }}
7694
**/*.md
7795
**/*.html
7896
**/*.Rmd
7997
**/*.yaml
8098
**/*.yml
99+
*.md
100+
fail: ${{ inputs.lychee-fail }}
81101
env:
82102
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
103+
104+
urlchecker:
105+
name: URL Checker 🔎
106+
runs-on: ubuntu-latest
107+
container:
108+
image: rocker/tidyverse:latest
109+
if: >
110+
!contains(github.event.commits[0].message, '[skip links]')
111+
&& github.event.pull_request.draft == false
112+
&& inputs.link-checking-method == 'urlchecker'
113+
steps:
114+
- name: Get branch names 🌿
115+
id: branch-name
116+
uses: tj-actions/branch-names@v7
117+
118+
- name: Checkout repo (PR) 🛎
119+
uses: actions/[email protected]
120+
if: github.event_name == 'pull_request'
121+
with:
122+
ref: ${{ steps.branch-name.outputs.head_ref_branch }}
123+
repository: ${{ github.event.pull_request.head.repo.full_name }}
124+
125+
- name: Checkout repo 🛎
126+
uses: actions/[email protected]
127+
if: github.event_name != 'pull_request'
128+
with:
129+
ref: ${{ steps.branch-name.outputs.head_ref_branch }}
130+
131+
- name: Check commit message 💬
132+
run: |
133+
git config --global --add safe.directory $(pwd)
134+
export head_commit_message="$(git show -s --format=%B | tr '\r\n' ' ' | tr '\n' ' ')"
135+
echo "head_commit_message = $head_commit_message"
136+
if [[ $head_commit_message == *"$SKIP_INSTRUCTION"* ]]; then
137+
echo "Skip instruction detected - cancelling the workflow."
138+
exit 1
139+
fi
140+
shell: bash
141+
env:
142+
SKIP_INSTRUCTION: "[skip links]"
143+
144+
- name: Check URLs with urlchecker 🔬
145+
run: |
146+
# For unexplained reasons, parallel = FALSE is required to prevent some false positives.
147+
bad_urls <- nrow(print(urlchecker::url_check(".", parallel = FALSE)))
148+
if (bad_urls > 0) {
149+
stop("Looks like a total of ", bad_urls, " URL(s) were found! Please correct them.")
150+
}
151+
shell: Rscript {0}
152+
working-directory: ${{ inputs.package-subdirectory }}

.github/workflows/test-coverage.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -419,7 +419,7 @@ jobs:
419419

420420
- name: Upload coverage report to GitHub pages 🗞️
421421
if: needs.coverage.outputs.multiversion-docs == 'true'
422-
uses: peaceiris/actions-gh-pages@v3
422+
uses: peaceiris/actions-gh-pages@v4
423423
with:
424424
github_token: ${{ steps.github-token.outputs.token }}
425425
publish_dir: ./coverage-report
@@ -429,7 +429,7 @@ jobs:
429429
if: >
430430
needs.coverage.outputs.is-latest-tag == 'true'
431431
&& needs.coverage.outputs.multiversion-docs == 'true'
432-
uses: peaceiris/actions-gh-pages@v3
432+
uses: peaceiris/actions-gh-pages@v4
433433
with:
434434
github_token: ${{ steps.github-token.outputs.token }}
435435
publish_dir: ./coverage-report
@@ -439,15 +439,15 @@ jobs:
439439
if: >
440440
needs.coverage.outputs.is-rc-tag == 'true'
441441
&& needs.coverage.outputs.multiversion-docs == 'true'
442-
uses: peaceiris/actions-gh-pages@v3
442+
uses: peaceiris/actions-gh-pages@v4
443443
with:
444444
github_token: ${{ steps.github-token.outputs.token }}
445445
publish_dir: ./coverage-report
446446
destination_dir: ${{ inputs.release-candidate-alt-name }}/coverage-report
447447

448448
- name: Upload coverage report to GitHub pages (non-multiversion) 🗞️
449449
if: needs.coverage.outputs.multiversion-docs == 'false'
450-
uses: peaceiris/actions-gh-pages@v3
450+
uses: peaceiris/actions-gh-pages@v4
451451
with:
452452
github_token: ${{ steps.github-token.outputs.token }}
453453
publish_dir: ./coverage-report

.github/workflows/verdepcheck.yaml

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,14 @@ on:
2828
Strategy to test package dependencies. One of: min_isolate, min_cohort, release, max.
2929
required: true
3030
type: string
31+
extra-deps:
32+
description: |
33+
Extra dependencies specified similarly as in the `DESCRIPTION` file,
34+
i.e. `"<package name> (<operator> <version>)"` where both `<operator>`
35+
and `<version>` are optional. Multiple entries are possible separated by `";"`.
36+
required: false
37+
default: ""
38+
type: string
3139
additional-env-vars:
3240
description: |
3341
Extra environment variables, as a 'key=value' pair, with each pair on a new line.
@@ -104,10 +112,11 @@ jobs:
104112
uses: insightsengineering/r-verdepcheck-action@main
105113
with:
106114
github-token: ${{ steps.github-token.outputs.token }}
107-
check-args: ${{ inputs.check-args }}
115+
extra-deps: ${{ inputs.extra-deps }}
108116
build-args: ${{ inputs.build-args }}
109-
additional-env-vars: ${{ inputs.additional-env-vars }}
117+
check-args: ${{ inputs.check-args }}
110118
strategy: ${{ env.strategy }}
119+
additional-env-vars: ${{ inputs.additional-env-vars }}
111120

112121
- name: GChat notification 🔔
113122
if: (failure() || cancelled()) && steps.verdepcheck.outcome != 'success' && env.gchat_webhook != ''

.github/workflows/wasm.yaml

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
---
2+
name: WASM 🧭
3+
4+
on:
5+
workflow_call:
6+
inputs:
7+
package-subdirectory:
8+
description: Subdirectory in the repository, where the R package is located.
9+
required: false
10+
type: string
11+
default: ""
12+
13+
jobs:
14+
wasm:
15+
name: WASM 🧭
16+
runs-on: ubuntu-latest
17+
if: startsWith(github.ref, 'refs/tags/v')
18+
steps:
19+
- name: Get branch names 🌿
20+
id: branch-name
21+
uses: tj-actions/branch-names@v7
22+
23+
- name: Checkout repo 🛎
24+
uses: actions/[email protected]
25+
with:
26+
ref: ${{ steps.branch-name.outputs.head_ref_branch }}
27+
path: ${{ github.event.repository.name }}
28+
29+
- name: Get package name 📦
30+
run: |
31+
echo "PKGNAME=$(echo $(awk -F: '/Package:/{gsub(/[ ]+/,"") ; print $2}' DESCRIPTION))" >> $GITHUB_ENV
32+
shell: bash
33+
working-directory: ${{ github.event.repository.name }}/${{ inputs.package-subdirectory }}
34+
35+
- name: Build WASM packages 🧭
36+
uses: r-wasm/actions/build-rwasm@v1
37+
with:
38+
packages: |
39+
${{ github.repository_owner }}/${{ env.PKGNAME }}@${{ steps.branch-name.outputs.tag }}
40+
41+
- name: Upload WASM packages ⬆
42+
uses: actions/upload-artifact@v4
43+
with:
44+
name: wasm-${{ env.PKGNAME }}
45+
path: |
46+
_site/bin/emscripten/contrib/*/${{ env.PKGNAME }}*.tgz
47+
_site/src/contrib/${{ env.PKGNAME }}*.tar.gz
48+
49+
- name: Check if release exists ⚙️
50+
id: check-if-release-exists
51+
uses: insightsengineering/release-existence-action@v1
52+
53+
- name: Download artifact ⏬
54+
if: >-
55+
steps.check-if-release-exists.outputs.release-exists == 'true'
56+
uses: actions/download-artifact@v4
57+
with:
58+
name: wasm-${{ env.PKGNAME }}
59+
path: wasm-${{ env.PKGNAME }}
60+
61+
- name: Prepare WASM release artifact 🗜️
62+
if: >-
63+
steps.check-if-release-exists.outputs.release-exists == 'true'
64+
run: |
65+
zip -r9 wasm-${{ env.PKGNAME }}.zip wasm-${{ env.PKGNAME }}
66+
67+
- name: Upload WASM build to release 🔼
68+
if: >-
69+
steps.check-if-release-exists.outputs.release-exists == 'true'
70+
uses: svenstaro/upload-release-action@v2
71+
with:
72+
file: ./wasm-${{ env.PKGNAME }}.zip
73+
asset_name: wasm-${{ env.PKGNAME }}.zip
74+
repo_token: ${{ secrets.GITHUB_TOKEN }}
75+
tag: ${{ github.ref }}
76+
overwrite: true

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,6 @@ repos:
7777
files: '\.Rhistory|\.RData|\.Rds|\.rds$'
7878
# `exclude: <regex>` to allow committing specific files.
7979
- repo: https://github.com/igorshubovych/markdownlint-cli
80-
rev: v0.40.0
80+
rev: v0.41.0
8181
hooks:
8282
- id: markdownlint

DESCRIPTION

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
Type: Package
22
Package: r.pkg.template
33
Title: R Package Template
4-
Version: 0.1.0.9159
5-
Date: 2024-05-14
4+
Version: 0.1.0.9169
5+
Date: 2024-06-25
66
Authors@R:
77
person("insightsengineering", , , "[email protected]", role = c("aut", "cre"))
88
Description: R package template with GitHub Actions workflows included.

NEWS.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# r.pkg.template 0.1.0.9159
1+
# r.pkg.template 0.1.0.9169
22

33
### New features
44

0 commit comments

Comments
 (0)