Skip to content

Commit 8852038

Browse files
authored
Move MacOS ODBC workflows to cpp_odbc.yml
1 parent eee3dd8 commit 8852038

File tree

2 files changed

+75
-18
lines changed

2 files changed

+75
-18
lines changed

.github/workflows/cpp.yml

Lines changed: 13 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -194,8 +194,6 @@ jobs:
194194
ARROW_BUILD_TESTS: ON
195195
ARROW_DATASET: ON
196196
ARROW_FLIGHT: ON
197-
ARROW_FLIGHT_SQL: ON
198-
ARROW_FLIGHT_SQL_ODBC: ON
199197
ARROW_GANDIVA: ON
200198
ARROW_GCS: ON
201199
ARROW_HDFS: ON
@@ -232,9 +230,6 @@ jobs:
232230
brew uninstall pkg-config || :
233231
brew uninstall [email protected] || :
234232
brew bundle --file=cpp/Brewfile
235-
export LIBIODBC_DIR="$(brew --cellar libiodbc)/$(brew list --versions libiodbc | awk '{print $2}')"
236-
echo ODBC_INCLUDE_DIR="$LIBIODBC_DIR/include" >> $GITHUB_ENV
237-
echo ODBC_LIB_DIR="$LIBIODBC_DIR/lib" >> $GITHUB_ENV
238233
- name: Install MinIO
239234
run: |
240235
$(brew --prefix bash)/bin/bash \
@@ -262,20 +257,20 @@ jobs:
262257
restore-keys: cpp-ccache-macos-${{ matrix.macos-version }}-
263258
- name: Build
264259
run: |
265-
# Homebrew uses /usr/local as prefix. So packages
266-
# installed by Homebrew also use /usr/local/include. We
267-
# want to include headers for packages installed by
268-
# Homebrew as system headers to ignore warnings in them.
269-
# But "-isystem /usr/local/include" isn't used by CMake
270-
# because /usr/local/include is marked as the default
271-
# include path. So we disable -Werror to avoid build error
272-
# by warnings from packages installed by Homebrew.
273-
export BUILD_WARNING_LEVEL=PRODUCTION
260+
if [ "${{ matrix.macos-version }}" = "15-intel" ]; then
261+
# This is a workaround.
262+
#
263+
# Homebrew uses /usr/local as prefix. So packages
264+
# installed by Homebrew also use /usr/local/include. We
265+
# want to include headers for packages installed by
266+
# Homebrew as system headers to ignore warnings in them.
267+
# But "-isystem /usr/local/include" isn't used by CMake
268+
# because /usr/local/include is marked as the default
269+
# include path. So we disable -Werror to avoid build error
270+
# by warnings from packages installed by Homebrew.
271+
export BUILD_WARNING_LEVEL=PRODUCTION
272+
fi
274273
ci/scripts/cpp_build.sh $(pwd) $(pwd)/build
275-
- name: Register Flight SQL ODBC Driver
276-
run: |
277-
chmod +x cpp/src/arrow/flight/sql/odbc/install/mac/install_odbc.sh
278-
sudo cpp/src/arrow/flight/sql/odbc/install/mac/install_odbc.sh $(pwd)/build/cpp/debug/libarrow_flight_sql_odbc.dylib
279274
- name: Test
280275
shell: bash
281276
run: |

.github/workflows/cpp_odbc.yml

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,3 +178,65 @@ 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_BUILD_TESTS: ON
196+
ARROW_FLIGHT_SQL_ODBC: ON
197+
ARROW_HOME: /tmp/local
198+
steps:
199+
- name: Checkout Arrow
200+
uses: actions/[email protected]
201+
with:
202+
fetch-depth: 0
203+
submodules: recursive
204+
- name: Install Dependencies
205+
run: |
206+
brew bundle --file=cpp/Brewfile
207+
export LIBIODBC_DIR="$(brew --cellar libiodbc)/$(brew list --versions libiodbc | awk '{print $2}')"
208+
echo ODBC_INCLUDE_DIR="$LIBIODBC_DIR/include" >> $GITHUB_ENV
209+
echo ODBC_LIB_DIR="$LIBIODBC_DIR/lib" >> $GITHUB_ENV
210+
- name: Setup ccache
211+
run: |
212+
ci/scripts/ccache_setup.sh
213+
- name: ccache info
214+
id: ccache-info
215+
run: |
216+
echo "cache-dir=$(ccache --get-config cache_dir)" >> $GITHUB_OUTPUT
217+
- name: Cache ccache
218+
uses: actions/cache@v4
219+
with:
220+
path: ${{ steps.ccache-info.outputs.cache-dir }}
221+
key: cpp-ccache-macos-${{ matrix.macos-version }}-${{ hashFiles('cpp/**') }}
222+
restore-keys: cpp-ccache-macos-${{ matrix.macos-version }}-
223+
- name: Build
224+
run: |
225+
# Homebrew uses /usr/local as prefix. So packages
226+
# installed by Homebrew also use /usr/local/include. We
227+
# want to include headers for packages installed by
228+
# Homebrew as system headers to ignore warnings in them.
229+
# But "-isystem /usr/local/include" isn't used by CMake
230+
# because /usr/local/include is marked as the default
231+
# include path. So we disable -Werror to avoid build error
232+
# by warnings from packages installed by Homebrew.
233+
export BUILD_WARNING_LEVEL=PRODUCTION
234+
ci/scripts/cpp_build.sh $(pwd) $(pwd)/build
235+
- name: Register Flight SQL ODBC Driver
236+
run: |
237+
chmod +x cpp/src/arrow/flight/sql/odbc/install/mac/install_odbc.sh
238+
sudo cpp/src/arrow/flight/sql/odbc/install/mac/install_odbc.sh $(pwd)/build/cpp/debug/libarrow_flight_sql_odbc.dylib
239+
- name: Test
240+
shell: bash
241+
run: |
242+
ci/scripts/cpp_test.sh $(pwd) $(pwd)/build

0 commit comments

Comments
 (0)