Skip to content

Commit

Permalink
feat: drop grpc-web for .NET 4.62 build.
Browse files Browse the repository at this point in the history
Since we bumped the minimum .NET Framework build version from 4.61 to
4.62, we gained access to an Http/2 handler for .NET
Framework. Because 4.61 did not have an Http/2 handler, we had to
resort to gRPC-Web. Now we only need gRPC-Web for the Unity build.

In order to exercise the gRPC-Web build, we add that to the testing
matrix.
  • Loading branch information
malandis committed Mar 6, 2024
1 parent bc15ddf commit 6be644e
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 10 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ jobs:
build_csharp:
strategy:
matrix:
grpc-web: [false, true]
include:
- os: ubuntu-latest
target-framework: net6.0
Expand Down Expand Up @@ -47,7 +48,7 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Build
run: dotnet build
run: dotnet build ${{ matrix.grpc-web == 'true' && '-p:DefineConstants=USE_GRPC_WEB' || '' }}

- name: Unit Test
run: dotnet test --logger "console;verbosity=detailed" -f ${{ matrix.target-framework }} tests/Unit/Momento.Sdk.Tests
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/on-push-to-main-branch.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,12 @@ jobs:
build_csharp:
strategy:
matrix:
grpc-web: [false, true]
include:
- os: ubuntu-latest
target-framework: net6.0
- os: windows-latest
target-framework: net6.0
- os: windows-latest
target-framework: net462
runs-on: ${{ matrix.os }}
Expand All @@ -32,7 +35,7 @@ jobs:
dotnet-version: "6.0.x"

- name: Build
run: dotnet build
run: dotnet build ${{ matrix.grpc-web == 'true' && '-p:DefineConstants=USE_GRPC_WEB' || '' }}

- name: Unit Test
run: dotnet test -f ${{ matrix.target-framework }} tests/Unit/Momento.Sdk.Tests
Expand Down
9 changes: 1 addition & 8 deletions src/Momento.Sdk/Momento.Sdk.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,6 @@
<RepositoryUrl>https://github.com/momentohq/client-sdk-dotnet</RepositoryUrl>
</PropertyGroup>

<!-- Because .NET Framework doesn't support HTTP/2, we use gRPC-Web over HTTP/1.1.
Dependency resolution: .NET Framework binaries or libraries >= v4.62 that link
to Momento.Sdk will link to the .NET Framework 4.62 build. -->
<PropertyGroup Condition="'$(TargetFramework)' == 'net462' ">
<DefineConstants>USE_GRPC_WEB</DefineConstants>
</PropertyGroup>

<ItemGroup>
<None Remove="System.Threading.Channels" />
<None Remove="Internal\Middleware\" />
Expand Down Expand Up @@ -66,7 +59,7 @@
<PackageReference Include="System.Threading" Version="4.3.0" />
</ItemGroup>
<ItemGroup Condition=" $(DefineConstants.Contains('USE_GRPC_WEB')) ">
<!-- Because .NET Framework does not support HTTP/2, we fall back to gRPC-Web over HTTP/1.1 -->
<!-- Currently the Unity build needs gRPC-Web -->
<PackageReference Include="Grpc.Net.Client.Web" Version="2.52.0" />
</ItemGroup>
<ProjectExtensions>
Expand Down

0 comments on commit 6be644e

Please sign in to comment.