Skip to content

Commit a97402a

Browse files
committed
Add MacOS ODBC workflows to cpp_odbc.yml
1 parent 79229fa commit a97402a

1 file changed

Lines changed: 107 additions & 0 deletions

File tree

‎.github/workflows/cpp_odbc.yml‎

Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,3 +178,110 @@ jobs:
178178
# with:
179179
# name: flight-sql-odbc-msi-installer
180180
# path: ${{ github.workspace }}\build\cpp\Apache Arrow Flight SQL ODBC-1.0.0-win64.msi
181+
macos:
182+
name: ${{ matrix.architecture }} macOS ${{ matrix.macos-version }} C++
183+
runs-on: macos-${{ matrix.macos-version }}
184+
if: ${{ !contains(github.event.pull_request.title, 'WIP') }}
185+
timeout-minutes: 75
186+
strategy:
187+
fail-fast: false
188+
matrix:
189+
include:
190+
- architecture: AMD64
191+
macos-version: "15-intel"
192+
- architecture: ARM64
193+
macos-version: "14"
194+
env:
195+
ARROW_AZURE: ON
196+
ARROW_BUILD_TESTS: ON
197+
ARROW_DATASET: ON
198+
ARROW_FLIGHT: ON
199+
ARROW_FLIGHT_SQL: ON
200+
ARROW_FLIGHT_SQL_ODBC: ON
201+
ARROW_GANDIVA: ON
202+
ARROW_GCS: ON
203+
ARROW_HDFS: ON
204+
ARROW_HOME: /tmp/local
205+
ARROW_JEMALLOC: ON
206+
ARROW_ORC: ON
207+
ARROW_PARQUET: ON
208+
ARROW_S3: ON
209+
ARROW_SUBSTRAIT: ON
210+
ARROW_WITH_BROTLI: ON
211+
ARROW_WITH_BZ2: ON
212+
ARROW_WITH_LZ4: ON
213+
# GH-36013 disabling opentelemetry here because we can't
214+
# get the patched version from conda
215+
# ARROW_WITH_OPENTELEMETRY: ON
216+
ARROW_WITH_SNAPPY: ON
217+
ARROW_WITH_ZLIB: ON
218+
ARROW_WITH_ZSTD: ON
219+
steps:
220+
- name: CPU Info
221+
run: |
222+
sysctl -a | grep cpu
223+
sysctl -a | grep "hw.optional"
224+
- name: Checkout Arrow
225+
uses: actions/checkout@v6.0.0
226+
with:
227+
fetch-depth: 0
228+
submodules: recursive
229+
- name: Install Dependencies
230+
run: |
231+
# pkg-config formula is deprecated but it's still installed
232+
# in GitHub Actions runner now. We can remove this once
233+
# pkg-config formula is removed from GitHub Actions runner.
234+
brew uninstall pkg-config || :
235+
brew uninstall pkg-config@0.29.2 || :
236+
brew bundle --file=cpp/Brewfile
237+
export LIBIODBC_DIR="$(brew --cellar libiodbc)/$(brew list --versions libiodbc | awk '{print $2}')"
238+
echo ODBC_INCLUDE_DIR="$LIBIODBC_DIR/include" >> $GITHUB_ENV
239+
echo ODBC_LIB_DIR="$LIBIODBC_DIR/lib" >> $GITHUB_ENV
240+
- name: Install MinIO
241+
run: |
242+
$(brew --prefix bash)/bin/bash \
243+
ci/scripts/install_minio.sh latest ${ARROW_HOME}
244+
- name: Set up Python
245+
uses: actions/setup-python@v6.0.0
246+
with:
247+
python-version: 3.12
248+
- name: Install Google Cloud Storage Testbench
249+
run: ci/scripts/install_gcs_testbench.sh default
250+
- name: Install Azurite Storage Emulator
251+
run: ci/scripts/install_azurite.sh
252+
- name: Setup ccache
253+
run: |
254+
ci/scripts/ccache_setup.sh
255+
- name: ccache info
256+
id: ccache-info
257+
run: |
258+
echo "cache-dir=$(ccache --get-config cache_dir)" >> $GITHUB_OUTPUT
259+
- name: Cache ccache
260+
uses: actions/cache@v4
261+
with:
262+
path: ${{ steps.ccache-info.outputs.cache-dir }}
263+
key: cpp-ccache-macos-${{ matrix.macos-version }}-${{ hashFiles('cpp/**') }}
264+
restore-keys: cpp-ccache-macos-${{ matrix.macos-version }}-
265+
- name: Build
266+
run: |
267+
# Homebrew uses /usr/local as prefix. So packages
268+
# installed by Homebrew also use /usr/local/include. We
269+
# want to include headers for packages installed by
270+
# Homebrew as system headers to ignore warnings in them.
271+
# But "-isystem /usr/local/include" isn't used by CMake
272+
# because /usr/local/include is marked as the default
273+
# include path. So we disable -Werror to avoid build error
274+
# by warnings from packages installed by Homebrew.
275+
export BUILD_WARNING_LEVEL=PRODUCTION
276+
ci/scripts/cpp_build.sh $(pwd) $(pwd)/build
277+
- name: Register Flight SQL ODBC Driver
278+
run: |
279+
chmod +x cpp/src/arrow/flight/sql/odbc/install/mac/install_odbc.sh
280+
sudo cpp/src/arrow/flight/sql/odbc/install/mac/install_odbc.sh $(pwd)/build/cpp/debug/libarrow_flight_sql_odbc.dylib
281+
- name: Test
282+
shell: bash
283+
run: |
284+
sudo sysctl -w kern.coredump=1
285+
sudo sysctl -w kern.corefile=/tmp/core.%N.%P
286+
ulimit -c unlimited # must enable within the same shell
287+
ci/scripts/cpp_test.sh $(pwd) $(pwd)/build

0 commit comments

Comments
 (0)