-
Notifications
You must be signed in to change notification settings - Fork 0
57 lines (50 loc) · 1.51 KB
/
R-CMD-check.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
# Workflow derived from https://github.com/r-lib/actions/tree/master/examples
on:
workflow_call:
inputs:
pkg-path:
required: true
type: string
name: R-CMD-check
jobs:
R-CMD-check:
runs-on: ubuntu-latest
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
R_KEEP_PKG_SOURCE: yes
steps:
- uses: actions/checkout@v4
- uses: r-lib/actions/setup-r@v2
with:
use-public-rspm: true
- uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: |
rcmdcheck
any::covr
any::goodpractice
any::lintr
local::../testpkg01
working-directory: ${{ inputs.pkg-path }}
- uses: r-lib/actions/check-r-package@v2
with:
working-directory: ${{ inputs.pkg-path }}
- name: Code coverage
run: covr::package_coverage()
shell: Rscript {0}
working-directory: ${{ inputs.pkg-path }}
- name: Good practices
run: |
goodpractice::gp(checks = c(
"cyclocomp",
"no_import_package_as_a_whole",
"no_export_pattern"
))
shell: Rscript {0}
working-directory: ${{ inputs.pkg-path }}
- name: Lint
run: |
library(lintr)
lint_package(linters = with_defaults(object_name_linter("camelCase"), line_length_linter(160L), object_length_linter(length = 60L)))
shell: Rscript {0}
working-directory: ${{ inputs.pkg-path }}