Skip to content

Commit bb2be2d

Browse files
authored
ci: add Go/CGO to vcpkg and Windows-on-ARM tests (#4728)
Closes #4683.
1 parent 3b555f0 commit bb2be2d

2 files changed

Lines changed: 19 additions & 11 deletions

File tree

.github/workflows/native-vcpkg.yml

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,9 @@ jobs:
6060
strategy:
6161
matrix:
6262
include:
63-
- { os: windows-latest, arch: x64, config: debug, msystem: UCRT64, msysbin: mingw64, env: x86_64, triplet: x64-windows }
64-
- { os: windows-latest, arch: x64, config: release, msystem: UCRT64, msysbin: mingw64, env: x86_64, triplet: x64-windows-static-release }
65-
- { os: windows-11-arm, arch: arm64, config: release, msystem: CLANGARM64, msysbin: clangarm64, env: clang-aarch64, triplet: arm64-windows-static-release }
63+
- { os: windows-latest, arch: x64, config: debug, msystem: UCRT64, msysbin: mingw64, env: x86_64, compiler-package: mingw-w64-x86_64-gcc, triplet: x64-windows }
64+
- { os: windows-latest, arch: x64, config: release, msystem: UCRT64, msysbin: mingw64, env: x86_64, compiler-package: mingw-w64-x86_64-gcc, triplet: x64-windows-static-release }
65+
- { os: windows-11-arm, arch: arm64, config: release, msystem: CLANGARM64, msysbin: clangarm64, env: clang-aarch64, compiler-package: mingw-w64-clang-aarch64-gcc-compat, triplet: arm64-windows-static-release }
6666
env:
6767
VCPKG_DEFAULT_BINARY_CACHE: ${{ github.workspace }}/vcpkg-cache
6868
VCPKG_DEFAULT_TRIPLET: ${{ matrix.triplet }}
@@ -80,18 +80,13 @@ jobs:
8080
# Needed for gendef tool in GoUtils.cmake
8181
install: |
8282
mingw-w64-${{ matrix.env }}-tools
83+
${{ matrix.compiler-package }}
8384
- name: Add msys2 toolchain to PATH
8485
env:
8586
MSYS_LOCATION: ${{ steps.msys2.outputs.msys2-location }}
8687
run: |
8788
"$($env:MSYS_LOCATION)\${{ matrix.msysbin }}\bin" |
8889
Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
89-
- name: Setup MSYS2 tools
90-
if: matrix.arch == 'arm64'
91-
shell: msys2 {0}
92-
run: |
93-
# Needed for CGO
94-
pacman --noconfirm -S mingw-w64-${{ matrix.env }}-gcc-compat
9590
- name: Ensure vcpkg binary cache directory
9691
run: |
9792
New-Item -ItemType Directory -Force `
@@ -120,10 +115,23 @@ jobs:
120115
if (-not $?) { throw "failed to configure CMake" }
121116
122117
cmake --build .\build\${{ matrix.config }} --target install --config ${{ matrix.config }} --parallel
123-
- name: Test
118+
- name: Test (C++)
124119
env:
125120
BUILD_ALL: "0"
126121
BUILD_DRIVER_MANAGER: "1"
127122
BUILD_DRIVER_MANAGER_USER_CONFIG_TEST: "1"
128123
BUILD_DRIVER_SQLITE: "1"
129124
run: .\ci\scripts\cpp_test.ps1 $pwd\build\${{ matrix.config }} $pwd\local\${{ matrix.config }}
125+
126+
- uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0
127+
with:
128+
check-latest: true
129+
cache: true
130+
cache-dependency-path: go/adbc/go.sum
131+
go-version-file: go/adbc/go.mod
132+
- name: Test (Go/CGO)
133+
env:
134+
CGO_ENABLED: "1"
135+
run: |
136+
.\ci\scripts\go_build.ps1 $pwd $pwd\build\${{ matrix.config }} $pwd\local\${{ matrix.config }}
137+
.\ci\scripts\go_test.ps1 $pwd $pwd\build\${{ matrix.config }} $pwd\local\${{ matrix.config }}

ci/scripts/go_test.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ $BuildDir = $Args[1]
2222
$InstallDir = if ($Args[2] -ne $null) { $Args[2] } else { Join-Path $BuildDir "local/" }
2323

2424
if ($env:CGO_ENABLED -eq "1") {
25-
$env:PATH += "$($InstallDir)\bin"
25+
$env:PATH = "$($InstallDir)\bin;$env:PATH"
2626
}
2727

2828
$GoDir = Join-Path $SourceDir "go" "adbc"

0 commit comments

Comments
 (0)