-
Notifications
You must be signed in to change notification settings - Fork 1
/
action.yml
53 lines (51 loc) · 1.7 KB
/
action.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
name: 'Install R'
description: 'Install UCRT-build of R'
inputs:
ucrt3-release:
description: 'release tag for UCRT3'
required: false
default: 'v0.10'
runs:
using: 'composite'
steps:
- name: Cache R installation
uses: actions/cache@v2
env:
cache-name: cache-r
with:
path: ~/r
key: ${{ env.cache-name }}-${{ inputs.ucrt3-release }}
- name: Install R
run: |
if [ "${{ runner.os }}" = Windows -a ! -d ~/r ] ; then
echo "::group::Downloading and installing R"
TAG="${{ inputs.ucrt3-release }}"
URL=`curl -s https://api.github.com/repos/kalibera/ucrt3/releases | \
sed -n 's!^ *\"*browser_download_url\"*: \"\(.*/download/'$TAG'/R-devel-win.*\)\"!\1!p'`
curl -s -L $URL > rinst.exe
if [ ! -x rinst.exe ] ; then
echo "::error ::ERROR: failed to download R installer"
exit 1
fi
./rinst.exe //VERYSILENT //SUPPRESSMSGBOXES //CURRENTUSER //DIR=`cygpath -wa ~/r`
rm -f rinst.exe
if [ ! -x ~/r/bin/R.exe ] ; then
echo "::error ::ERROR: failed to install R"
exit 1
fi
echo "::endgroup::"
fi
shell: bash
- name: Set up environment for R
run: |
if [ "${{ runner.os }}" = Windows ] ; then
echo "::group::Setting up environment for R"
echo ~/r/bin >> $GITHUB_PATH
# Prevent interference from pre-installed R
echo "R_LIBS_USER=NULL" >> $GITHUB_ENV
echo "R_LIBS_SITE=NULL" >> $GITHUB_ENV
# Define a time-zone
echo "TZ=Europe/Prague" >> $GITHUB_ENV
echo "::endgroup::"
fi
shell: bash