-
Notifications
You must be signed in to change notification settings - Fork 12
173 lines (151 loc) · 7.13 KB
/
tic.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
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
## tic GitHub Actions template: linux-macos-windows-deploy
## revision date: 2020-06-14
on:
push:
pull_request:
# for now, CRON jobs only run on the default branch of the repo (i.e. usually on master)
schedule:
# * is a special character in YAML so you have to quote this string
- cron: "0 4 * * *"
name: tic
jobs:
all:
runs-on: ${{ matrix.config.os }}
name: ${{ matrix.config.os }} (${{ matrix.config.r }})
strategy:
fail-fast: false
matrix:
config:
# See https://github.com/actions/virtual-environments
- { os: windows-latest, r: "devel" } # windows-2019
- { os: windows-latest, r: "release" }
- { os: windows-latest, r: "oldrel" }
- { os: windows-2016, r: "devel" }
- { os: windows-2016, r: "release" }
- { os: windows-2016, r: "oldrel" }
- { os: macOS-latest, r: "devel" }
- { os: macOS-latest, r: "release"}
# - { os: macOS-latest, r: "oldrel"} # vign spatial > systemfonts > libfreetype.6.dylib
- { os: ubuntu-20.04, r: "devel" }
- { os: ubuntu-20.04, r: "release"}
- { os: ubuntu-20.04, r: "oldrel" }
- { os: ubuntu-18.04, r: "devel" }
- { os: ubuntu-18.04, r: "release" }
- { os: ubuntu-18.04, r: "oldrel" }
env:
# otherwise remotes::fun() errors cause the build to fail.
R_REMOTES_NO_ERRORS_FROM_WARNINGS: true
CRAN: ${{ matrix.config.cran }}
# make sure to run `tic::use_ghactions_deploy()` to set up deployment
TIC_DEPLOY_KEY: ${{ secrets.TIC_DEPLOY_KEY }}
# prevent rgl issues because no X11 display is available
RGL_USE_NULL: true
# if you use bookdown or blogdown, replace "PKGDOWN" by the respective
# capitalized term. This also might need to be done in tic.R
BUILD_PKGDOWN: ${{ matrix.config.pkgdown }}
# macOS >= 10.15.4 linking
SDKROOT: /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk
# use GITHUB_TOKEN from GitHub to workaround rate limits in {remotes}
# GH secret names GITHUB_PAT and GITHUB_TOKEN and GITHUB_* are protected
GITHUB_PAT: ${{ secrets.GHTKN }}
# [Custom env]
# ruODK test env variables
ODKC_URL: ${{ secrets.ODKC_URL }}
ODKC_UN: ${{ secrets.ODKC_UN }}
ODKC_PW: ${{ secrets.ODKC_PW }}
ODKC_PID: ${{ secrets.ODKC_PID }}
ODKC_FID: ${{ secrets.ODKC_FID }}
ODKC_TEST_SVC: ${{ secrets.ODKC_TEST_SVC }}
ODKC_TEST_URL: ${{ secrets.ODKC_TEST_URL }}
ODKC_TEST_PID: ${{ secrets.ODKC_TEST_PID }}
ODKC_TEST_PID_ENC: ${{ secrets.ODKC_TEST_PID_ENC }}
ODKC_TEST_FID: ${{ secrets.ODKC_TEST_FID }}
ODKC_TEST_FID_ENC: ${{ secrets.ODKC_TEST_FID_ENC }}
ODKC_TEST_FID_ZIP: ${{ secrets.ODKC_TEST_FID_ZIP }}
ODKC_TEST_FID_ATT: ${{ secrets.ODKC_TEST_FID_ATT }}
ODKC_TEST_FID_GAP: ${{ secrets.ODKC_TEST_FID_GAP }}
ODKC_TEST_FID_WKT: ${{ secrets.ODKC_TEST_FID_WKT }}
ODKC_TEST_UN: ${{ secrets.ODKC_TEST_UN }}
ODKC_TEST_PW: ${{ secrets.ODKC_TEST_PW }}
ODKC_TEST_PP: ${{ secrets.ODKC_TEST_PP }}
ODKC_VERSION: ${{ secrets.ODKC_VERSION }}
ODKC_TEST_VERSION: ${{ secrets.ODKC_TEST_VERSION }}
RU_VERBOSE: ${{ secrets.RU_VERBOSE }}
RU_TIMEZONE: ${{ secrets.RU_TIMEZONE }}
steps:
- uses: actions/checkout@v2.1.1
- uses: r-lib/actions/setup-r@master
with:
r-version: ${{ matrix.config.r }}
Ncpus: 4
# LaTeX. Installation time:
# Linux: ~ 1 min
# macOS: ~ 1 min 30s
# Windows: never finishes
- uses: r-lib/actions/setup-tinytex@master
if: matrix.config.latex == 'true'
- uses: r-lib/actions/setup-pandoc@master
# set date/week for use in cache creation
# https://github.community/t5/GitHub-Actions/How-to-set-and-access-a-Workflow-variable/m-p/42970
# - cache R packages daily
- name: "[Cache] Prepare daily timestamp for cache"
if: runner.os != 'Windows'
id: date
run: echo "::set-output name=date::$(date '+%d-%m')"
- name: "[Cache] Cache R packages"
if: runner.os != 'Windows'
uses: pat-s/always-upload-cache@v2.0.0
with:
path: ${{ env.R_LIBS_USER }}
key: ${{ runner.os }}-r-${{ matrix.config.r }}-${{steps.date.outputs.date}}
restore-keys: ${{ runner.os }}-r-${{ matrix.config.r }}-${{steps.date.outputs.date}}
# for some strange Windows reason this step and the next one need to be decoupled
- name: "[Stage] Prepare"
run: |
Rscript -e "if (!requireNamespace('remotes')) install.packages('remotes', type = 'source')"
Rscript -e "if (getRversion() < '3.2' && !requireNamespace('curl')) install.packages('curl', type = 'source')"
- name: "[Stage] [Linux] Install system deps"
if: runner.os == 'Linux'
run: sudo apt install libcurl4-openssl-dev
- name: "[Custom block] [Stage] [Linux] Install additional system deps"
if: runner.os == 'Linux'
run: |
sudo apt install libxml2-dev libjq-dev libudunits2-dev libgdal-dev \
libgeos-dev libproj-dev libicu-dev libv8-dev libjq-dev libprotobuf-dev \
protobuf-compiler libgit2-dev
# libfreetype.so.6 not found on macOS-devel / r-oldrel
# https://stackoverflow.com/a/28488213/2813717
- name: "[Custom block] [macOS-devel][r-devel] Install system pkgs"
if: matrix.config.os == 'macOS-latest'
run: |
rm '/usr/local/bin/gfortran' || true
brew install freetype
brew link --overwrite freetype
brew install gdal proj geos udunits cairo libpng libgit2
- name: "[Stage] Install"
if: matrix.config.os != 'macOS-latest' || matrix.config.r != 'devel'
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()"
# macOS devel needs its own stage because we need to work with an option to suppress the usage of binaries
- name: "[Stage] Prepare & Install (macOS-devel)"
if: matrix.config.os == 'macOS-latest' && matrix.config.r == 'devel'
run: |
echo -e 'options(Ncpus = 4, pkgType = "source", repos = structure(c(CRAN = "https://cloud.r-project.org/")))' > $HOME/.Rprofile
Rscript -e "remotes::install_github('ropensci/tic')" -e "print(tic::dsl_load())" -e "tic::prepare_all_stages()" -e "tic::before_install()" -e "tic::install()"
- name: "[Stage] Script"
run: Rscript -e 'tic::script()'
- name: "[Stage] After Success"
if: matrix.config.os == 'ubuntu-18.04' && matrix.config.r == 'release'
run: Rscript -e "tic::after_success()"
- name: "[Stage] Upload R CMD check artifacts"
if: failure()
uses: actions/upload-artifact@master
with:
name: ${{ runner.os }}-r${{ matrix.config.r }}-results
path: check
- name: "[Stage] Before Deploy"
run: |
Rscript -e "tic::before_deploy()"
- name: "[Stage] Deploy"
run: Rscript -e "tic::deploy()"
- name: "[Stage] After Deploy"
run: Rscript -e "tic::after_deploy()"