From 6be644eceed098519d0ede30f3c632531c524376 Mon Sep 17 00:00:00 2001 From: Michael Landis Date: Tue, 5 Mar 2024 16:22:16 -0800 Subject: [PATCH 1/6] feat: drop grpc-web for .NET 4.62 build. 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. --- .github/workflows/build.yaml | 3 ++- .github/workflows/on-push-to-main-branch.yaml | 5 ++++- src/Momento.Sdk/Momento.Sdk.csproj | 9 +-------- 3 files changed, 7 insertions(+), 10 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index cd3efc60..ac8d51b7 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -8,6 +8,7 @@ jobs: build_csharp: strategy: matrix: + grpc-web: [false, true] include: - os: ubuntu-latest target-framework: net6.0 @@ -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 diff --git a/.github/workflows/on-push-to-main-branch.yaml b/.github/workflows/on-push-to-main-branch.yaml index 1ee763cd..f42cfabc 100644 --- a/.github/workflows/on-push-to-main-branch.yaml +++ b/.github/workflows/on-push-to-main-branch.yaml @@ -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 }} @@ -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 diff --git a/src/Momento.Sdk/Momento.Sdk.csproj b/src/Momento.Sdk/Momento.Sdk.csproj index 4aea7550..53553cb8 100644 --- a/src/Momento.Sdk/Momento.Sdk.csproj +++ b/src/Momento.Sdk/Momento.Sdk.csproj @@ -30,13 +30,6 @@ https://github.com/momentohq/client-sdk-dotnet - - - USE_GRPC_WEB - - @@ -66,7 +59,7 @@ - + From d628a145cd165d7edf3842f17df6862fc2026348 Mon Sep 17 00:00:00 2001 From: Michael Landis Date: Tue, 5 Mar 2024 16:26:07 -0800 Subject: [PATCH 2/6] chore: evaluate matrix.grpc-web in boolean context --- .github/workflows/build.yaml | 2 +- .github/workflows/on-push-to-main-branch.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index ac8d51b7..e88592ce 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -48,7 +48,7 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Build - run: dotnet build ${{ matrix.grpc-web == 'true' && '-p:DefineConstants=USE_GRPC_WEB' || '' }} + run: dotnet build ${{ matrix.grpc-web && '-p:DefineConstants=USE_GRPC_WEB' || '' }} - name: Unit Test run: dotnet test --logger "console;verbosity=detailed" -f ${{ matrix.target-framework }} tests/Unit/Momento.Sdk.Tests diff --git a/.github/workflows/on-push-to-main-branch.yaml b/.github/workflows/on-push-to-main-branch.yaml index f42cfabc..3994a600 100644 --- a/.github/workflows/on-push-to-main-branch.yaml +++ b/.github/workflows/on-push-to-main-branch.yaml @@ -35,7 +35,7 @@ jobs: dotnet-version: "6.0.x" - name: Build - run: dotnet build ${{ matrix.grpc-web == 'true' && '-p:DefineConstants=USE_GRPC_WEB' || '' }} + run: dotnet build ${{ matrix.grpc-web && '-p:DefineConstants=USE_GRPC_WEB' || '' }} - name: Unit Test run: dotnet test -f ${{ matrix.target-framework }} tests/Unit/Momento.Sdk.Tests From 281cdaa0bff18202be15ccfbff9262506359585c Mon Sep 17 00:00:00 2001 From: Michael Landis Date: Tue, 5 Mar 2024 16:38:13 -0800 Subject: [PATCH 3/6] refactor: factor out common elements of test matrix The only extra entry to add to the test matrix is running net462 on windows. --- .github/workflows/build.yaml | 6 ++---- .github/workflows/on-push-to-main-branch.yaml | 6 ++---- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index e88592ce..85889f56 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -8,12 +8,10 @@ jobs: build_csharp: strategy: matrix: + os: [ubuntu-latest, windows-latest] + target-framework: net6.0 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 }} diff --git a/.github/workflows/on-push-to-main-branch.yaml b/.github/workflows/on-push-to-main-branch.yaml index 3994a600..a5c35c33 100644 --- a/.github/workflows/on-push-to-main-branch.yaml +++ b/.github/workflows/on-push-to-main-branch.yaml @@ -8,12 +8,10 @@ jobs: build_csharp: strategy: matrix: + os: [ubuntu-latest, windows-latest] + target-framework: net6.0 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 }} From 21c639424b8a6b08116968f77a6d9a47054af467 Mon Sep 17 00:00:00 2001 From: Michael Landis Date: Tue, 5 Mar 2024 16:41:18 -0800 Subject: [PATCH 4/6] fix: target framework needs to be in a list for the matrix --- .github/workflows/build.yaml | 2 +- .github/workflows/on-push-to-main-branch.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 85889f56..0da35eb3 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -9,7 +9,7 @@ jobs: strategy: matrix: os: [ubuntu-latest, windows-latest] - target-framework: net6.0 + target-framework: [net6.0] grpc-web: [false, true] include: - os: windows-latest diff --git a/.github/workflows/on-push-to-main-branch.yaml b/.github/workflows/on-push-to-main-branch.yaml index a5c35c33..15ad0a3d 100644 --- a/.github/workflows/on-push-to-main-branch.yaml +++ b/.github/workflows/on-push-to-main-branch.yaml @@ -9,7 +9,7 @@ jobs: strategy: matrix: os: [ubuntu-latest, windows-latest] - target-framework: net6.0 + target-framework: [net6.0] grpc-web: [false, true] include: - os: windows-latest From cd90fe1a0f0a5a44f6b454b4cd17c8bd31889412 Mon Sep 17 00:00:00 2001 From: Michael Landis Date: Tue, 5 Mar 2024 16:44:01 -0800 Subject: [PATCH 5/6] fix: windows/net462 needs to run with and without grpc-web --- .github/workflows/build.yaml | 1 + .github/workflows/on-push-to-main-branch.yaml | 1 + 2 files changed, 2 insertions(+) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 0da35eb3..1f1c65a2 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -14,6 +14,7 @@ jobs: include: - os: windows-latest target-framework: net462 + grpc-web: [false, true] runs-on: ${{ matrix.os }} env: TEST_AUTH_TOKEN: ${{ secrets.ALPHA_TEST_AUTH_TOKEN }} diff --git a/.github/workflows/on-push-to-main-branch.yaml b/.github/workflows/on-push-to-main-branch.yaml index 15ad0a3d..9741aea3 100644 --- a/.github/workflows/on-push-to-main-branch.yaml +++ b/.github/workflows/on-push-to-main-branch.yaml @@ -14,6 +14,7 @@ jobs: include: - os: windows-latest target-framework: net462 + grpc-web: [false, true] runs-on: ${{ matrix.os }} env: TEST_AUTH_TOKEN: ${{ secrets.ALPHA_TEST_AUTH_TOKEN }} From 0d34d45a11adfe99b68b9c54ec4ec66dcc5a9dfe Mon Sep 17 00:00:00 2001 From: Michael Landis Date: Tue, 5 Mar 2024 16:45:37 -0800 Subject: [PATCH 6/6] fix: github actions include doesn't expand existing options --- .github/workflows/build.yaml | 5 ++++- .github/workflows/on-push-to-main-branch.yaml | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 1f1c65a2..c09495fc 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -14,7 +14,10 @@ jobs: include: - os: windows-latest target-framework: net462 - grpc-web: [false, true] + grpc-web: false + - os: windows-latest + target-framework: net462 + grpc-web: true runs-on: ${{ matrix.os }} env: TEST_AUTH_TOKEN: ${{ secrets.ALPHA_TEST_AUTH_TOKEN }} diff --git a/.github/workflows/on-push-to-main-branch.yaml b/.github/workflows/on-push-to-main-branch.yaml index 9741aea3..bca2453b 100644 --- a/.github/workflows/on-push-to-main-branch.yaml +++ b/.github/workflows/on-push-to-main-branch.yaml @@ -14,7 +14,10 @@ jobs: include: - os: windows-latest target-framework: net462 - grpc-web: [false, true] + grpc-web: false + - os: windows-latest + target-framework: net462 + grpc-web: true runs-on: ${{ matrix.os }} env: TEST_AUTH_TOKEN: ${{ secrets.ALPHA_TEST_AUTH_TOKEN }}