]> git.proxmox.com Git - ceph.git/blame - ceph/src/arrow/.github/workflows/r.yml
import quincy 17.2.0
[ceph.git] / ceph / src / arrow / .github / workflows / r.yml
CommitLineData
1d09f67e
TL
1# Licensed to the Apache Software Foundation (ASF) under one
2# or more contributor license agreements. See the NOTICE file
3# distributed with this work for additional information
4# regarding copyright ownership. The ASF licenses this file
5# to you under the Apache License, Version 2.0 (the
6# "License"); you may not use this file except in compliance
7# with the License. You may obtain a copy of the License at
8#
9# http://www.apache.org/licenses/LICENSE-2.0
10#
11# Unless required by applicable law or agreed to in writing,
12# software distributed under the License is distributed on an
13# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14# KIND, either express or implied. See the License for the
15# specific language governing permissions and limitations
16# under the License.
17
18name: R
19
20on:
21 push:
22 paths:
23 - ".github/workflows/r.yml"
24 - "ci/scripts/r_*.sh"
25 - "ci/scripts/cpp_*.sh"
26 - "ci/scripts/PKGBUILD"
27 - "ci/etc/rprofile"
28 - "ci/docker/**"
29 - "cpp/**"
30 - "r/**"
31 pull_request:
32 paths:
33 - ".github/workflows/r.yml"
34 - "ci/scripts/r_*.sh"
35 - "ci/scripts/cpp_*.sh"
36 - "ci/scripts/PKGBUILD"
37 - "ci/etc/rprofile"
38 - "ci/docker/**"
39 - "cpp/**"
40 - "r/**"
41
42concurrency:
43 group: ${{ github.repository }}-${{ github.ref }}-${{ github.workflow }}
44 cancel-in-progress: true
45
46env:
47 DOCKER_VOLUME_PREFIX: ".docker/"
48 ARCHERY_DOCKER_USER: ${{ secrets.DOCKERHUB_USER }}
49 ARCHERY_DOCKER_PASSWORD: ${{ secrets.DOCKERHUB_TOKEN }}
50
51jobs:
52 ubuntu:
53 name: AMD64 Ubuntu ${{ matrix.ubuntu }} R ${{ matrix.r }}
54 runs-on: ubuntu-latest
55 if: ${{ !contains(github.event.pull_request.title, 'WIP') }}
56 timeout-minutes: 75
57 strategy:
58 fail-fast: false
59 matrix:
60 r: ["4.1"]
61 ubuntu: [20.04]
62 env:
63 R: ${{ matrix.r }}
64 UBUNTU: ${{ matrix.ubuntu }}
65 steps:
66 - name: Checkout Arrow
67 uses: actions/checkout@v2
68 with:
69 fetch-depth: 0
70 - name: Fetch Submodules and Tags
71 run: ci/scripts/util_checkout.sh
72 - name: Free Up Disk Space
73 run: ci/scripts/util_cleanup.sh
74 - name: Cache Docker Volumes
75 uses: actions/cache@v2
76 with:
77 path: .docker
78 key: ubuntu-${{ matrix.ubuntu }}-r-${{ matrix.r }}-${{ hashFiles('cpp/**') }}
79 restore-keys: ubuntu-${{ matrix.ubuntu }}-r-${{ matrix.r }}-
80 - name: Check pkgdown reference sections
81 run: ci/scripts/r_pkgdown_check.sh
82 - name: Setup Python
83 uses: actions/setup-python@v1
84 with:
85 python-version: 3.8
86 - name: Setup Archery
87 run: pip install -e dev/archery[docker]
88 - name: Execute Docker Build
89 run: |
90 sudo sysctl -w kernel.core_pattern="core.%e.%p"
91 ulimit -c unlimited
92 # Setting a non-default and non-probable Marquesas French Polynesia time
93 # it has both with a .45 offset and very very few people who live there.
94 archery docker run -e TZ=MART ubuntu-r
95 - name: Dump install logs
96 run: cat r/check/arrow.Rcheck/00install.out
97 if: always()
98 - name: Dump test logs
99 run: cat r/check/arrow.Rcheck/tests/testthat.Rout*
100 if: always()
101 - name: Save the test output
102 if: always()
103 uses: actions/upload-artifact@v2
104 with:
105 name: test-output
106 path: r/check/arrow.Rcheck/tests/testthat.Rout*
107 - name: Docker Push
108 if: success() && github.event_name == 'push' && github.repository == 'apache/arrow'
109 continue-on-error: true
110 run: archery docker push ubuntu-r
111
112 bundled:
113 name: "${{ matrix.config.org }}/${{ matrix.config.image }}:${{ matrix.config.tag }}"
114 runs-on: ubuntu-latest
115 if: ${{ !contains(github.event.pull_request.title, 'WIP') }}
116 timeout-minutes: 60
117 strategy:
118 fail-fast: false
119 matrix:
120 config:
121 - { org: "rstudio", image: "r-base", tag: "4.0-centos7" }
122 - { org: "rhub", image: "debian-gcc-devel", tag: "latest" }
123 env:
124 R_ORG: ${{ matrix.config.org }}
125 R_IMAGE: ${{ matrix.config.image }}
126 R_TAG: ${{ matrix.config.tag }}
127 steps:
128 - name: Checkout Arrow
129 uses: actions/checkout@v2
130 with:
131 fetch-depth: 0
132 - name: Fetch Submodules and Tags
133 run: ci/scripts/util_checkout.sh
134 - name: Free Up Disk Space
135 run: ci/scripts/util_cleanup.sh
136 - name: Cache Docker Volumes
137 uses: actions/cache@v2
138 with:
139 path: .docker
140 key: ${{ matrix.config.image }}-r-${{ hashFiles('cpp/**') }}
141 restore-keys: ${{ matrix.config.image }}-r-
142 - name: Setup Python
143 uses: actions/setup-python@v1
144 with:
145 python-version: 3.8
146 - name: Setup Archery
147 run: pip install -e dev/archery[docker]
148 - name: Execute Docker Build
149 run: |
150 sudo sysctl -w kernel.core_pattern="core.%e.%p"
151 ulimit -c unlimited
152 # Don't set a TZ here to test that case. These builds will have the following warning in them:
153 # System has not been booted with systemd as init system (PID 1). Can't operate.
154 # Failed to connect to bus: Host is down
155 archery docker run -e TZ="" r
156 - name: Dump install logs
157 run: cat r/check/arrow.Rcheck/00install.out
158 if: always()
159 - name: Dump test logs
160 run: cat r/check/arrow.Rcheck/tests/testthat.Rout*
161 if: always()
162 - name: Save the test output
163 if: always()
164 uses: actions/upload-artifact@v2
165 with:
166 name: test-output
167 path: r/check/arrow.Rcheck/tests/testthat.Rout*
168 - name: Docker Push
169 if: success() && github.event_name == 'push' && github.repository == 'apache/arrow'
170 continue-on-error: true
171 run: archery docker push r
172
173 windows-cpp:
174 name: AMD64 Windows C++ RTools ${{ matrix.config.rtools }} ${{ matrix.config.arch }}
175 runs-on: windows-latest
176 if: ${{ !contains(github.event.pull_request.title, 'WIP') }}
177 timeout-minutes: 60
178 strategy:
179 fail-fast: false
180 matrix:
181 config:
182 - { rtools: 35, arch: 'mingw32' }
183 - { rtools: 35, arch: 'mingw64' }
184 - { rtools: 40, arch: 'mingw32' }
185 - { rtools: 40, arch: 'mingw64' }
186 - { rtools: 40, arch: 'ucrt64' }
187 steps:
188 - run: git config --global core.autocrlf false
189 - name: Checkout Arrow
190 uses: actions/checkout@v2
191 with:
192 fetch-depth: 0
193 - name: Setup ccache
194 shell: bash
195 run: |
196 ci/scripts/ccache_setup.sh
197 echo "CCACHE_DIR=$(cygpath --absolute --windows ccache)" >> $GITHUB_ENV
198 # We must enable actions/cache before r-lib/actions/setup-r to ensure
199 # using system tar instead of tar provided by Rtools.
200 # We can use tar provided by Rtools when we drop support for Rtools 3.5.
201 # Because Rtools 4.0 or later has zstd. actions/cache requires zstd
202 # when tar is GNU tar.
203 - name: Cache ccache
204 uses: actions/cache@v2
205 with:
206 path: ccache
207 key: r-${{ matrix.config.rtools }}-ccache-mingw-${{ hashFiles('cpp/**') }}
208 restore-keys: r-${{ matrix.config.rtools }}-ccache-mingw-
209 # We use the makepkg-mingw setup that is included in rtools40 even when
210 # we use the rtools35 compilers, so we always install R 4.0/Rtools40
211 - uses: r-lib/actions/setup-r@master
212 with:
213 r-version: "4.1"
214 rtools-version: 40
215 Ncpus: 2
216 - uses: r-lib/actions/setup-r@master
217 if: ${{ matrix.config.rtools == 35 }}
218 with:
219 rtools-version: 35
220 r-version: "3.6"
221 Ncpus: 2
222 - name: Build Arrow C++
223 shell: bash
224 env:
225 RTOOLS_VERSION: ${{ matrix.config.rtools }}
226 MINGW_ARCH: ${{ matrix.config.arch }}
227 run: ci/scripts/r_windows_build.sh
228 - name: Rename libarrow.zip
229 # So that they're unique when multiple are downloaded in the next step
230 shell: bash
231 run: mv libarrow.zip libarrow-rtools${{ matrix.config.rtools }}-${{ matrix.config.arch }}.zip
232 - uses: actions/upload-artifact@v1
233 with:
234 name: libarrow-rtools${{ matrix.config.rtools }}-${{ matrix.config.arch }}.zip
235 path: libarrow-rtools${{ matrix.config.rtools }}-${{ matrix.config.arch }}.zip
236 # We can remove this when we drop support for Rtools 3.5.
237 - name: Ensure using system tar in actions/cache
238 run: |
239 Write-Output "${Env:windir}\System32" | `
240 Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
241
242 windows-r:
243 needs: [windows-cpp]
244 name: AMD64 Windows R RTools ${{ matrix.rtools }}
245 runs-on: windows-latest
246 if: ${{ !contains(github.event.pull_request.title, 'WIP') }}
247 timeout-minutes: 60
248 strategy:
249 fail-fast: false
250 matrix:
251 rtools: [35, 40]
252 env:
253 ARROW_R_CXXFLAGS: "-Werror"
254 _R_CHECK_TESTS_NLINES_: 0
255 steps:
256 - run: git config --global core.autocrlf false
257 - name: Checkout Arrow
258 uses: actions/checkout@v2
259 with:
260 fetch-depth: 0
261 - run: mkdir r/windows
262 - name: Download artifacts
263 if: ${{ matrix.rtools == 35 }}
264 uses: actions/download-artifact@v2
265 with:
266 name: libarrow-rtools35-mingw32.zip
267 path: r/windows
268 - name: Download artifacts
269 if: ${{ matrix.rtools == 35 }}
270 uses: actions/download-artifact@v2
271 with:
272 name: libarrow-rtools35-mingw64.zip
273 path: r/windows
274 - name: Download artifacts
275 if: ${{ matrix.rtools == 40 }}
276 uses: actions/download-artifact@v2
277 with:
278 name: libarrow-rtools40-mingw32.zip
279 path: r/windows
280 - name: Download artifacts
281 if: ${{ matrix.rtools == 40 }}
282 uses: actions/download-artifact@v2
283 with:
284 name: libarrow-rtools40-mingw64.zip
285 path: r/windows
286 - name: Download artifacts
287 if: ${{ matrix.rtools == 40 }}
288 uses: actions/download-artifact@v2
289 with:
290 name: libarrow-rtools40-ucrt64.zip
291 path: r/windows
292 - name: Unzip and rezip libarrows
293 shell: bash
294 run: |
295 cd r/windows
296 ls *.zip | xargs -n 1 unzip -uo
297 rm -rf *.zip
298 - name: Setup ccache
299 shell: bash
300 run: |
301 ci/scripts/ccache_setup.sh
302 echo "CCACHE_DIR=$(cygpath --absolute --windows ccache)" >> $GITHUB_ENV
303 # We must enable actions/cache before r-lib/actions/setup-r to ensure
304 # using system tar instead of tar provided by Rtools.
305 # We can use tar provided by Rtools when we drop support for Rtools 3.5.
306 # Because Rtools 4.0 or later has zstd. actions/cache requires zstd
307 # when tar is GNU tar.
308 - name: Cache ccache
309 uses: actions/cache@v2
310 with:
311 path: ccache
312 key: r-${{ matrix.rtools }}-ccache-mingw-${{ hashFiles('cpp/**') }}
313 restore-keys: r-${{ matrix.rtools }}-ccache-mingw-
314 - uses: r-lib/actions/setup-r@master
315 if: ${{ matrix.rtools == 40 }}
316 with:
317 r-version: "4.1"
318 rtools-version: 40
319 Ncpus: 2
320 - uses: r-lib/actions/setup-r@master
321 if: ${{ matrix.rtools == 35 }}
322 with:
323 rtools-version: 35
324 r-version: "3.6"
325 Ncpus: 2
326 - name: Make R tests verbose
327 # If you get a segfault/mysterious test Execution halted,
328 # make this `true` to see where it dies.
329 if: false
330 shell: cmd
331 run: |
332 cd r/tests
333 sed -i.bak -E -e 's/"arrow"/"arrow", reporter = "location"/' testthat.R
334 rm -f testthat.R.bak
335 - name: Install R package dependencies
336 shell: Rscript {0}
337 run: |
338 options(pkgType="win.binary")
339 install.packages(c("remotes", "rcmdcheck"))
340 remotes::install_deps("r", dependencies = TRUE)
341 - name: Check
342 shell: Rscript {0}
343 run: |
344 # Because we do R CMD build and r/windows is in .Rbuildignore,
345 # assemble the libarrow.zip file and pass it as an env var
346 setwd("r/windows")
347 zip("libarrow.zip", ".")
348 setwd("..")
349
350 Sys.setenv(
351 RWINLIB_LOCAL = file.path(Sys.getenv("GITHUB_WORKSPACE"), "r", "windows", "libarrow.zip"),
352 MAKEFLAGS = paste0("-j", parallel::detectCores()),
353 ARROW_R_DEV = TRUE,
354 "_R_CHECK_FORCE_SUGGESTS_" = FALSE
355 )
356 rcmdcheck::rcmdcheck(".",
357 build_args = '--no-build-vignettes',
358 args = c('--no-manual', '--as-cran', '--ignore-vignettes', '--run-donttest'),
359 error_on = 'warning',
360 check_dir = 'check',
361 timeout = 3600
362 )
363 - name: Dump install logs
364 shell: cmd
365 run: cat r/check/arrow.Rcheck/00install.out
366 if: always()
367 # We can remove this when we drop support for Rtools 3.5.
368 - name: Ensure using system tar in actions/cache
369 run: |
370 Write-Output "${Env:windir}\System32" | `
371 Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append