-
Notifications
You must be signed in to change notification settings - Fork 6
233 lines (210 loc) · 7.68 KB
/
Copy pathcsharp.yml
File metadata and controls
233 lines (210 loc) · 7.68 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
# Copyright (c) 2025 ADBC Drivers Contributors
#
# This file has been modified from its original version, which is
# under the Apache License:
#
# 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.
name: C#
on:
pull_request:
branches:
- main
- 'maint-*'
paths:
- '.github/workflows/csharp.yml'
- 'csharp/**'
push:
branches:
- main
- 'maint-*'
paths:
- '.github/workflows/csharp.yml'
- 'csharp/**'
concurrency:
group: ${{ github.repository }}-${{ github.ref }}-${{ github.workflow }}
cancel-in-progress: true
permissions:
contents: read
jobs:
csharp:
name: "C# ${{ matrix.os }} .NET ${{ matrix.dotnet }}"
runs-on: ${{ matrix.os }}
if: ${{ !contains(github.event.pull_request.title, 'WIP') }}
timeout-minutes: 15
strategy:
fail-fast: false
matrix:
os:
- ubuntu-latest
- windows-2022
- macos-15-intel # Intel
- macos-latest # ARM
dotnet:
- '8.0.x'
steps:
- name: Checkout repository
uses: actions/checkout@v7
with:
ref: ${{ github.event.pull_request.head.sha || github.sha }}
fetch-depth: 0
submodules: recursive
persist-credentials: false
- name: Setup .NET ${{ matrix.dotnet }}
uses: actions/setup-dotnet@v5
with:
dotnet-version: ${{ matrix.dotnet }}
- name: Build
shell: bash
run: |
./ci/scripts/csharp_build.sh "${{ github.workspace }}"
- name: Test
shell: bash
run: |
./ci/scripts/csharp_test.sh "${{ github.workspace }}"
coverage:
name: "Driver coverage (report-only)"
runs-on: ubuntu-latest
if: ${{ !contains(github.event.pull_request.title, 'WIP') }}
timeout-minutes: 15
steps:
- name: Checkout repository
uses: actions/checkout@v7
with:
ref: ${{ github.event.pull_request.head.sha || github.sha }}
fetch-depth: 0
submodules: recursive
persist-credentials: false
- name: Setup .NET 8.0.x
uses: actions/setup-dotnet@v5
with:
dotnet-version: 8.0.x
- name: Build
run: |
./ci/scripts/csharp_build.sh "${{ github.workspace }}"
- name: Collect coverage
# Coverage is informational only — failures here should not block CI.
continue-on-error: true
run: |
./ci/scripts/csharp_coverage.sh "${{ github.workspace }}"
- name: Upload cobertura report
if: always()
uses: actions/upload-artifact@v7
with:
name: driver-coverage-cobertura
path: ${{ github.workspace }}/coverage/coverage.cobertura.xml
if-no-files-found: warn
# Publishes the HiveServer2 driver as a NativeAOT shared library (net10) and
# drives it through the managed CAdbcDriverImporter against the in-process
# mock HiveServer2. This is a separate job because NativeAOT requires .NET 10
# (the main `csharp` job pins .NET 8) and because the interop tests can only
# run after the publish step that produces the native library. It catches AOT
# regressions (trim-unsafe reflection, missing exports, broken C-ABI / Arrow
# C data interface marshaling) that the in-process test pass can't.
csharp-aot:
name: "C# NativeAOT driver interop (${{ matrix.os }})"
runs-on: ${{ matrix.os }}
if: ${{ !contains(github.event.pull_request.title, 'WIP') }}
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
include:
- os: windows-2022
rid: win-x64
- os: ubuntu-latest
rid: linux-x64
- os: macos-latest
rid: osx-arm64
steps:
- name: Checkout repository
uses: actions/checkout@v7
with:
ref: ${{ github.event.pull_request.head.sha || github.sha }}
fetch-depth: 0
submodules: recursive
persist-credentials: false
- name: Setup .NET 10
uses: actions/setup-dotnet@v5
with:
# NativeAOT requires net10. Using 10.0.x selects the latest
# available SDK.
dotnet-version: '10.0.x'
- name: Setup MSVC (for NativeAOT linker)
if: runner.os == 'Windows'
# Third-party action; activates vcvars64 so ilc's downstream link.exe
# step can find link.exe/lib.exe and the Windows SDK. Pinned to a SHA
# since it isn't an official GitHub action.
uses: ilammy/msvc-dev-cmd@0b201ec74fa43914dc39ae48a89fd1d8cb592756 # v1
- name: Publish AOT driver and run interop tests
shell: bash
run: |
./ci/scripts/csharp_aot.sh "${{ github.workspace }}" "${{ matrix.rid }}"
# Hand the per-RID native library to the pack job. Only reached when the
# interop tests above pass, so a library that fails the C-ABI round-trip
# never gets packaged.
- name: Upload native library
uses: actions/upload-artifact@v7
with:
name: aot-native-${{ matrix.rid }}
# Upload the NativeAOT shared library whatever it's named
# (*.so/*.dylib/*.dll) — exactly one matches per OS — and leave debug
# symbols (.pdb/.dbg/.dSYM) out of the package.
path: |
${{ github.workspace }}/csharp/artifacts/aot-fixture/*.so
${{ github.workspace }}/csharp/artifacts/aot-fixture/*.dylib
${{ github.workspace }}/csharp/artifacts/aot-fixture/*.dll
if-no-files-found: error
# Assembles the per-RID NativeAOT libraries built by csharp-aot into a single
# multi-RID NuGet package (runtimes/<rid>/native/...). Runs once, after all
# OS legs succeed, because NativeAOT can't cross-compile a single build into
# every platform's binary.
csharp-aot-pack:
name: "C# NativeAOT driver package"
runs-on: ubuntu-latest
needs: csharp-aot
if: ${{ !contains(github.event.pull_request.title, 'WIP') }}
timeout-minutes: 15
steps:
- name: Checkout repository
uses: actions/checkout@v7
with:
ref: ${{ github.event.pull_request.head.sha || github.sha }}
fetch-depth: 0
submodules: recursive
persist-credentials: false
- name: Setup .NET 10
uses: actions/setup-dotnet@v5
with:
dotnet-version: '10.0.x'
- name: Download per-RID native libraries
uses: actions/download-artifact@v8
with:
pattern: aot-native-*
path: ${{ github.workspace }}/native-artifacts
- name: Pack native NuGet
shell: bash
run: |
./ci/scripts/csharp_aot_pack.sh \
"${{ github.workspace }}" \
"${{ github.workspace }}/native-artifacts" \
"${{ github.workspace }}/csharp/artifacts/packages"
- name: Upload native package
uses: actions/upload-artifact@v7
with:
name: aot-native-nupkg
path: ${{ github.workspace }}/csharp/artifacts/packages/*.nupkg
if-no-files-found: error