1
1
# # tic GitHub Actions template: linux-macos-windows-deploy
2
- # # revision date: 2020-05-21
2
+ # # revision date: 2020-06-14
3
3
on :
4
4
push :
5
5
pull_request :
8
8
# * is a special character in YAML so you have to quote this string
9
9
- cron : " 0 4 * * *"
10
10
11
- name : R CMD Check via { tic}
11
+ name : tic
12
12
13
13
jobs :
14
- R-CMD-check :
14
+ all :
15
15
runs-on : ${{ matrix.config.os }}
16
16
17
17
name : ${{ matrix.config.os }} (${{ matrix.config.r }})
@@ -22,20 +22,14 @@ jobs:
22
22
config :
23
23
# use a different tic template type if you do not want to build on all listed platforms
24
24
- { os: windows-latest, r: "release" }
25
- - { os: macOS-latest, r: "release", pkgdown: "true" }
25
+ - { os: macOS-latest, r: "release", pkgdown: "true", latex: "true" }
26
26
- { os: macOS-latest, r: "devel" }
27
27
- { os: ubuntu-latest, r: "release" }
28
28
29
29
env :
30
30
# otherwise remotes::fun() errors cause the build to fail. Example: Unavailability of binaries
31
31
R_REMOTES_NO_ERRORS_FROM_WARNINGS : true
32
32
CRAN : ${{ matrix.config.cran }}
33
- # we are not allowed to write to ~/.ccache on GH Actions
34
- # setting some ccache options
35
- CCACHE_BASEDIR : ${{ GITHUB.WORKSPACE }}
36
- CCACHE_DIR : ${{ GITHUB.WORKSPACE }}/.ccache
37
- CCACHE_NOHASHDIR : true
38
- CCACHE_SLOPPINESS : include_file_ctime
39
33
# make sure to run `tic::use_ghactions_deploy()` to set up deployment
40
34
TIC_DEPLOY_KEY : ${{ secrets.TIC_DEPLOY_KEY }}
41
35
# prevent rgl issues because no X11 display is available
45
39
BUILD_PKGDOWN : ${{ matrix.config.pkgdown }}
46
40
# macOS >= 10.15.4 linking
47
41
SDKROOT : /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk
48
- # use GITHUB_TOKEN from GItHub to workaround rate limits in {remotes}
42
+ # use GITHUB_TOKEN from GitHub to workaround rate limits in {remotes}
49
43
GITHUB_PAT : ${{ secrets.GITHUB_TOKEN }}
50
44
51
45
steps :
@@ -60,74 +54,37 @@ jobs:
60
54
# Linux: ~ 1 min
61
55
# macOS: ~ 1 min 30s
62
56
# Windows: never finishes
63
- - uses : r-lib/actions/setup-tinytex@v1
64
- if : runner.os != 'Windows '
57
+ - uses : r-lib/actions/setup-tinytex@master
58
+ if : matrix.config.latex == 'true '
65
59
66
60
- uses : r-lib/actions/setup-pandoc@master
67
61
68
62
# set date/week for use in cache creation
69
63
# https://github.community/t5/GitHub-Actions/How-to-set-and-access-a-Workflow-variable/m-p/42970
70
64
# - cache R packages daily
71
- # - cache ccache weekly -> 'ccache' helps rebuilding the package cache faster
72
65
- name : " [Cache] Prepare daily timestamp for cache"
73
66
if : runner.os != 'Windows'
74
67
id : date
75
68
run : echo "::set-output name=date::$(date '+%d-%m')"
76
69
77
- - name : " [Cache] Prepare weekly timestamp for cache"
78
- if : runner.os != 'Windows'
79
- id : datew
80
- run : echo "::set-output name=datew::$(date '+%Y-%V')"
81
-
82
70
- name : " [Cache] Cache R packages"
83
71
if : runner.os != 'Windows'
84
- uses : pat-s/always-upload-cache@v1.2 .0
72
+ uses : pat-s/always-upload-cache@v2.0 .0
85
73
with :
86
74
path : ${{ env.R_LIBS_USER }}
87
75
key : ${{ runner.os }}-r-${{ matrix.config.r }}-${{steps.date.outputs.date}}
88
76
restore-keys : ${{ runner.os }}-r-${{ matrix.config.r }}-${{steps.date.outputs.date}}
89
77
90
- - name : " [Cache] Cache ccache"
91
- if : runner.os != 'Windows'
92
- uses : pat-s/always-upload-cache@v1.2.0
93
- with :
94
- path : ${{ env.CCACHE_DIR}}
95
- key : ${{ runner.os }}-r-${{ matrix.config.r }}-ccache-${{steps.datew.outputs.datew}}
96
- restore-keys : ${{ runner.os }}-r-${{ matrix.config.r }}-ccache-${{steps.datew.outputs.datew}}
97
-
98
- # install ccache and write config file
99
- - name : " [Linux] ccache"
100
- if : runner.os == 'Linux'
101
- run : |
102
- sudo apt install ccache libcurl4-openssl-dev
103
- mkdir -p ~/.R && echo -e 'CC=ccache gcc -std=gnu99\nCXX=ccache g++\nFC=ccache gfortran\nF77=ccache gfortran' > $HOME/.R/Makevars
104
-
105
- # install ccache and write config file
106
- # mirror the setup described in https://github.com/rmacoslib/r-macos-rtools
107
- - name : " [macOS] ccache"
108
- if : runner.os == 'macOS' && matrix.config.r == 'devel'
109
- run : |
110
- brew install ccache
111
- # install SDK 10.13 (High Sierra, used by CRAN)
112
- wget -nv https://github.com/phracker/MacOSX-SDKs/releases/download/10.15/MacOSX10.13.sdk.tar.xz
113
- tar fxz MacOSX10.13.sdk.tar.xz
114
- sudo mv MacOSX10.13.sdk /Library/Developer/CommandLineTools/SDKs/
115
- rm -rf MacOSX10.13*
116
- # install gfortran 8.2 (used by CRAN)
117
- wget -nv https://github.com/fxcoudert/gfortran-for-macOS/releases/download/8.2/gfortran-8.2-Mojave.dmg
118
- sudo hdiutil attach gfortran*.dmg
119
- sudo installer -package /Volumes/gfortran*/gfortran*/gfortran*.pkg -target /
120
- sudo hdiutil detach /Volumes/gfortran-8.2-Mojave
121
- rm gfortran-8*
122
- # set compiler flags
123
- mkdir -p ~/.R && echo -e 'CC=ccache clang\nCPP=ccache clang\nCXX=ccache clang++\nCXX11=ccache clang++\nCXX14=ccache clang++\nCXX17=ccache clang++\nCFLAGS=-isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX10.13.sdk\nCCFLAGS=-isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX10.13.sdk\nCXXFLAGS=-isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX10.13.sdk\nCPPFLAGS=-isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX10.13.sdk -I/usr/local/include\nF77=ccache /usr/local/gfortran/bin/gfortran\nFC=ccache /usr/local/gfortran/bin/gfortran' > $HOME/.R/Makevars
124
-
125
78
# for some strange Windows reason this step and the next one need to be decoupled
126
79
- name : " [Stage] Prepare"
127
80
run : |
128
81
Rscript -e "if (!requireNamespace('remotes')) install.packages('remotes', type = 'source')"
129
82
Rscript -e "if (getRversion() < '3.2' && !requireNamespace('curl')) install.packages('curl', type = 'source')"
130
83
84
+ - name : " [Stage] [Linux] Install curl"
85
+ if : runner.os == 'Linux'
86
+ run : sudo apt install libcurl4-openssl-dev
87
+
131
88
- name : " [Stage] Install"
132
89
if : matrix.config.os != 'macOS-latest' || matrix.config.r != 'devel'
133
90
run : Rscript -e "remotes::install_github('ropensci/tic')" -e "print(tic::dsl_load())" -e "tic::prepare_all_stages()" -e "tic::before_install()" -e "tic::install()"
0 commit comments