From f5ad04b167bbd751cf6f298a8f76faf6d9f3fd12 Mon Sep 17 00:00:00 2001 From: Joe George Date: Fri, 15 Nov 2024 09:28:07 -0500 Subject: [PATCH] Add back macOS and Windows CI (#4101) --- .github/actions/test/action.yaml | 2 ++ .github/workflows/ci.yml | 2 +- .../Tcp/TcpTransportConformanceTests.cs | 20 ++++++++++++++----- 3 files changed, 18 insertions(+), 6 deletions(-) diff --git a/.github/actions/test/action.yaml b/.github/actions/test/action.yaml index 7371265c75..122721fbbe 100644 --- a/.github/actions/test/action.yaml +++ b/.github/actions/test/action.yaml @@ -6,9 +6,11 @@ runs: - name: 🧪 Test Slice Compiler run: cargo test --manifest-path tools/slicec-cs/Cargo.toml shell: bash + - name: 🧪 Test run: dotnet test --no-build --verbosity normal --blame-hang-timeout 10s shell: bash + - name: Upload blame hang dumps uses: actions/upload-artifact@v4 with: diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7b8bab985d..b6b60c29a6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -16,7 +16,7 @@ jobs: strategy: fail-fast: false matrix: - os: [ubuntu-latest, windows-latest] + os: [ubuntu-latest, macos-latest, windows-latest] runs-on: ${{ matrix.os }} timeout-minutes: 15 steps: diff --git a/tests/IceRpc.Tests/Transports/Tcp/TcpTransportConformanceTests.cs b/tests/IceRpc.Tests/Transports/Tcp/TcpTransportConformanceTests.cs index e1a4144502..a46af69a18 100644 --- a/tests/IceRpc.Tests/Transports/Tcp/TcpTransportConformanceTests.cs +++ b/tests/IceRpc.Tests/Transports/Tcp/TcpTransportConformanceTests.cs @@ -5,6 +5,7 @@ using NUnit.Framework; using System.Net; using System.Net.Sockets; +using System.Runtime.InteropServices; namespace IceRpc.Tests.Transports.Tcp; @@ -48,16 +49,25 @@ protected override IServiceCollection CreateServiceCollection(int? listenBacklog internal class Ipv6SupportFixture { + public static void FixtureSetUp() { - using var socket = new Socket(AddressFamily.InterNetworkV6, SocketType.Stream, ProtocolType.Tcp); - try + // TODO: remove this if check once https://github.com/dotnet/runtime/issues/102663 makes it to 8.0 + if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX)) { - socket.Bind(new IPEndPoint(IPAddress.IPv6Loopback, 0)); + Assert.Ignore("IPv6 is not supported on macOS"); } - catch + else { - Assert.Ignore("IPv6 is not supported on this platform"); + using var socket = new Socket(AddressFamily.InterNetworkV6, SocketType.Stream, ProtocolType.Tcp); + try + { + socket.Bind(new IPEndPoint(IPAddress.IPv6Loopback, 0)); + } + catch + { + Assert.Ignore("IPv6 is not supported on this platform"); + } } } }