Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions .github/workflows/csharp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,20 +45,26 @@ defaults:

jobs:
csharp:
name: "C# ${{ matrix.os }} ${{ matrix.dotnet }}"
name: "C# ${{ matrix.os }}"
runs-on: ${{ matrix.os }}
if: ${{ !contains(github.event.pull_request.title, 'WIP') }}
timeout-minutes: 15
strategy:
fail-fast: false
matrix:
dotnet: ['8.0.x', '10.0.x']
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@26b0ec14cb23fa6904739307f278c14f94c95bf1 # v5.4.0
with:
dotnet-version: ${{ matrix.dotnet }}
dotnet-version: |
8.0.x
10.0.x
- name: Checkout ADBC
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
Expand Down
22 changes: 21 additions & 1 deletion ci/scripts/csharp_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,27 @@ set -ex
source_dir=${1}/csharp/test/Apache.Arrow.Adbc.Tests

pushd ${source_dir}
dotnet test

# The test project targets net472 on every platform so that build is always
# compiled, but net472 tests can only be *run* on Windows -- there is no .NET
# Framework test host on Linux or macOS. On those platforms run the remaining
# target frameworks one at a time. The list is read back from the project so
# that adding a target framework does not silently drop it from CI.
case "$(uname -s)" in
MINGW*|MSYS*|CYGWIN*)
dotnet test
;;
*)
target_frameworks=$(dotnet msbuild Apache.Arrow.Adbc.Testing.csproj \
-getProperty:TargetFrameworks -nologo | tr -d '\r')
for target_framework in ${target_frameworks//;/ }; do
if [ "${target_framework}" != "net472" ]; then
dotnet test -f "${target_framework}"
fi
done
;;
esac

popd

# Databricks driver has been moved out of this repo; its tests are kept
Expand Down
4 changes: 4 additions & 0 deletions csharp/Benchmarks/Benchmarks.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<!-- A local benchmark harness, not a shipped library. Without this it is
packable by default and produces a Benchmarks.nupkg that is built into
the release artifacts but never published. -->
<IsPackable>false</IsPackable>
<TargetFrameworks Condition="'$(IsWindows)'=='true'">net8.0;net472</TargetFrameworks>
<TargetFrameworks Condition="'$(TargetFrameworks)'==''">net8.0</TargetFrameworks>
<ImplicitUsings>enable</ImplicitUsings>
Expand Down
7 changes: 6 additions & 1 deletion csharp/Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,12 @@
<PackageVersion Include="System.Text.Json" Version="9.0.9" />
<PackageVersion Include="System.Threading.Channels" Version="9.0.8" />
<PackageVersion Include="xunit" Version="2.9.3" />
<PackageVersion Include="xunit.runner.visualstudio" Version="3.1.5" />
<PackageVersion Include="xunit.runner.visualstudio"
Version="3.1.5"
Condition="'$(TargetFramework)' != 'net472'" />
<PackageVersion Include="xunit.runner.visualstudio"
Version="2.8.2"
Condition="'$(TargetFramework)' == 'net472'" />
<PackageVersion Include="Xunit.SkippableFact" Version="1.5.61" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks Condition="'$(IsWindows)'=='true'">net8.0;net10.0;net472</TargetFrameworks>
<TargetFrameworks Condition="'$(TargetFrameworks)'==''">net8.0;net10.0</TargetFrameworks>
<TargetFrameworks>net8.0;net10.0;net472</TargetFrameworks>
<IsPackable>true</IsPackable>
<IsTestProject>true</IsTestProject>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
Expand Down
Loading