-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
action.yaml
71 lines (67 loc) · 2.57 KB
/
action.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
---
name: Dependency Test
author: Insights Engineering
description: Resolve package dependencies according to the strategy used, install them and execute R CMD CHECK
inputs:
github-token:
description: Token with permissions to clone repositories with dependencies.
required: false
default: ""
repository-path:
description: Directory where the checked package has been cloned.
required: false
default: "."
extra-deps:
description: Extra dependencies specified similarly as in the `DESCRIPTION` file, i.e. `"<package name> (<operator> <version>)"` where both `<operator>` and `<version>` are optional. Multiple entries are possible separated by `";"`.
required: false
default: ""
check-args:
description: Optional value of args argument to rcmdcheck::rcmdcheck in form of a string with space as delimeter, e.g. "--no-examples --no-tests".
required: false
default: ""
build-args:
description: Optional value of build_args argument to rcmdcheck::rcmdcheck in form of a string with space as delimeter, e.g. "--force --keep-empty-dirs".
required: false
default: ""
strategy:
description: |
Strategy to test package dependencies. One of: min_isolated, min_cohort, release, max.
required: true
additional-env-vars:
description: |
Additional environment variables.
Example usage:
additional-env-vars: |
ABC=123
XYZ=456
required: false
default: ""
additional-repos:
description: |
Optional value that add R repositories for a given strategy. Multiple entries are possible separated by `";"`.
Example usage: `additional-repos: https://repo1.example.com;https://repo2.example.com`
required: false
default: ""
branding:
icon: 'refresh-ccw'
color: 'blue'
runs:
using: composite
steps:
- name: Run Dependency Test
run: |
echo "Dependency Test strategy: ${{ inputs.strategy }}"
if [ "${{ inputs.additional-env-vars }}" != "" ]
then {
echo -e "${{ inputs.additional-env-vars }}" > /tmp/dotenv.env
export $(tr '\n' ' ' < /tmp/dotenv.env)
}
fi
echo ".libPaths(\" \", include.site = FALSE)" > .Rprofile
export R_LIBS_SITE=" "
export R_LIBS_USER=" "
Rscript ${GITHUB_ACTION_PATH}/script.R '${{ inputs.repository-path }}' '${{ inputs.extra-deps }}' '${{ inputs.build-args }}' '${{ inputs.check-args }}' '${{ inputs.strategy }}' '${{ inputs.additional-repos }}'
shell: bash
env:
GITHUB_PAT: "${{ inputs.github-token }}"
_R_CHECK_TESTS_NLINES_: 0