-
Notifications
You must be signed in to change notification settings - Fork 24
257 lines (217 loc) · 7.07 KB
/
r.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
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
name: R
on:
workflow_dispatch:
repository_dispatch:
push:
pull_request:
env:
GH_TOKEN: ${{ secrets.GH_TOKEN }}
jobs:
rstats-linux:
name: R Package Linux
runs-on: ubuntu-20.04
env:
LIBARROW_BINARY: 'false'
ARROW_USER_SIMD_LEVEL: 'AVX2'
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
submodules: 'true'
- uses: actions/setup-python@v4
with:
python-version: '3.7'
- uses: r-lib/actions/setup-r@v2
with:
r-version: 'devel'
- name: Install
env:
GITHUB_PAT: ${{ github.token }}
shell: bash
run: |
sudo apt-get update -y -qq && sudo apt-get install -y -qq ninja-build texlive-latex-base texlive-fonts-extra libcurl4-openssl-dev valgrind pandoc tidy
mkdir -p $HOME/.R
R -f dependencies.R
- name: Prepare
shell: bash
run: |
rm -rf duckdb/test/sql/copy/csv/data/glob/crawl/.symbolic_link
mkdir -p /tmp/duckdb_extensions
./configure
R CMD build .
- name: Tests
shell: bash
run: |
ls /tmp/duckdb_extensions
R CMD INSTALL -d duckdb_*.tar.gz
(cd tests && R -f testthat.R)
- name: R CMD check
shell: bash
run: |
_R_CHECK_CRAN_INCOMING_=FALSE _R_CHECK_PKG_SIZES_=FALSE R CMD check --as-cran -o /tmp duckdb_*.tar.gz
if egrep 'NOTE|WARNING|ERROR' /tmp/duckdb.Rcheck/00check.log ; then exit 1; fi
- name: Print R log (1)
# Print logs now only if success, for the case of failure there's another identical step below.
if: ${{ success() }}
shell: bash
run: |
cat /tmp/duckdb.Rcheck/00check.log
find /tmp/duckdb.Rcheck/ -type f -name "*.Rout*" -print0 | tee /dev/stderr | xargs -0 cat
- name: Valgrind
shell: bash
run: |
export NOT_CRAN='false'
_R_CHECK_CRAN_INCOMING_=FALSE _R_CHECK_PKG_SIZES_=FALSE R CMD check --use-valgrind -o /tmp duckdb_*.tar.gz
- name: Print check directory tree
if: ${{ always() }}
shell: bash
run: |
ls -R /tmp/duckdb.Rcheck
- name: Print R log (2)
if: ${{ always() }}
shell: bash
run: |
cat /tmp/duckdb.Rcheck/00check.log
find /tmp/duckdb.Rcheck/ -type f -name "*.Rout*" -print0 | tee /dev/stderr | xargs -0 cat
- name: Coverage
env:
DUCKDB_R_DEBUG: 1
shell: Rscript {0}
run: |
pkgload::load_all(".")
cov <- covr::codecov(".", relative_path = ".")
- name: Deploy
shell: bash
run: python duckdb/scripts/asset-upload-gha.py duckdb_*.tar.gz
- uses: actions/upload-artifact@v3
with:
name: r-package-source
path: |
duckdb_*.tar.gz
rstats-linux-debug:
name: R Package Linux debug mode
runs-on: ubuntu-20.04
needs: rstats-linux
env:
LIBARROW_BINARY: 'false'
ARROW_USER_SIMD_LEVEL: 'AVX2'
DUCKDB_R_DEBUG: 1
DUCKDB_DEBUG_MOVE: 1
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
submodules: 'true'
- uses: actions/setup-python@v4
with:
python-version: '3.7'
- uses: r-lib/actions/setup-r@v2
with:
r-version: 'devel'
- name: Install
env:
GITHUB_PAT: ${{ github.token }}
shell: bash
run: |
sudo apt-get update -y -qq && sudo apt-get install -y -qq ninja-build libcurl4-openssl-dev
mkdir -p $HOME/.R
R -f dependencies.R
- name: Setup Ccache
uses: hendrikmuhs/ccache-action@main
with:
key: ${{ github.job }}
save: ${{ github.ref == 'refs/heads/main' || github.repository != 'duckdb/duckdb' }}
- name: Build
shell: bash
run: |
rm -rf duckdb/test/sql/copy/csv/data/glob/crawl/.symbolic_link
./configure
R CMD INSTALL .
rstats-windows:
# Builds binaries for windows_amd64_rtools
name: R Package Windows
needs: rstats-linux
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
submodules: 'true'
- uses: actions/setup-python@v4
with:
python-version: '3.7'
- uses: r-lib/actions/setup-r@v2
with:
r-version: 'devel'
update-rtools: true
- uses: r-lib/actions/setup-pandoc@v2
- name: Setup Ccache
uses: hendrikmuhs/ccache-action@main
with:
key: ${{ github.job }}
save: ${{ github.ref == 'refs/heads/main' || github.repository != 'duckdb/duckdb' }}
- name: Install
shell: bash
run: |
R -f dependencies.R
- name: Build
shell: bash
run: |
rm -rf duckdb/test/sql/copy/csv/data/glob/crawl/.symbolic_link
./configure
R CMD build .
R CMD INSTALL duckdb_*.tar.gz
(cd tests && R -f testthat.R)
_R_CHECK_CRAN_INCOMING_=FALSE _R_CHECK_PKG_SIZES_=FALSE R CMD check --as-cran --no-manual -o /tmp duckdb_*.tar.gz
if egrep 'NOTE|WARNING|ERROR' /tmp/duckdb.Rcheck/00check.log ; then exit 1; fi
rstats-windows-extensions:
# Builds extensions for windows_amd64_rtools
name: R Package Windows (Extensions)
if: startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/main'
needs: rstats-linux
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
submodules: 'true'
- uses: actions/setup-python@v4
with:
python-version: '3.7'
- uses: r-lib/actions/setup-r@v2
with:
r-version: 'devel'
update-rtools: true
rtools-version: '42' # linker bug in 43 ^^
- uses: r-lib/actions/setup-pandoc@v2
- name: Setup Ccache
uses: hendrikmuhs/ccache-action@main
with:
key: ${{ github.job }}
save: ${{ github.ref == 'refs/heads/main' || github.repository != 'duckdb/duckdb' }}
- uses: ./.github/actions/build_extensions
with:
deploy_as: windows_amd64_rtools
treat_warn_as_error: 0
s3_id: ${{ secrets.S3_ID }}
s3_key: ${{ secrets.S3_KEY }}
signing_pk: ${{ secrets.DUCKDB_EXTENSION_SIGNING_PK }}
override_cc: gcc
override_cxx: g++
openssl_path: C:/rtools43/x86_64-w64-mingw32.static.posix # not sure if this is required, there seems to be an openssl there
run_tests: 0
build_out_of_tree_extensions: 0
vcpkg_build: 0
no_static_linking: 1
- name: Install R package
shell: bash
run: |
rm -rf duckdb/test/sql/copy/csv/data/glob/crawl/.symbolic_link
R -e 'install.packages("DBI", repos = "https://cloud.r-project.org")'
./configure
R CMD build .
R CMD INSTALL duckdb_*.tar.gz
- name: Test Load
shell: bash
run: |
R -e 'con <- DBI::dbConnect(duckdb::duckdb(config = list("allow_unsigned_extensions" = "true")), debug=TRUE); lapply(Sys.glob("build/release/extension/*/*.duckdb_extension"), function(x) DBI::dbExecute(con, sprintf("LOAD \"%s\"", x))); DBI::dbDisconnect(con, shutdown=TRUE);'