-
Notifications
You must be signed in to change notification settings - Fork 190
77 lines (67 loc) · 1.99 KB
/
styler.yaml
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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
on:
pull_request:
branches: [main, master]
paths: ["**.[rR]", "**.[qrR]md", "**.[rR]markdown", "**.[rR]nw"]
name: Style
jobs:
style:
runs-on: ubuntu-latest
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: r-lib/actions/setup-r@v2
with:
use-public-rspm: true
- uses: r-lib/actions/setup-r-dependencies@v2
with:
pak-version: devel
upgrade: 'TRUE'
dependencies: '"hard"'
extra-packages: |
local::.
r-lib/pkgapi
r-lib/styler
r-lib/roxygen2
anthonynorth/roxyglobals
needs: |
styler
roxygen2
- name: Enable styler cache
run: |
styler::cache_activate()
shell: Rscript {0}
- name: Determine cache location
id: styler-location
run: |
cat(
"location=",
styler::cache_info(format = "tabular")$location,
"\n",
file = Sys.getenv("GITHUB_OUTPUT"),
append = TRUE,
sep = ""
)
shell: Rscript {0}
- name: Cache styler
uses: actions/cache@v4
with:
path: ${{ steps.styler-location.outputs.location }}
key: ${{ runner.os }}-styler-${{ github.sha }}
restore-keys: |
${{ runner.os }}-styler-
${{ runner.os }}-
- name: Style package
run: |
options(crayon.enabled = TRUE)
styler::style_pkg(filetype = c(".qmd", ".R", ".Rmd", ".Rmarkdown", ".Rnw"))
shell: Rscript {0}
- name: Document
run: |
roxygen2::roxygenise()
shell: Rscript {0}
- uses: stefanzweifel/git-auto-commit-action@v5