77 branches : [ main, master ]
88 workflow_dispatch :
99
10+ permissions :
11+ contents : read
12+
13+ concurrency :
14+ group : build-${{ github.ref }}
15+ cancel-in-progress : true
16+
1017jobs :
1118 build :
12- name : Windows build
19+ name : Windows ${{ matrix.configuration }}
1320 runs-on : windows-latest
21+ timeout-minutes : 25
22+ strategy :
23+ fail-fast : false
24+ matrix :
25+ configuration : [Debug, Release]
1426
1527 steps :
1628 - name : Checkout
2133 with :
2234 dotnet-version : ' 8.0.x'
2335
36+ - name : Cache NuGet packages
37+ uses : actions/cache@v4
38+ with :
39+ path : ~/.nuget/packages
40+ key : nuget-${{ runner.os }}-${{ hashFiles('**/*.csproj', 'Directory.Build.props') }}
41+ restore-keys : |
42+ nuget-${{ runner.os }}-
43+
2444 - name : Validate repository layout
2545 shell : pwsh
2646 run : .\tools\scripts\validate-layout.ps1
@@ -29,17 +49,22 @@ jobs:
2949 run : dotnet restore .\PtpLabClock.sln
3050
3151 - name : Build
32- run : dotnet build .\PtpLabClock.sln -c Release --no-restore
52+ run : dotnet build .\PtpLabClock.sln -c ${{ matrix.configuration }} --no-restore
3353
3454 - name : Test
35- run : dotnet test .\PtpLabClock.sln -c Release --no-build --logger trx --results-directory TestResults
55+ run : dotnet test .\PtpLabClock.sln -c ${{ matrix.configuration }} --no-build --logger trx --results-directory TestResults
3656
3757 - name : Protocol smoke validation
58+ if : matrix.configuration == 'Release'
3859 run : dotnet run --project .\src\PtpLabClock.Console --configuration Release -- --validate-protocol --domain 0
3960
61+ - name : Export protocol validation PCAP
62+ if : matrix.configuration == 'Release'
63+ run : dotnet run --project .\src\PtpLabClock.Console --configuration Release -- --validate-protocol --domain 0 --export-pcap .\TestResults\ptp-validation.pcap
64+
4065 - name : Upload test results
4166 if : always()
4267 uses : actions/upload-artifact@v4
4368 with :
44- name : test-results
69+ name : test-results-${{ matrix.configuration }}
4570 path : TestResults
0 commit comments