diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 2f102754..4c0c7370 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -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 diff --git a/ci/scripts/msys2_setup.sh b/ci/scripts/msys2_setup.sh new file mode 100755 index 00000000..051897c1 --- /dev/null +++ b/ci/scripts/msys2_setup.sh @@ -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[@]}"