Skip to content

Commit e53fd61

Browse files
committed
update lint GH workflow
1 parent 6888065 commit e53fd61

File tree

1 file changed

+15
-31
lines changed

1 file changed

+15
-31
lines changed

.github/workflows/lint.yaml

Lines changed: 15 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,33 @@
1+
# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples
2+
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
13
on:
24
push:
3-
branches:
4-
- main
5-
- master
5+
branches: [main, master]
66
pull_request:
7-
branches:
8-
- main
9-
- master
107

11-
name: lint
8+
name: lint.yaml
9+
10+
permissions: read-all
1211

1312
jobs:
1413
lint:
15-
runs-on: macOS-latest
14+
runs-on: ubuntu-latest
1615
env:
1716
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
1817
steps:
19-
- uses: actions/checkout@v2
18+
- uses: actions/checkout@v4
2019

2120
- uses: r-lib/actions/setup-r@v2
22-
23-
- name: Query dependencies
24-
run: |
25-
install.packages('remotes')
26-
saveRDS(remotes::dev_package_deps(dependencies = TRUE), ".github/depends.Rds", version = 2)
27-
writeLines(sprintf("R-%i.%i", getRversion()$major, getRversion()$minor), ".github/R-version")
28-
shell: Rscript {0}
29-
30-
- name: Restore R package cache
31-
uses: actions/cache@v2
3221
with:
33-
path: ${{ env.R_LIBS_USER }}
34-
key: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-${{ hashFiles('.github/depends.Rds') }}
35-
restore-keys: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-
22+
use-public-rspm: true
3623

37-
- name: Install dependencies
38-
run: |
39-
install.packages(c("remotes"))
40-
remotes::install_deps(dependencies = TRUE)
41-
remotes::install_cran("lintr")
42-
shell: Rscript {0}
43-
44-
- name: Install package
45-
run: R CMD INSTALL .
24+
- uses: r-lib/actions/setup-r-dependencies@v2
25+
with:
26+
extra-packages: any::lintr, local::.
27+
needs: lint
4628

4729
- name: Lint
4830
run: lintr::lint_package()
4931
shell: Rscript {0}
32+
env:
33+
LINTR_ERROR_ON_LINT: true

0 commit comments

Comments
 (0)