-
Notifications
You must be signed in to change notification settings - Fork 0
70 lines (56 loc) · 1.95 KB
/
Copy pathbuild.yml
File metadata and controls
70 lines (56 loc) · 1.95 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
name: Build and Test
on:
push:
branches: [ main, master ]
pull_request:
branches: [ main, master ]
workflow_dispatch:
permissions:
contents: read
concurrency:
group: build-${{ github.ref }}
cancel-in-progress: true
jobs:
build:
name: Windows ${{ matrix.configuration }}
runs-on: windows-latest
timeout-minutes: 25
strategy:
fail-fast: false
matrix:
configuration: [Debug, Release]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.0.x'
- name: Cache NuGet packages
uses: actions/cache@v4
with:
path: ~/.nuget/packages
key: nuget-${{ runner.os }}-${{ hashFiles('**/*.csproj', 'Directory.Build.props') }}
restore-keys: |
nuget-${{ runner.os }}-
- name: Validate repository layout
shell: pwsh
run: .\tools\scripts\validate-layout.ps1
- name: Restore
run: dotnet restore .\PtpLabClock.sln
- name: Build
run: dotnet build .\PtpLabClock.sln -c ${{ matrix.configuration }} --no-restore
- name: Test
run: dotnet test .\PtpLabClock.sln -c ${{ matrix.configuration }} --no-build --logger trx --results-directory TestResults
- name: Protocol smoke validation
if: matrix.configuration == 'Release'
run: dotnet run --project .\src\PtpLabClock.Console --configuration Release -- --validate-protocol --domain 0
- name: Export protocol validation PCAP
if: matrix.configuration == 'Release'
run: dotnet run --project .\src\PtpLabClock.Console --configuration Release -- --validate-protocol --domain 0 --export-pcap .\TestResults\ptp-validation.pcap
- name: Upload test results
if: always()
uses: actions/upload-artifact@v4
with:
name: test-results-${{ matrix.configuration }}
path: TestResults