Repository navigation
56 lines (51 loc) · 2.09 KB
/
Copy pathpre-commit.yaml
File metadata and controls
56 lines (51 loc) · 2.09 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
# pre-commit.yaml — run non-renv pre-commit hooks on PRs.
#
# The lorenzwalthert/precommit `language: r` hooks (lintr, styler,
# parsable-R, roxygenize, deps-in-desc, etc.) each spawn their own
# renv to install R packages from source. On a fresh GitHub Actions
# runner this is slow and fragile (we have observed package-compile
# failures in the renv environment).
#
# CI coverage of those checks comes from the dedicated lint.yaml
# workflow (which uses the same lintr config) plus R-CMD-check (which
# catches roxygen drift, deps-in-desc misses, etc.). This workflow
# runs the fast non-renv hooks - yaml validity, line endings,
# trailing whitespace, large-file guard, conventional commit message
# format, plus our local pkgdown reference-index validator (which
# uses `language: system` so it just shells out to Rscript against
# the runner's R install, no renv involved).
#
# Local-dev workflow is unchanged: `pre-commit install` runs the
# full configuration in .pre-commit-config.yaml.
name: pre-commit
on:
push:
branches: [main]
pull_request:
permissions:
contents: read
env:
# Hook IDs from .pre-commit-config.yaml that use the R language and pull
# in renv. Keep this list in sync with the R-backed hooks defined there.
# Must be a single comma-separated string with no whitespace.
SKIP: parsable-R,no-browser-statement,no-debug-statement,no-print-statement,deps-in-desc,codemeta-description-updated,lintr,style-files,spell-check,readme-rmd-rendered,use-tidy-description,roxygenize
jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: actions/setup-python@v7
with:
python-version: '3.x'
# R + the `yaml` package are needed for the
# pkgdown-reference-check local hook below; everything else in
# this workflow runs without R.
- uses: r-lib/actions/setup-r@v2
with:
use-public-rspm: true
- uses: r-lib/actions/setup-r-dependencies@v2
with:
packages: any::yaml
- uses: pre-commit/action@v3.0.1
with:
extra_args: --all-files --show-diff-on-failure