generated from pharmaverse/admiraltemplate
-
Notifications
You must be signed in to change notification settings - Fork 4
107 lines (97 loc) · 2.78 KB
/
spellcheck.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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
---
name: Spelling
on:
workflow_dispatch:
workflow_call:
inputs:
r-version:
description: 'The version of R to use'
default: '4.1'
required: false
type: string
exclude:
description: 'List of paths to exclude (comma seperated list)'
default: ''
required: false
type: string
push:
branches:
- main
- devel
- pre-release
- patch
pull_request:
branches:
- main
- devel
- pre-release
- patch
concurrency:
group: spelling-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
get_r_version:
name: Get R version
runs-on: ubuntu-latest
if: >
!contains(github.event.commits[0].message, '[skip spellcheck]')
outputs:
r-version: ${{ steps.normalizer.outputs.R_VERSION }}
steps:
- name: Normalize inputs
id: normalizer
run: |
R_VERSION="${{ inputs.r-version }}"
if [ "$R_VERSION" == "" ]
then {
R_VERSION="4.1"
}
fi
echo "R_VERSION=$R_VERSION" >> $GITHUB_OUTPUT
shell: bash
roxygen:
name: Spellcheck
runs-on: ubuntu-latest
container:
image: "ghcr.io/pharmaverse/admiralci-${{needs.get_r_version.outputs.r-version}}:latest"
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
if: >
!contains(github.event.commits[0].message, '[skip spellcheck]')
needs: get_r_version
steps:
##################### BEGIN boilerplate steps #####################
- name: Get branch names
id: branch-name
uses: tj-actions/[email protected]
- name: Checkout repo (PR) 🛎
uses: actions/checkout@v3
if: github.event_name == 'pull_request'
with:
ref: ${{ steps.branch-name.outputs.head_ref_branch }}
repository: ${{ github.event.pull_request.head.repo.full_name }}
- name: Checkout repository
uses: actions/checkout@v3
if: github.event_name != 'pull_request'
with:
ref: ${{ steps.branch-name.outputs.head_ref_branch }}
- name: Restore cache
uses: actions/cache@v3
with:
path: |
~/.staged.dependencies
key: staged-deps
- name: Run Staged dependencies
uses: insightsengineering/staged-dependencies-action@v1
with:
run-system-dependencies: false
renv-restore: false
enable-check: false
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
##################### END boilerplate steps #####################
- name: Run Spellcheck
uses: insightsengineering/r-spellcheck-action@v3
with:
additional_options: ""
exclude: "${{ inputs.exclude }}"