From 9c2e5f7fbfb6fa1d493c519cfbe611192d7ad3d9 Mon Sep 17 00:00:00 2001 From: Griffin Bassman Date: Thu, 6 Feb 2025 14:59:32 -0500 Subject: [PATCH 1/7] feat: [dotnet] simplify building/codecov CI --- .github/workflows/dotnet-build.yml | 11 +++++------ dotnet/Directory.Build.props | 4 ++++ .../Microsoft.AutoGen.Core.Grpc.Tests.csproj | 4 ---- .../Microsoft.AutoGen.Core.Tests.csproj | 4 ---- .../Microsoft.AutoGen.Integration.Tests.csproj | 1 - .../Microsoft.AutoGen.Runtime.Grpc.Tests.csproj | 4 ---- 6 files changed, 9 insertions(+), 19 deletions(-) diff --git a/.github/workflows/dotnet-build.yml b/.github/workflows/dotnet-build.yml index 8539502b9e33..3270b6ed913b 100644 --- a/.github/workflows/dotnet-build.yml +++ b/.github/workflows/dotnet-build.yml @@ -80,16 +80,15 @@ jobs: run: | echo "Build AutoGen" dotnet build --no-restore --configuration Release -bl /p:SignAssembly=true - - name: Unit Test V1 - run: dotnet test --no-build -bl --configuration Release --filter "Category=UnitV1" - - name: Unit Test V2 (With Coverage) - run: dotnet test --no-build -bl --configuration Release --filter "Category=UnitV2" --collect:"XPlat Code Coverage" + - name: Non-GRPC Tests (macos) + if: matrix.os == 'macos-latest' + run: dotnet test --no-build -bl --configuration Release --filter "Category!=GRPC" - name: Install Dev Certs for GRPC if: matrix.os == 'ubuntu-latest' run: dotnet dev-certs https --trust - - name: GRPC Tests (With Coverage) + - name: All Unit Tests With Coverage (ubuntu) if: matrix.os == 'ubuntu-latest' - run: dotnet test --no-build -bl --configuration Release --filter "Category=GRPC" --collect:"XPlat Code Coverage" + run: dotnet test --no-build -bl --configuration Release --collect:"XPlat Code Coverage" - name: Generate & Merge Coverage Report if: matrix.os == 'ubuntu-latest' run: | diff --git a/dotnet/Directory.Build.props b/dotnet/Directory.Build.props index d5610362a775..d160f5f62b36 100644 --- a/dotnet/Directory.Build.props +++ b/dotnet/Directory.Build.props @@ -39,6 +39,10 @@ + + runtime; build; native; contentfiles; analyzers; buildtransitive + all + diff --git a/dotnet/test/Microsoft.AutoGen.Core.Grpc.Tests/Microsoft.AutoGen.Core.Grpc.Tests.csproj b/dotnet/test/Microsoft.AutoGen.Core.Grpc.Tests/Microsoft.AutoGen.Core.Grpc.Tests.csproj index 4f67d9727829..e3573c93451a 100644 --- a/dotnet/test/Microsoft.AutoGen.Core.Grpc.Tests/Microsoft.AutoGen.Core.Grpc.Tests.csproj +++ b/dotnet/test/Microsoft.AutoGen.Core.Grpc.Tests/Microsoft.AutoGen.Core.Grpc.Tests.csproj @@ -8,10 +8,6 @@ - - runtime; build; native; contentfiles; analyzers; buildtransitive - all - diff --git a/dotnet/test/Microsoft.AutoGen.Core.Tests/Microsoft.AutoGen.Core.Tests.csproj b/dotnet/test/Microsoft.AutoGen.Core.Tests/Microsoft.AutoGen.Core.Tests.csproj index eed47c6238b0..29165739b635 100644 --- a/dotnet/test/Microsoft.AutoGen.Core.Tests/Microsoft.AutoGen.Core.Tests.csproj +++ b/dotnet/test/Microsoft.AutoGen.Core.Tests/Microsoft.AutoGen.Core.Tests.csproj @@ -8,10 +8,6 @@ - - runtime; build; native; contentfiles; analyzers; buildtransitive - all - diff --git a/dotnet/test/Microsoft.AutoGen.Integration.Tests/Microsoft.AutoGen.Integration.Tests.csproj b/dotnet/test/Microsoft.AutoGen.Integration.Tests/Microsoft.AutoGen.Integration.Tests.csproj index 320aa44deccb..95f519fd5ae7 100644 --- a/dotnet/test/Microsoft.AutoGen.Integration.Tests/Microsoft.AutoGen.Integration.Tests.csproj +++ b/dotnet/test/Microsoft.AutoGen.Integration.Tests/Microsoft.AutoGen.Integration.Tests.csproj @@ -10,7 +10,6 @@ - runtime; build; native; contentfiles; analyzers; buildtransitive all diff --git a/dotnet/test/Microsoft.AutoGen.Runtime.Grpc.Tests/Microsoft.AutoGen.Runtime.Grpc.Tests.csproj b/dotnet/test/Microsoft.AutoGen.Runtime.Grpc.Tests/Microsoft.AutoGen.Runtime.Grpc.Tests.csproj index c8b00ee268b0..ab0899c0f169 100644 --- a/dotnet/test/Microsoft.AutoGen.Runtime.Grpc.Tests/Microsoft.AutoGen.Runtime.Grpc.Tests.csproj +++ b/dotnet/test/Microsoft.AutoGen.Runtime.Grpc.Tests/Microsoft.AutoGen.Runtime.Grpc.Tests.csproj @@ -8,10 +8,6 @@ - - runtime; build; native; contentfiles; analyzers; buildtransitive - all - From 7153437ebb3b14d7867f5985617b869f3eddfeae Mon Sep 17 00:00:00 2001 From: Griffin Bassman Date: Thu, 6 Feb 2025 15:08:53 -0500 Subject: [PATCH 2/7] speicfy test sets explicityl --- .github/workflows/dotnet-build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/dotnet-build.yml b/.github/workflows/dotnet-build.yml index 3270b6ed913b..48acabb66b0c 100644 --- a/.github/workflows/dotnet-build.yml +++ b/.github/workflows/dotnet-build.yml @@ -82,13 +82,13 @@ jobs: dotnet build --no-restore --configuration Release -bl /p:SignAssembly=true - name: Non-GRPC Tests (macos) if: matrix.os == 'macos-latest' - run: dotnet test --no-build -bl --configuration Release --filter "Category!=GRPC" + run: dotnet test --no-build -bl --configuration Release --filter "Category=UnitV1|Category=UnitV2" - name: Install Dev Certs for GRPC if: matrix.os == 'ubuntu-latest' run: dotnet dev-certs https --trust - name: All Unit Tests With Coverage (ubuntu) if: matrix.os == 'ubuntu-latest' - run: dotnet test --no-build -bl --configuration Release --collect:"XPlat Code Coverage" + run: dotnet test --no-build -bl --configuration Release --filter "Category=UnitV1|Category=UnitV2|Category=GRPC" --collect:"XPlat Code Coverage" - name: Generate & Merge Coverage Report if: matrix.os == 'ubuntu-latest' run: | From e4249f56417556b85c65610011671dfd94ecc2ce Mon Sep 17 00:00:00 2001 From: Griffin Bassman Date: Thu, 6 Feb 2025 15:21:05 -0500 Subject: [PATCH 3/7] dummy --- .github/workflows/dotnet-build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/dotnet-build.yml b/.github/workflows/dotnet-build.yml index 48acabb66b0c..ac9b28d672a6 100644 --- a/.github/workflows/dotnet-build.yml +++ b/.github/workflows/dotnet-build.yml @@ -91,7 +91,7 @@ jobs: run: dotnet test --no-build -bl --configuration Release --filter "Category=UnitV1|Category=UnitV2|Category=GRPC" --collect:"XPlat Code Coverage" - name: Generate & Merge Coverage Report if: matrix.os == 'ubuntu-latest' - run: | + run: | # Install reportgenerator dotnet tool install -g dotnet-reportgenerator-globaltool || dotnet tool update -g dotnet-reportgenerator-globaltool # Ensure output directory exists From af43faf592381c4991059a5ad48fd849dffcc45c Mon Sep 17 00:00:00 2001 From: Griffin Bassman Date: Thu, 6 Feb 2025 15:21:15 -0500 Subject: [PATCH 4/7] dummy --- .github/workflows/dotnet-build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/dotnet-build.yml b/.github/workflows/dotnet-build.yml index ac9b28d672a6..48acabb66b0c 100644 --- a/.github/workflows/dotnet-build.yml +++ b/.github/workflows/dotnet-build.yml @@ -91,7 +91,7 @@ jobs: run: dotnet test --no-build -bl --configuration Release --filter "Category=UnitV1|Category=UnitV2|Category=GRPC" --collect:"XPlat Code Coverage" - name: Generate & Merge Coverage Report if: matrix.os == 'ubuntu-latest' - run: | + run: | # Install reportgenerator dotnet tool install -g dotnet-reportgenerator-globaltool || dotnet tool update -g dotnet-reportgenerator-globaltool # Ensure output directory exists From aee1a41ca087d65b8215963bacbb211782b52cce Mon Sep 17 00:00:00 2001 From: Griffin Bassman Date: Fri, 7 Feb 2025 11:06:25 -0500 Subject: [PATCH 5/7] only do coverage for src --- .github/workflows/dotnet-build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/dotnet-build.yml b/.github/workflows/dotnet-build.yml index 48acabb66b0c..c777f9bb066f 100644 --- a/.github/workflows/dotnet-build.yml +++ b/.github/workflows/dotnet-build.yml @@ -100,8 +100,8 @@ jobs: reportgenerator \ -reports:${{ github.workspace }}/dotnet/**/TestResults/**/coverage.cobertura.xml \ -targetdir:${{ github.workspace }}/dotnet/coverage-report \ - -reporttypes:"Cobertura;Html" - ls -R ${{ github.workspace }}/dotnet/coverage-report + -reporttypes:"Cobertura;Html" \ + -classfilters:"+dotnet/src/*" - name: Upload Merged Coverage Report if: matrix.os == 'ubuntu-latest' uses: actions/upload-artifact@v4 From 3da3ea0255700aba587cd1e22c36ba066d12dd5e Mon Sep 17 00:00:00 2001 From: Griffin Bassman Date: Fri, 7 Feb 2025 11:16:07 -0500 Subject: [PATCH 6/7] add src filter --- .github/workflows/dotnet-build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/dotnet-build.yml b/.github/workflows/dotnet-build.yml index c777f9bb066f..6b8a86959cd2 100644 --- a/.github/workflows/dotnet-build.yml +++ b/.github/workflows/dotnet-build.yml @@ -96,12 +96,12 @@ jobs: dotnet tool install -g dotnet-reportgenerator-globaltool || dotnet tool update -g dotnet-reportgenerator-globaltool # Ensure output directory exists mkdir -p ${{ github.workspace }}/dotnet/coverage-report - # Merge all coverage reports and generate HTML + XML + # Merge all coverage reports and filter only `dotnet/src` reportgenerator \ -reports:${{ github.workspace }}/dotnet/**/TestResults/**/coverage.cobertura.xml \ -targetdir:${{ github.workspace }}/dotnet/coverage-report \ -reporttypes:"Cobertura;Html" \ - -classfilters:"+dotnet/src/*" + -sourcedirs:${{ github.workspace }}/dotnet/src - name: Upload Merged Coverage Report if: matrix.os == 'ubuntu-latest' uses: actions/upload-artifact@v4 From 9ebe044990cb5d3a4961575b0eceda0533cd78bf Mon Sep 17 00:00:00 2001 From: Griffin Bassman Date: Fri, 7 Feb 2025 11:24:00 -0500 Subject: [PATCH 7/7] move comment --- .github/workflows/dotnet-build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/dotnet-build.yml b/.github/workflows/dotnet-build.yml index 6b8a86959cd2..03b990fdc093 100644 --- a/.github/workflows/dotnet-build.yml +++ b/.github/workflows/dotnet-build.yml @@ -96,12 +96,12 @@ jobs: dotnet tool install -g dotnet-reportgenerator-globaltool || dotnet tool update -g dotnet-reportgenerator-globaltool # Ensure output directory exists mkdir -p ${{ github.workspace }}/dotnet/coverage-report - # Merge all coverage reports and filter only `dotnet/src` + # Merge all coverage reports reportgenerator \ -reports:${{ github.workspace }}/dotnet/**/TestResults/**/coverage.cobertura.xml \ -targetdir:${{ github.workspace }}/dotnet/coverage-report \ -reporttypes:"Cobertura;Html" \ - -sourcedirs:${{ github.workspace }}/dotnet/src + -sourcedirs:${{ github.workspace }}/dotnet/src # filter only dotnet/src - name: Upload Merged Coverage Report if: matrix.os == 'ubuntu-latest' uses: actions/upload-artifact@v4