-
Notifications
You must be signed in to change notification settings - Fork 13
76 lines (62 loc) · 2.01 KB
/
prchecks.yml
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
on:
pull_request:
branches:
- main
name: Binary checks
jobs:
build:
name: Build for ${{ matrix.config.os }} (${{ matrix.config.r }})
runs-on: ${{ matrix.config.os }}
if: "!contains(github.event.head_commit.message, '[skip-ci]')"
strategy:
fail-fast: false
matrix:
config:
- {os: macOS-latest, r: 'release', artifact_name: '*.tar.gz', asset_name: macOS}
- {os: windows-latest, r: 'release', artifact_name: '*.zip', asset_name: winOS}
- {os: ubuntu-latest, r: 'release', artifact_name: '*.tar.gz', asset_name: linuxOS}
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
R_REMOTES_NO_ERRORS_FROM_WARNINGS: true
steps:
- uses: actions/checkout@v4
- uses: r-lib/actions/setup-pandoc@v2
- uses: r-lib/actions/setup-r@v2
with:
r-version: ${{ matrix.config.r }}
use-public-rspm: true
- uses: r-lib/actions/setup-r-dependencies@v2
with:
cache-version: 2
extra-packages: |
any::pkgbuild
any::lintr
any::spelling
needs: check
- name: Binary
run: |
pkgbuild::clean_dll()
binary <- pkgbuild::build(binary = TRUE, needs_compilation = TRUE, compile_attributes = TRUE)
dir.create("build")
file.copy(binary, "build")
shell: Rscript {0}
- name: Save binary artifact
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.config.asset_name }}
path: build/
- name: Calculate code coverage
if: runner.os == 'macOS-latest'
run: Rscript -e "covr::codecov()"
- name: Lint
if: runner.os == 'macOS-latest'
run: lintr::lint_package()
shell: Rscript {0}
# - name: Goodpractice
# run: |
# goodpractice::gp()
# shell: Rscript {0}
- name: Spell check
if: runner.os == 'macOS-latest'
run: spelling::spell_check_package()
shell: Rscript {0}