@@ -15,11 +15,16 @@ permissions:
1515
1616env :
1717 DOTNET_NOLOGO : true
18+ LOWEST_FRAMEWORK : net8.0
19+ HIGHEST_FRAMEWORK : net10.0
1820
1921jobs :
2022 build_and_create_a_nuget :
2123 name : Build and create a NuGet (RELEASE)
2224 runs-on : ubuntu-latest
25+ strategy :
26+ matrix :
27+ framework : [net8.0, net10.0]
2328
2429 steps :
2530 - name : Checkout repository
@@ -45,21 +50,21 @@ jobs:
4550
4651 - run : dotnet build --configuration Release -p:ContinuousIntegrationBuild=true -p:DebugType=Embedded -p:VersionPrefix=$VERSION_PREFIX --version-suffix $VERSION_SUFFIX
4752
48- - name : Run tests (net8.0)
49- run : dotnet run --project ./code/WorldDomination.SimpleObservability.Tests/WorldDomination.SimpleObservability.Tests.csproj --configuration Release --no-build --framework net8.0
50-
51- - name : Run tests (net10.0)
52- run : dotnet run --project ./code/WorldDomination.SimpleObservability.Tests/WorldDomination.SimpleObservability.Tests.csproj --configuration Release --no-build --framework net10.0
53+ - name : Run tests (${{ matrix.framework }})
54+ run : dotnet run --project ./code/WorldDomination.SimpleObservability.Tests/WorldDomination.SimpleObservability.Tests.csproj --configuration Release --no-build --framework ${{ matrix.framework }}
5355
5456 - run : dotnet pack --configuration Release --no-build --output ./artifacts -p:DebugType=Embedded -p:VersionPrefix=$VERSION_PREFIX --version-suffix $VERSION_SUFFIX
57+ if : matrix.framework == env.HIGHEST_FRAMEWORK
5558
5659 - name : Publish artifacts
5760 uses : actions/upload-artifact@v5
61+ if : matrix.framework == env.HIGHEST_FRAMEWORK
5862 with :
5963 name : NuGetPackage.${{ env.VERSION_PREFIX }}-${{ env.VERSION_SUFFIX }}
6064 path : ./artifacts/
6165
6266 - name : Publish to GPR
67+ if : matrix.framework == env.HIGHEST_FRAMEWORK
6368 run : |
6469 dotnet nuget push "./artifacts/*.nupkg" \
6570 --no-symbols \
97102 run : dotnet run --project ./code/WorldDomination.SimpleObservability.Tests/WorldDomination.SimpleObservability.Tests.csproj --configuration Debug --no-build --framework ${{ matrix.framework }} -- --coverage --coverage-output-format cobertura --coverage-output coverage.cobertura.xml
98103
99104 - name : Code coverage
105+ if : matrix.framework == env.HIGHEST_FRAMEWORK
100106 uses : codecov/codecov-action@v5
101107 with :
102108 token : ${{ secrets.CODECOV_TOKEN }}
0 commit comments