Skip to content

Commit

Permalink
GH-13: Add test CI: Windows + MinGW (#119)
Browse files Browse the repository at this point in the history
  • Loading branch information
raulcd and kou authored Sep 11, 2024
1 parent abf0dd8 commit 35126b8
Show file tree
Hide file tree
Showing 2 changed files with 88 additions and 1 deletion.
56 changes: 55 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,61 @@ jobs:
- name: Test
shell: bash
run: ci/scripts/test.sh $(pwd)
build_test_386:
windows-mingw:
name: AMD64 Windows MinGW ${{ matrix.mingw-n-bits }} CGO
runs-on: windows-2019
timeout-minutes: 15
strategy:
fail-fast: false
matrix:
mingw-n-bits:
#- 32 runtime handling for CGO needs 64-bit currently
- 64
env:
ARROW_GO_TESTCGO: "1"
MINGW_LINT: "1"
steps:
- name: Disable Crash Dialogs
run: |
reg add `
"HKCU\SOFTWARE\Microsoft\Windows\Windows Error Reporting" `
/v DontShowUI `
/t REG_DWORD `
/d 1 `
/f
- name: Checkout
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
with:
submodules: recursive
- uses: msys2/setup-msys2@v2
with:
msystem: MINGW${{ matrix.mingw-n-bits }}
update: true
- name: Setup MSYS2
shell: msys2 {0}
run: |
ci/scripts/msys2_setup.sh
- name: Get required Go version
run: "(. .env && echo \"GO_VERSION=${GO}\") >> $GITHUB_ENV"
- name: Update CGO Env vars
shell: msys2 {0}
run: |
echo "CGO_CPPFLAGS=-I$(cygpath --windows ${MINGW_PREFIX}/include)" >> $GITHUB_ENV
echo "CGO_LDFLAGS=-g -O2 -L$(cygpath --windows ${MINGW_PREFIX}/lib) -L$(cygpath --windows ${MINGW_PREFIX}/bin)" >> $GITHUB_ENV
echo "MINGW_PREFIX=$(cygpath --windows ${MINGW_PREFIX})" >> $GITHUB_ENV
- name: Setup Go
uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2
with:
go-version: "${{ env.GO_VERSION }}"
cache: true
cache-dependency-path: go.sum
- name: Build
shell: bash
run: ci/scripts/build.sh $(pwd)
- name: Test
shell: bash
run: ci/scripts/test.sh $(pwd)
build-test-386:
name: Cross-build and test for 386
runs-on: ubuntu-latest
timeout-minutes: 15
Expand Down
33 changes: 33 additions & 0 deletions ci/scripts/msys2_setup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#!/usr/bin/env bash
#
# 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.

set -eux

packages=()

packages+=("${MINGW_PACKAGE_PREFIX}-arrow")
packages+=("${MINGW_PACKAGE_PREFIX}-gcc")
packages+=("${MINGW_PACKAGE_PREFIX}-toolchain")
packages+=(base-devel)

pacman \
--needed \
--noconfirm \
--sync \
"${packages[@]}"

0 comments on commit 35126b8

Please sign in to comment.