This is an automated email from the ASF dual-hosted git repository.

kou pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/arrow-go.git


The following commit(s) were added to refs/heads/main by this push:
     new 35126b8  GH-13: Add test CI: Windows + MinGW (#119)
35126b8 is described below

commit 35126b8bc5959954b52ff099ba80692e55dab1d3
Author: Raúl Cumplido <[email protected]>
AuthorDate: Wed Sep 11 02:22:38 2024 +0200

    GH-13: Add test CI: Windows + MinGW (#119)
    
    Fix https://github.com/apache/arrow-go/issues/13
    
    This part:
    
https://github.com/apache/arrow/blob/58415d1fac50cb829b3dcf08526033d6db8c30db/.github/workflows/go.yml#L404-L465
    
    ---------
    
    Co-authored-by: Sutou Kouhei <[email protected]>
---
 .github/workflows/test.yml | 56 +++++++++++++++++++++++++++++++++++++++++++++-
 ci/scripts/msys2_setup.sh  | 33 +++++++++++++++++++++++++++
 2 files changed, 88 insertions(+), 1 deletion(-)

diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml
index 2f10275..4c0c737 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 0000000..051897c
--- /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[@]}"

Reply via email to