From 339e39912a7cc8d61924ee95f39fd1d4f85f6cc1 Mon Sep 17 00:00:00 2001 From: Manuel Menegazzo <65919883+m3nax@users.noreply.github.com> Date: Thu, 22 Sep 2022 14:39:04 +0200 Subject: [PATCH 01/16] Update buildtest.yaml --- .github/workflows/buildtest.yaml | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/.github/workflows/buildtest.yaml b/.github/workflows/buildtest.yaml index e77404dca..bd6433ff0 100644 --- a/.github/workflows/buildtest.yaml +++ b/.github/workflows/buildtest.yaml @@ -36,6 +36,31 @@ jobs: # path: tests/KubernetesClient.Tests/coverage.netcoreapp2.1.cobertura.xml # repo_token: ${{ secrets.GITHUB_TOKEN }} # minimum_coverage: 0 + + # Build and test netstandard 2.1 version of library + netstandard2_1: + runs-on: ubuntu-latest + name: Dotnet build netstandard2.1 + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + - name: Setup dotnet SDK 5 + uses: actions/setup-dotnet@v2 + with: + dotnet-version: '5.0.x' + - name: Setup dotnet SDK 6 + uses: actions/setup-dotnet@v2 + with: + dotnet-version: '6.0.x' + - name: Build + run: | + dotnet build .\src\KubernetesClient\KubernetesClient.csproj -f netstandard2.1 --configuration Debug -v minimal + dotnet build .\tests\KubernetesClient.Tests\KubernetesClient.Tests.csproj -f net6.0 --configuration Debug -v minimal --no-dependencies + - name: Test + run: | + dotnet test /p:ExcludeByFile=\"**/KubernetesClient/generated/**/*.cs\" --no-build .\tests\KubernetesClient.Tests\KubernetesClient.Tests.csproj -f net6.0 + dotnet test /p:ExcludeByFile=\"**/KubernetesClient/generated/**/*.cs\" --no-build .\tests\E2E.Tests\E2E.Tests.csproj -f net6.0 # Test code gen for visual studio compatibility >> https://github.com/kubernetes-client/csharp/pull/1008 codgen: From 195de3793281284124d68240aa52efb71221afd3 Mon Sep 17 00:00:00 2001 From: Manuel Menegazzo <65919883+m3nax@users.noreply.github.com> Date: Thu, 22 Sep 2022 17:01:13 +0200 Subject: [PATCH 02/16] Update buildtest.yaml --- .github/workflows/buildtest.yaml | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/.github/workflows/buildtest.yaml b/.github/workflows/buildtest.yaml index bd6433ff0..a09a937da 100644 --- a/.github/workflows/buildtest.yaml +++ b/.github/workflows/buildtest.yaml @@ -37,7 +37,7 @@ jobs: # repo_token: ${{ secrets.GITHUB_TOKEN }} # minimum_coverage: 0 - # Build and test netstandard 2.1 version of library + # Build and test netstandard 2.1 version of library with net core 5.0 and 6.0 netstandard2_1: runs-on: ubuntu-latest name: Dotnet build netstandard2.1 @@ -53,14 +53,20 @@ jobs: uses: actions/setup-dotnet@v2 with: dotnet-version: '6.0.x' - - name: Build + - name: Build libraries + run: | + dotnet build -f netstandard2.1 --configuration Debug -v minimal ./src/KubernetesClient/KubernetesClient.csproj + dotnet build -f netstandard2.1 --configuration Debug -v minimal ./tests/kipTestLogger/SkipTestLogger.csproj + - name: Build test projects run: | - dotnet build .\src\KubernetesClient\KubernetesClient.csproj -f netstandard2.1 --configuration Debug -v minimal - dotnet build .\tests\KubernetesClient.Tests\KubernetesClient.Tests.csproj -f net6.0 --configuration Debug -v minimal --no-dependencies + dotnet build --configuration Debug -v minimal --no-dependencies -p:UseLibNetStandard2_1=true ./tests/KubernetesClient.Tests/KubernetesClient.Tests.csproj + dotnet build --configuration Debug -v minimal --no-dependencies -p:UseLibNetStandard2_1=true ./tests/E2E.Tests/E2E.Tests.csproj - name: Test run: | - dotnet test /p:ExcludeByFile=\"**/KubernetesClient/generated/**/*.cs\" --no-build .\tests\KubernetesClient.Tests\KubernetesClient.Tests.csproj -f net6.0 - dotnet test /p:ExcludeByFile=\"**/KubernetesClient/generated/**/*.cs\" --no-build .\tests\E2E.Tests\E2E.Tests.csproj -f net6.0 + dotnet test /p:CollectCoverage=true /p:ExcludeByFile=\"**/KubernetesClient/generated/**/*.cs\" /p:CoverletOutputFormat="cobertura" \ + --no-build ./tests/KubernetesClient.Tests/KubernetesClient.Tests.csproj + dotnet test /p:CollectCoverage=true /p:ExcludeByFile=\"**/KubernetesClient/generated/**/*.cs\" /p:CoverletOutputFormat="cobertura" \ + --no-build ./tests/E2E.Tests/E2E.Tests.csproj # Test code gen for visual studio compatibility >> https://github.com/kubernetes-client/csharp/pull/1008 codgen: From 1ac4166c8b9b29c4d870a1c161838333e9e1146e Mon Sep 17 00:00:00 2001 From: Manuel Menegazzo Date: Thu, 22 Sep 2022 17:03:01 +0200 Subject: [PATCH 03/16] Added custom property UseLibNetStandard2_1 to E2E.Test and KubernetesClient.Test projects --- tests/E2E.Tests/E2E.Tests.csproj | 83 ++++++++----- .../KubernetesClient.Tests.csproj | 116 ++++++++++-------- 2 files changed, 119 insertions(+), 80 deletions(-) diff --git a/tests/E2E.Tests/E2E.Tests.csproj b/tests/E2E.Tests/E2E.Tests.csproj index 4faab8f9d..d881f0aa2 100644 --- a/tests/E2E.Tests/E2E.Tests.csproj +++ b/tests/E2E.Tests/E2E.Tests.csproj @@ -1,33 +1,54 @@ - - false - true - k8s.E2E - netcoreapp3.1;net5.0;net6.0 - - - - - - - - - - - - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - - - - - - - - - - - - + + false + true + k8s.E2E + netcoreapp3.1;net5.0;net6.0 + + + + + + + + + + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + + + + + + + + + + + + false + + + + + + + + + + + + + + + + + + diff --git a/tests/KubernetesClient.Tests/KubernetesClient.Tests.csproj b/tests/KubernetesClient.Tests/KubernetesClient.Tests.csproj index a8f9f95be..7ecd104bf 100644 --- a/tests/KubernetesClient.Tests/KubernetesClient.Tests.csproj +++ b/tests/KubernetesClient.Tests/KubernetesClient.Tests.csproj @@ -1,51 +1,69 @@ - - false - k8s.Tests - netcoreapp3.1;net5.0;net6.0 - - - - - - - - - - - - - - - - all - runtime; build; native; contentfiles; analyzers - - - - - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - - - - - - - - - - - - - - - - - - - - - + + false + k8s.Tests + netcoreapp3.1;net5.0;net6.0 + + + + + + + + + + + + + + + + all + runtime; build; native; contentfiles; analyzers + + + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + + + + + + + + + + + + + + + + + + false + + + + + + + + + + + + + + + + + + From 77ce025d7be1074757e24b9563344d06d994fb92 Mon Sep 17 00:00:00 2001 From: Manuel Menegazzo <65919883+m3nax@users.noreply.github.com> Date: Thu, 22 Sep 2022 17:05:27 +0200 Subject: [PATCH 04/16] Update buildtest.yaml --- .github/workflows/buildtest.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/buildtest.yaml b/.github/workflows/buildtest.yaml index a09a937da..2fae96084 100644 --- a/.github/workflows/buildtest.yaml +++ b/.github/workflows/buildtest.yaml @@ -56,7 +56,7 @@ jobs: - name: Build libraries run: | dotnet build -f netstandard2.1 --configuration Debug -v minimal ./src/KubernetesClient/KubernetesClient.csproj - dotnet build -f netstandard2.1 --configuration Debug -v minimal ./tests/kipTestLogger/SkipTestLogger.csproj + dotnet build -f netstandard2.1 --configuration Debug -v minimal ./tests/SkipTestLogger/SkipTestLogger.csproj - name: Build test projects run: | dotnet build --configuration Debug -v minimal --no-dependencies -p:UseLibNetStandard2_1=true ./tests/KubernetesClient.Tests/KubernetesClient.Tests.csproj From 4b384afece2a5f3515159f9bf95d4e05f3e16f2b Mon Sep 17 00:00:00 2001 From: Manuel Menegazzo <65919883+m3nax@users.noreply.github.com> Date: Thu, 22 Sep 2022 17:07:44 +0200 Subject: [PATCH 05/16] Update buildtest.yaml --- .github/workflows/buildtest.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/buildtest.yaml b/.github/workflows/buildtest.yaml index 2fae96084..240399b50 100644 --- a/.github/workflows/buildtest.yaml +++ b/.github/workflows/buildtest.yaml @@ -56,7 +56,7 @@ jobs: - name: Build libraries run: | dotnet build -f netstandard2.1 --configuration Debug -v minimal ./src/KubernetesClient/KubernetesClient.csproj - dotnet build -f netstandard2.1 --configuration Debug -v minimal ./tests/SkipTestLogger/SkipTestLogger.csproj + dotnet build -f netstandard2.0 --configuration Debug -v minimal ./tests/SkipTestLogger/SkipTestLogger.csproj - name: Build test projects run: | dotnet build --configuration Debug -v minimal --no-dependencies -p:UseLibNetStandard2_1=true ./tests/KubernetesClient.Tests/KubernetesClient.Tests.csproj From ec6fbc9d16a4f8bfd82cea38d63d04d774b6fa30 Mon Sep 17 00:00:00 2001 From: Manuel Menegazzo Date: Thu, 22 Sep 2022 17:22:07 +0200 Subject: [PATCH 06/16] Remove net 3.1 from test projects --- tests/E2E.Tests/E2E.Tests.csproj | 2 +- tests/KubernetesClient.Tests/KubernetesClient.Tests.csproj | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/E2E.Tests/E2E.Tests.csproj b/tests/E2E.Tests/E2E.Tests.csproj index d881f0aa2..fefc71938 100644 --- a/tests/E2E.Tests/E2E.Tests.csproj +++ b/tests/E2E.Tests/E2E.Tests.csproj @@ -3,7 +3,7 @@ false true k8s.E2E - netcoreapp3.1;net5.0;net6.0 + net5.0;net6.0 diff --git a/tests/KubernetesClient.Tests/KubernetesClient.Tests.csproj b/tests/KubernetesClient.Tests/KubernetesClient.Tests.csproj index 7ecd104bf..8a17aa378 100644 --- a/tests/KubernetesClient.Tests/KubernetesClient.Tests.csproj +++ b/tests/KubernetesClient.Tests/KubernetesClient.Tests.csproj @@ -2,7 +2,7 @@ false k8s.Tests - netcoreapp3.1;net5.0;net6.0 + net5.0;net6.0 From 8a0cdd49474636c91be6ae888dae9691e4643c10 Mon Sep 17 00:00:00 2001 From: Manuel Menegazzo <65919883+m3nax@users.noreply.github.com> Date: Fri, 23 Sep 2022 10:55:01 +0200 Subject: [PATCH 07/16] Update buildtest.yaml --- .github/workflows/buildtest.yaml | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/.github/workflows/buildtest.yaml b/.github/workflows/buildtest.yaml index 240399b50..b896c99d4 100644 --- a/.github/workflows/buildtest.yaml +++ b/.github/workflows/buildtest.yaml @@ -37,6 +37,34 @@ jobs: # repo_token: ${{ secrets.GITHUB_TOKEN }} # minimum_coverage: 0 + # Build and test netstandard 2.0 + netstandard2_0: + runs-on: ubuntu-latest + name: Dotnet build netstandard2.0 + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + - name: Setup dotnet SDK 5 + uses: actions/setup-dotnet@v2 + with: + dotnet-version: '5.0.x' + - name: Setup dotnet SDK 6 + uses: actions/setup-dotnet@v2 + with: + dotnet-version: '6.0.x' + - name: Build libraries + run: | + dotnet build -f netstandard2.0 --configuration Debug -v minimal ./src/KubernetesClient.Classic/KubernetesClient.Classic.csproj + dotnet build -f netstandard2.0 --configuration Debug -v minimal ./tests/SkipTestLogger/SkipTestLogger.csproj + - name: Build test projects + run: | + dotnet build --configuration Debug -v minimal --no-dependencies -p:UseLibNetStandard2_0=true ./tests/KubernetesClient.Classic.Tests/KubernetesClient.Classic.Tests.csproj + - name: Test + run: | + dotnet test /p:CollectCoverage=true /p:ExcludeByFile=\"**/KubernetesClient/generated/**/*.cs\" /p:CoverletOutputFormat="cobertura" \ + --no-build ./tests/KubernetesClient.Classic.Tests/KubernetesClient.Classic.Tests.csproj + # Build and test netstandard 2.1 version of library with net core 5.0 and 6.0 netstandard2_1: runs-on: ubuntu-latest From 8f6592bbd17adf2b5df9f6f73ffde521bc234037 Mon Sep 17 00:00:00 2001 From: Manuel Menegazzo Date: Fri, 23 Sep 2022 10:57:02 +0200 Subject: [PATCH 08/16] Adde UsetNetStandard2_0 flag to E2E.Tests and KubernetesClient.Classic.Tests projects --- tests/E2E.Tests/E2E.Tests.csproj | 18 ++++++++++-- .../KubernetesClient.Classic.Tests.csproj | 28 +++++++++++++++++-- 2 files changed, 40 insertions(+), 6 deletions(-) diff --git a/tests/E2E.Tests/E2E.Tests.csproj b/tests/E2E.Tests/E2E.Tests.csproj index fefc71938..92191e9f9 100644 --- a/tests/E2E.Tests/E2E.Tests.csproj +++ b/tests/E2E.Tests/E2E.Tests.csproj @@ -1,4 +1,4 @@ - + false true @@ -30,21 +30,33 @@ - + + false false + - + + + + + + + + diff --git a/tests/KubernetesClient.Classic.Tests/KubernetesClient.Classic.Tests.csproj b/tests/KubernetesClient.Classic.Tests/KubernetesClient.Classic.Tests.csproj index 9f78ae26d..e95c53503 100644 --- a/tests/KubernetesClient.Classic.Tests/KubernetesClient.Classic.Tests.csproj +++ b/tests/KubernetesClient.Classic.Tests/KubernetesClient.Classic.Tests.csproj @@ -36,7 +36,29 @@ - - - + + + + false + + + + + + + + + + + + + + + + + + + From 61da23eb997d0fa284a2d33d5b253f756fc960a2 Mon Sep 17 00:00:00 2001 From: Manuel Menegazzo Date: Mon, 3 Oct 2022 12:26:51 +0200 Subject: [PATCH 09/16] Removed UseLibNetStandard2_0 from KubernetesClient.Classic.Tests.csproj --- .github/workflows/buildtest.yaml | 2 +- .../KubernetesClient.Classic.Tests.csproj | 97 ++++++++----------- 2 files changed, 39 insertions(+), 60 deletions(-) diff --git a/.github/workflows/buildtest.yaml b/.github/workflows/buildtest.yaml index b896c99d4..7278c21f0 100644 --- a/.github/workflows/buildtest.yaml +++ b/.github/workflows/buildtest.yaml @@ -59,7 +59,7 @@ jobs: dotnet build -f netstandard2.0 --configuration Debug -v minimal ./tests/SkipTestLogger/SkipTestLogger.csproj - name: Build test projects run: | - dotnet build --configuration Debug -v minimal --no-dependencies -p:UseLibNetStandard2_0=true ./tests/KubernetesClient.Classic.Tests/KubernetesClient.Classic.Tests.csproj + dotnet build --configuration Debug -v minimal --no-dependencies ./tests/KubernetesClient.Classic.Tests/KubernetesClient.Classic.Tests.csproj - name: Test run: | dotnet test /p:CollectCoverage=true /p:ExcludeByFile=\"**/KubernetesClient/generated/**/*.cs\" /p:CoverletOutputFormat="cobertura" \ diff --git a/tests/KubernetesClient.Classic.Tests/KubernetesClient.Classic.Tests.csproj b/tests/KubernetesClient.Classic.Tests/KubernetesClient.Classic.Tests.csproj index e95c53503..451888464 100644 --- a/tests/KubernetesClient.Classic.Tests/KubernetesClient.Classic.Tests.csproj +++ b/tests/KubernetesClient.Classic.Tests/KubernetesClient.Classic.Tests.csproj @@ -1,64 +1,43 @@  - - false - k8s.Tests - net6 - net6;net48 - - - - - - - - - - - - - - - - - all - runtime; build; native; contentfiles; analyzers - - - - - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - - - - - - - - - - false + false + k8s.Tests + net6 + net6;net48 - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + all + runtime; build; native; contentfiles; analyzers + + + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + + + + + + + + From 70940b50b37b1a444e09241ab8ff738050d358e5 Mon Sep 17 00:00:00 2001 From: Manuel Menegazzo Date: Tue, 4 Oct 2022 19:19:56 +0200 Subject: [PATCH 10/16] Removed netstandard2.0 action --- .github/workflows/buildtest.yaml | 28 ---------------------------- 1 file changed, 28 deletions(-) diff --git a/.github/workflows/buildtest.yaml b/.github/workflows/buildtest.yaml index 7278c21f0..240399b50 100644 --- a/.github/workflows/buildtest.yaml +++ b/.github/workflows/buildtest.yaml @@ -37,34 +37,6 @@ jobs: # repo_token: ${{ secrets.GITHUB_TOKEN }} # minimum_coverage: 0 - # Build and test netstandard 2.0 - netstandard2_0: - runs-on: ubuntu-latest - name: Dotnet build netstandard2.0 - steps: - - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Setup dotnet SDK 5 - uses: actions/setup-dotnet@v2 - with: - dotnet-version: '5.0.x' - - name: Setup dotnet SDK 6 - uses: actions/setup-dotnet@v2 - with: - dotnet-version: '6.0.x' - - name: Build libraries - run: | - dotnet build -f netstandard2.0 --configuration Debug -v minimal ./src/KubernetesClient.Classic/KubernetesClient.Classic.csproj - dotnet build -f netstandard2.0 --configuration Debug -v minimal ./tests/SkipTestLogger/SkipTestLogger.csproj - - name: Build test projects - run: | - dotnet build --configuration Debug -v minimal --no-dependencies ./tests/KubernetesClient.Classic.Tests/KubernetesClient.Classic.Tests.csproj - - name: Test - run: | - dotnet test /p:CollectCoverage=true /p:ExcludeByFile=\"**/KubernetesClient/generated/**/*.cs\" /p:CoverletOutputFormat="cobertura" \ - --no-build ./tests/KubernetesClient.Classic.Tests/KubernetesClient.Classic.Tests.csproj - # Build and test netstandard 2.1 version of library with net core 5.0 and 6.0 netstandard2_1: runs-on: ubuntu-latest From 5012973aa0184883b1e685990d246e95c5e20ead Mon Sep 17 00:00:00 2001 From: Manuel Menegazzo Date: Tue, 4 Oct 2022 23:04:23 +0200 Subject: [PATCH 11/16] Added netstandard2.0 compilation for KubernetesClient --- src/KubernetesClient/KubernetesClient.csproj | 42 ++++++++++---------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/src/KubernetesClient/KubernetesClient.csproj b/src/KubernetesClient/KubernetesClient.csproj index c6f2aa0be..be71ada18 100644 --- a/src/KubernetesClient/KubernetesClient.csproj +++ b/src/KubernetesClient/KubernetesClient.csproj @@ -1,29 +1,29 @@ - - netstandard2.1;net5.0;net6.0 - k8s - + + netstandard2.0;netstandard2.1;net5.0;net6.0 + k8s + - - - - - - + + + + + + - - - - - + + + + + - - + + - - - - + + + + From 1e91dabffeb8fb1f6f5397e5c24c84774541d444 Mon Sep 17 00:00:00 2001 From: Manuel Menegazzo Date: Tue, 4 Oct 2022 23:05:38 +0200 Subject: [PATCH 12/16] Improved KubernetesClient.csproj inclusion flag --- tests/E2E.Tests/E2E.Tests.csproj | 47 +++++++++++-------- .../KubernetesClient.Tests.csproj | 37 +++++++++++---- 2 files changed, 57 insertions(+), 27 deletions(-) diff --git a/tests/E2E.Tests/E2E.Tests.csproj b/tests/E2E.Tests/E2E.Tests.csproj index be4fc484c..2f1e8f262 100644 --- a/tests/E2E.Tests/E2E.Tests.csproj +++ b/tests/E2E.Tests/E2E.Tests.csproj @@ -1,4 +1,4 @@ - + false true @@ -30,37 +30,46 @@ - + + - false - false + - - - + + + - + - + + + - + - - + + + - + + + USELIBNETSTANDARD2_0 + - - + + + + - + + + USELIBNETSTANDARD2_1 + + diff --git a/tests/KubernetesClient.Tests/KubernetesClient.Tests.csproj b/tests/KubernetesClient.Tests/KubernetesClient.Tests.csproj index 348a29321..2e49fb163 100644 --- a/tests/KubernetesClient.Tests/KubernetesClient.Tests.csproj +++ b/tests/KubernetesClient.Tests/KubernetesClient.Tests.csproj @@ -45,25 +45,46 @@ - + + - false + - - + + + - + + + - + - + + + + + + + + KUBERNETESCLIENT_STANDARD2_0 + + + + + + - + + + KUBERNETESCLIENT_STANDARD2_1 + + From e1956a5de9750c6fe31b8c6d16ec701efbc61dcb Mon Sep 17 00:00:00 2001 From: Manuel Menegazzo Date: Tue, 4 Oct 2022 23:05:53 +0200 Subject: [PATCH 13/16] Excluded watch tests for netstandard2.0 --- tests/KubernetesClient.Tests/WatchTests.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tests/KubernetesClient.Tests/WatchTests.cs b/tests/KubernetesClient.Tests/WatchTests.cs index bddf0c23c..4908c3799 100644 --- a/tests/KubernetesClient.Tests/WatchTests.cs +++ b/tests/KubernetesClient.Tests/WatchTests.cs @@ -1,3 +1,6 @@ +// Exclusion of watch tests on netstandard2.0 version of KubernetesClient because the feature is unsupported +#if !KUBERNETESCLIENT_STANDARD2_0 + using k8s.Models; using k8s.Tests.Mock; using Microsoft.AspNetCore.Http; @@ -741,3 +744,5 @@ public async Task MustHttp2VersionSet() } } } + +#endif From 37a63d815d2023e411a0b31ef458dcdce9a86a1f Mon Sep 17 00:00:00 2001 From: Manuel Menegazzo Date: Tue, 4 Oct 2022 23:06:45 +0200 Subject: [PATCH 14/16] Rewritten build and test action for netstandard 2.0/2.1 --- .github/workflows/buildtest.yaml | 39 ++++++++++++++++++++------------ 1 file changed, 24 insertions(+), 15 deletions(-) diff --git a/.github/workflows/buildtest.yaml b/.github/workflows/buildtest.yaml index 0ce6728aa..ff08caac4 100644 --- a/.github/workflows/buildtest.yaml +++ b/.github/workflows/buildtest.yaml @@ -27,10 +27,13 @@ jobs: - name: Test run: dotnet test /p:CollectCoverage=true /p:ExcludeByFile=\"**/KubernetesClient/generated/**/*.cs\" /p:CoverletOutputFormat="cobertura" - # Build and test netstandard 2.1 version of library with net core 5.0 and 6.0 - netstandard2_1: + # Build and test netstandard2.0/2.1 version of library with .NET Core 6.0 + netstandard: runs-on: ubuntu-latest - name: Dotnet build netstandard2.1 + name: Dotnet build + strategy: + matrix: + netstandard-version: [netstandard2.0, netstandard2.1] steps: - uses: actions/checkout@v3 with: @@ -39,22 +42,28 @@ jobs: uses: actions/setup-dotnet@v2 with: dotnet-version: | - 5.0.x - 6.0.x + 5.0.x + 6.0.x + # Build KubernetesClient with specific netstandard version - name: Build libraries run: | - dotnet build -f netstandard2.1 --configuration Debug -v minimal ./src/KubernetesClient/KubernetesClient.csproj + dotnet build -f ${{ matrix.netstandard-version }} --configuration Debug -v minimal ./src/KubernetesClient/KubernetesClient.csproj dotnet build -f netstandard2.0 --configuration Debug -v minimal ./tests/SkipTestLogger/SkipTestLogger.csproj - - name: Build test projects + # Build KubernetesClient.Tests and E2E.Tests + - name: Build test projects with ${{ matrix.netstandard-version }} version of KubernetesClient run: | - dotnet build --configuration Debug -v minimal --no-dependencies -p:UseLibNetStandard2_1=true ./tests/KubernetesClient.Tests/KubernetesClient.Tests.csproj - dotnet build --configuration Debug -v minimal --no-dependencies -p:UseLibNetStandard2_1=true ./tests/E2E.Tests/E2E.Tests.csproj - - name: Test - run: | - dotnet test /p:CollectCoverage=true /p:ExcludeByFile=\"**/KubernetesClient/generated/**/*.cs\" /p:CoverletOutputFormat="cobertura" \ - --no-build ./tests/KubernetesClient.Tests/KubernetesClient.Tests.csproj - dotnet test /p:CollectCoverage=true /p:ExcludeByFile=\"**/KubernetesClient/generated/**/*.cs\" /p:CoverletOutputFormat="cobertura" \ - --no-build ./tests/E2E.Tests/E2E.Tests.csproj + dotnet build --configuration Debug -v minimal --no-dependencies -p:KubernetesClientVersion="${{ matrix.netstandard-version }}" ./tests/KubernetesClient.Tests/KubernetesClient.Tests.csproj + dotnet build --configuration Debug -v minimal --no-dependencies -p:KubernetesClientVersion="${{ matrix.netstandard-version }}" ./tests/E2E.Tests/E2E.Tests.csproj + # Run compiled KubernetesClient.Tests and E2E.Tests + - name: Run test projects with ${{ matrix.netstandard-version }} version of KubernetesClient + if: matrix.netstandard-version == 'netstandard2.1' + run: | + # Run KubernetesClient.Tests.csproj + dotnet test ./tests/KubernetesClient.Tests/KubernetesClient.Tests.csproj \ + /p:CollectCoverage=true /p:ExcludeByFile=\"**/KubernetesClient/generated/**/*.cs\" /p:CoverletOutputFormat="cobertura" --no-build /p:KubernetesClientVersion="${{ matrix.netstandard-version }}" + # Run E2E.Tests.csproj + dotnet test ./tests/E2E.Tests/E2E.Tests.csproj \ + /p:CollectCoverage=true /p:ExcludeByFile=\"**/KubernetesClient/generated/**/*.cs\" /p:CoverletOutputFormat="cobertura" --no-build /p:KubernetesClientVersion="${{ matrix.netstandard-version }}" # Test code gen for visual studio compatibility >> https://github.com/kubernetes-client/csharp/pull/1008 codgen: From 1c7dd0b61288916ed2eea46a7fdde427eadfef04 Mon Sep 17 00:00:00 2001 From: Manuel Menegazzo Date: Tue, 4 Oct 2022 23:09:49 +0200 Subject: [PATCH 15/16] Removed if confition from action --- .github/workflows/buildtest.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/buildtest.yaml b/.github/workflows/buildtest.yaml index ff08caac4..327305f67 100644 --- a/.github/workflows/buildtest.yaml +++ b/.github/workflows/buildtest.yaml @@ -56,7 +56,6 @@ jobs: dotnet build --configuration Debug -v minimal --no-dependencies -p:KubernetesClientVersion="${{ matrix.netstandard-version }}" ./tests/E2E.Tests/E2E.Tests.csproj # Run compiled KubernetesClient.Tests and E2E.Tests - name: Run test projects with ${{ matrix.netstandard-version }} version of KubernetesClient - if: matrix.netstandard-version == 'netstandard2.1' run: | # Run KubernetesClient.Tests.csproj dotnet test ./tests/KubernetesClient.Tests/KubernetesClient.Tests.csproj \ From a08875dd3995474098fe0ba0729aa4e52b315652 Mon Sep 17 00:00:00 2001 From: Manuel Menegazzo Date: Tue, 4 Oct 2022 23:41:29 +0200 Subject: [PATCH 16/16] Fixed constants naming --- tests/E2E.Tests/E2E.Tests.csproj | 8 ++++---- .../KubernetesClient.Tests/KubernetesClient.Tests.csproj | 4 ++-- tests/KubernetesClient.Tests/WatchTests.cs | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/tests/E2E.Tests/E2E.Tests.csproj b/tests/E2E.Tests/E2E.Tests.csproj index 2f1e8f262..980706483 100644 --- a/tests/E2E.Tests/E2E.Tests.csproj +++ b/tests/E2E.Tests/E2E.Tests.csproj @@ -50,24 +50,24 @@ - + - USELIBNETSTANDARD2_0 + KUBERNETESCLIENT_NETSTANDARD2_0 - + - USELIBNETSTANDARD2_1 + KUBERNETESCLIENT_NETSTANDARD2_1 diff --git a/tests/KubernetesClient.Tests/KubernetesClient.Tests.csproj b/tests/KubernetesClient.Tests/KubernetesClient.Tests.csproj index 2e49fb163..8e2d148ed 100644 --- a/tests/KubernetesClient.Tests/KubernetesClient.Tests.csproj +++ b/tests/KubernetesClient.Tests/KubernetesClient.Tests.csproj @@ -71,7 +71,7 @@ - KUBERNETESCLIENT_STANDARD2_0 + KUBERNETESCLIENT_NETSTANDARD2_0 @@ -82,7 +82,7 @@ - KUBERNETESCLIENT_STANDARD2_1 + KUBERNETESCLIENT_NETSTANDARD2_1 diff --git a/tests/KubernetesClient.Tests/WatchTests.cs b/tests/KubernetesClient.Tests/WatchTests.cs index 4908c3799..3a859f0f8 100644 --- a/tests/KubernetesClient.Tests/WatchTests.cs +++ b/tests/KubernetesClient.Tests/WatchTests.cs @@ -1,5 +1,5 @@ // Exclusion of watch tests on netstandard2.0 version of KubernetesClient because the feature is unsupported -#if !KUBERNETESCLIENT_STANDARD2_0 +#if !KUBERNETESCLIENT_NETSTANDARD2_0 using k8s.Models; using k8s.Tests.Mock;