Skip to content

Commit da9e2fc

Browse files
committed
🤖 More Github Action performance changes
1 parent 55bb3b2 commit da9e2fc

2 files changed

Lines changed: 16 additions & 8 deletions

File tree

.github/workflows/MergeToMain.yml

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,16 @@ permissions:
1515

1616
env:
1717
DOTNET_NOLOGO: true
18+
LOWEST_FRAMEWORK: net8.0
19+
HIGHEST_FRAMEWORK: net10.0
1820

1921
jobs:
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 \
@@ -97,6 +102,7 @@ jobs:
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 }}

.github/workflows/PullRequest.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ on: pull_request
44

55
env:
66
DOTNET_NOLOGO: true
7+
LOWEST_FRAMEWORK: net8.0
8+
HIGHEST_FRAMEWORK: net10.0
79

810
jobs:
911

@@ -31,7 +33,7 @@ jobs:
3133
- run: dotnet build --configuration Debug /p:ContinuousIntegrationBuild=true
3234

3335
- name: Run tests with code coverage
34-
run: dotnet run --project ./code/WorldDomination.SimpleObservability.Tests/WorldDomination.SimpleObservability.Tests.csproj --configuration Debug --no-build --framework net8.0 -- --coverage --coverage-output-format cobertura --coverage-output coverage.cobertura.xml
36+
run: dotnet run --project ./code/WorldDomination.SimpleObservability.Tests/WorldDomination.SimpleObservability.Tests.csproj --configuration Debug --no-build --framework ${{ env.HIGHEST_FRAMEWORK }} -- --coverage --coverage-output-format cobertura --coverage-output coverage.cobertura.xml
3537

3638
- name: Code coverage
3739
uses: codecov/codecov-action@v5
@@ -75,11 +77,11 @@ jobs:
7577
run: dotnet run --project ./code/WorldDomination.SimpleObservability.Tests/WorldDomination.SimpleObservability.Tests.csproj --configuration Release --no-build --framework ${{ matrix.framework }}
7678

7779
- run: dotnet pack --configuration Release --no-build --output ./artifacts -p:DebugType=Embedded -p:VersionPrefix=$VERSION_PREFIX --version-suffix $VERSION_SUFFIX
78-
if: matrix.framework == 'net8.0'
80+
if: matrix.framework == env.LOWEST_FRAMEWORK
7981

8082
- name: Publish artifacts
8183
uses: actions/upload-artifact@v5
82-
if: matrix.framework == 'net8.0'
84+
if: matrix.framework == env.LOWEST_FRAMEWORK
8385
with:
8486
name: NuGetPackage.${{ env.VERSION_PREFIX }}-${{ env.VERSION_SUFFIX }}
8587
path: ./artifacts/

0 commit comments

Comments
 (0)