-
Notifications
You must be signed in to change notification settings - Fork 208
135 lines (128 loc) · 4.88 KB
/
Copy pathcsharp.yml
File metadata and controls
135 lines (128 loc) · 4.88 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
# 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:
push:
branches-ignore:
- 'dependabot/**'
paths:
- '.github/workflows/csharp.yml'
- 'ci/scripts/csharp_*'
- 'csharp/**'
pull_request:
paths:
- '.github/workflows/csharp.yml'
- 'ci/scripts/csharp_*'
- 'csharp/**'
concurrency:
group: ${{ github.repository }}-${{ github.head_ref || github.sha }}-${{ github.workflow }}
cancel-in-progress: true
permissions:
contents: read
defaults:
run:
# 'bash' will expand to -eo pipefail
shell: bash
jobs:
csharp:
name: "C# ${{ matrix.os }}"
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, macos-latest]
steps:
# The test project multi-targets net8.0 and net10.0, so both SDKs must be
# installed: the .NET 8 SDK cannot build net10.0, and the net8.0 tests
# cannot run without the .NET 8 runtime. Requesting a single version here
# and relying on the runner image to supply the other leaves one target
# framework silently dependent on the image contents.
- name: Install C#
uses: actions/setup-dotnet@a98b56852c35b8e3190ac28c8c2271da59106c68 # v6.0.0
with:
dotnet-version: |
8.0.x
10.0.x
- name: Checkout ADBC
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
fetch-depth: 0
submodules: recursive
persist-credentials: false
- name: Build
shell: bash
run: ci/scripts/csharp_build.sh $(pwd)
- name: Test
shell: bash
run: ci/scripts/csharp_test.sh $(pwd)
# Publishes the AOT test fixture driver as a NativeAOT shared library (net10)
# and exercises it through the managed CAdbcDriverImporter. This catches
# AOT regressions (trim-unsafe reflection, missing exports, broken C-ABI
# marshaling) on both the import and export halves of csharp/src/Apache.Arrow.Adbc/C.
csharp-aot:
name: "C# NativeAOT fixture 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
lib-name: Apache.Arrow.Adbc.TestFixture.Native.dll
- os: ubuntu-latest
rid: linux-x64
lib-name: Apache.Arrow.Adbc.TestFixture.Native.so
- os: macos-latest
rid: osx-arm64
lib-name: Apache.Arrow.Adbc.TestFixture.Native.dylib
steps:
- name: Checkout ADBC
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
fetch-depth: 0
submodules: recursive
persist-credentials: false
- name: Install .NET 10
uses: actions/setup-dotnet@a98b56852c35b8e3190ac28c8c2271da59106c68 # v6.0.0
with:
# NativeAOT requires net10. Using 10.0.x selects the latest
# available SDK; preview tags may be needed until GA.
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.
uses: ilammy/msvc-dev-cmd@0b201ec74fa43914dc39ae48a89fd1d8cb592756 # v1
- name: Publish AOT test fixture
shell: bash
run: |
dotnet publish \
csharp/test/AotInterop/Apache.Arrow.Adbc.TestFixture.Native/Apache.Arrow.Adbc.TestFixture.Native.csproj \
-c Release -r ${{ matrix.rid }} \
-o csharp/artifacts/aot-fixture
- name: Run AOT interop tests
shell: bash
env:
ADBC_TEST_AOT_FIXTURE_PATH: ${{ github.workspace }}/csharp/artifacts/aot-fixture/${{ matrix.lib-name }}
run: |
dotnet test \
csharp/test/AotInterop/Apache.Arrow.Adbc.TestFixture.Tests/Apache.Arrow.Adbc.TestFixture.Tests.csproj \
-c Release