mirror of
https://github.com/apache/arrow.git
synced 2026-10-29 00:56:31 +08:00
ARROW-15606: [CI] [R] Add brew build that exercises the R package
This adds a build (which could probably have a better name) which tests the R package after an install with brew. It also cleans up / uses macros for the current brew build so we don't repeat ourselves too much. Closes #12364 from jonkeane/ARROW-15606 Authored-by: Jonathan Keane <jkeane@gmail.com> Signed-off-by: Jonathan Keane <jkeane@gmail.com>
This commit is contained in:
1 parent
699449f2f5
commit
5ad5ddcafe
5 files changed
+110
-38
No files matched your search
@@ -63,6 +63,10 @@ class ApacheArrow < Formula
|
||||
# https://github.com/Homebrew/homebrew-core/issues/76537
|
||||
ENV.runtime_cpu_detection if Hardware::CPU.intel?
|
||||
|
||||
# https://github.com/Homebrew/homebrew-core/issues/94724
|
||||
# https://issues.apache.org/jira/browse/ARROW-15664
|
||||
ENV["HOMEBREW_OPTIMIZATION_LEVEL"] = "O2"
|
||||
|
||||
# link against system libc++ instead of llvm provided libc++
|
||||
ENV.remove "HOMEBREW_LIBRARY_PATHS", Formula["llvm"].opt_lib
|
||||
args = %W[
|
||||
|
||||
@@ -15,52 +15,18 @@
|
||||
# specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
# NOTE: must set "Crossbow" as name to have the badge links working in the
|
||||
# github comment reports!
|
||||
name: Crossbow
|
||||
{% import 'macros.jinja' as macros with context %}
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- "*-github-*"
|
||||
{{ macros.github_header() }}
|
||||
|
||||
jobs:
|
||||
homebrew:
|
||||
name: "Homebrew"
|
||||
runs-on: macOS-latest
|
||||
steps:
|
||||
- name: Checkout Arrow
|
||||
run: |
|
||||
git clone --no-checkout {{ arrow.remote }} arrow
|
||||
git -C arrow fetch -t {{ arrow.remote }} {{ arrow.branch }}
|
||||
git -C arrow checkout FETCH_HEAD
|
||||
git -C arrow submodule update --init --recursive
|
||||
- name: Configure Homebrew formula for testing
|
||||
env:
|
||||
ARROW_FORMULA: ./arrow/dev/tasks/homebrew-formulae/{{ formula }}
|
||||
run: |
|
||||
brew update
|
||||
brew --version
|
||||
brew unlink python@2 || true
|
||||
brew config
|
||||
brew doctor || true
|
||||
{{ macros.github_checkout_arrow()|indent }}
|
||||
|
||||
ARROW_GLIB_FORMULA=$(echo ${ARROW_FORMULA} | sed -e 's/\.rb/-glib.rb/')
|
||||
echo "ARROW_GLIB_FORMULA=${ARROW_GLIB_FORMULA}" >> ${GITHUB_ENV}
|
||||
for formula in ${ARROW_FORMULA} ${ARROW_GLIB_FORMULA}; do
|
||||
if [ ! -f ${formula} ]; then
|
||||
continue
|
||||
fi
|
||||
# Pin the current commit in the formula to test so that
|
||||
# we're not always pulling from master
|
||||
sed -i '' -E \
|
||||
-e 's@https://github.com/apache/arrow.git"$@{{ arrow.remote }}.git", revision: "{{ arrow.head }}"@' \
|
||||
${formula}
|
||||
# Sometimes crossbow gives a remote URL with .git and sometimes not.
|
||||
# Make sure there's only one
|
||||
sed -i '' -E -e 's@.git.git@.git@' ${formula}
|
||||
cp ${formula} $(brew --repository homebrew/core)/Formula/
|
||||
done
|
||||
{{ macros.configure_homebrew_arrow(formula)|indent }}
|
||||
- name: Test formula
|
||||
run: |
|
||||
brew install -v --HEAD apache-arrow
|
||||
|
||||
@@ -192,3 +192,32 @@ on:
|
||||
"https://${CROSSBOW_GEMFURY_TOKEN}@push.fury.io/${CROSSBOW_GEMFURY_ORG}/"
|
||||
{% endif %}
|
||||
{% endmacro %}
|
||||
|
||||
{%- macro configure_homebrew_arrow(formula) -%}
|
||||
- name: Configure Homebrew formula for testing
|
||||
env:
|
||||
ARROW_FORMULA: ./arrow/dev/tasks/homebrew-formulae/{{ formula }}
|
||||
run: |
|
||||
brew update
|
||||
brew --version
|
||||
brew unlink python@2 || true
|
||||
brew config
|
||||
brew doctor || true
|
||||
|
||||
ARROW_GLIB_FORMULA=$(echo ${ARROW_FORMULA} | sed -e 's/\.rb/-glib.rb/')
|
||||
echo "ARROW_GLIB_FORMULA=${ARROW_GLIB_FORMULA}" >> ${GITHUB_ENV}
|
||||
for formula in ${ARROW_FORMULA} ${ARROW_GLIB_FORMULA}; do
|
||||
if [ ! -f ${formula} ]; then
|
||||
continue
|
||||
fi
|
||||
# Pin the current commit in the formula to test so that
|
||||
# we're not always pulling from master
|
||||
sed -i '' -E \
|
||||
-e 's@https://github.com/apache/arrow.git"$@{{ arrow.remote }}.git", revision: "{{ arrow.head }}"@' \
|
||||
${formula}
|
||||
# Sometimes crossbow gives a remote URL with .git and sometimes not.
|
||||
# Make sure there's only one
|
||||
sed -i '' -E -e 's@.git.git@.git@' ${formula}
|
||||
cp ${formula} $(brew --repository homebrew/core)/Formula/
|
||||
done
|
||||
{% endmacro %}
|
||||
@@ -0,0 +1,64 @@
|
||||
# Licensed to the Apache Software Foundation (ASF) under one
|
||||
# or more contributor license agreements. See the NOTICE file
|
||||
# distributed with this work for additional information
|
||||
# regarding copyright ownership. The ASF licenses this file
|
||||
# to you under the Apache License, Version 2.0 (the
|
||||
# "License"); you may not use this file except in compliance
|
||||
# with the License. You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing,
|
||||
# software distributed under the License is distributed on an
|
||||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
# KIND, either express or implied. See the License for the
|
||||
# specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
{% import 'macros.jinja' as macros with context %}
|
||||
|
||||
{{ macros.github_header() }}
|
||||
|
||||
jobs:
|
||||
autobrew:
|
||||
name: "Homebrew + R package"
|
||||
runs-on: macOS-11
|
||||
steps:
|
||||
{{ macros.github_checkout_arrow()|indent }}
|
||||
|
||||
{{ macros.configure_homebrew_arrow(formula)|indent }}
|
||||
|
||||
- name: Install apache-arrow
|
||||
run: |
|
||||
brew install -v --HEAD apache-arrow
|
||||
# for testing
|
||||
brew install minio
|
||||
- uses: r-lib/actions/setup-r@v1
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
install.packages("remotes")
|
||||
remotes::install_deps("arrow/r", dependencies = TRUE)
|
||||
remotes::install_cran(c("rcmdcheck", "sys", "sessioninfo"))
|
||||
shell: Rscript {0}
|
||||
- name: Session info
|
||||
run: |
|
||||
options(width = 100)
|
||||
pkgs <- installed.packages()[, "Package"]
|
||||
sessioninfo::session_info(pkgs, include_base = TRUE)
|
||||
shell: Rscript {0}
|
||||
- name: Check
|
||||
env:
|
||||
_R_CHECK_CRAN_INCOMING_: false
|
||||
run: arrow/ci/scripts/r_test.sh arrow
|
||||
- name: Dump install logs
|
||||
run: cat arrow/r/check/arrow.Rcheck/00install.out
|
||||
if: always()
|
||||
- name: Dump test logs
|
||||
run: cat arrow/r/check/arrow.Rcheck/tests/testthat.Rout*
|
||||
if: always()
|
||||
- name: Save the test output
|
||||
if: always()
|
||||
uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: test-output
|
||||
path: arrow/r/check/arrow.Rcheck/tests/testthat.Rout*
|
||||
@@ -78,6 +78,7 @@ groups:
|
||||
r:
|
||||
- test*-r-*
|
||||
- homebrew-r-autobrew
|
||||
- homebrew-r-brew
|
||||
# r-conda tasks
|
||||
- conda-linux-gcc-py*-cpu-r*
|
||||
- conda-osx-clang-py*-r*
|
||||
@@ -141,6 +142,7 @@ groups:
|
||||
# List the homebrews explicitly because we don't care about running homebrew-cpp-autobrew
|
||||
- homebrew-cpp
|
||||
- homebrew-r-autobrew
|
||||
- homebrew-r-brew
|
||||
- nuget
|
||||
- test-*
|
||||
- example-*
|
||||
@@ -744,6 +746,13 @@ tasks:
|
||||
ci: github
|
||||
template: r/github.macos.autobrew.yml
|
||||
|
||||
homebrew-r-brew:
|
||||
# This tests that the autobrew formula + script work in practice
|
||||
ci: github
|
||||
template: r/github.macos.brew.yml
|
||||
params:
|
||||
formula: apache-arrow.rb
|
||||
|
||||
############################## Arrow JAR's ##################################
|
||||
|
||||
java-jars:
|
||||
|
||||
Reference in new issue
Block a user