-
Notifications
You must be signed in to change notification settings - Fork 15
120 lines (114 loc) · 3.92 KB
/
xdp.yml
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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
name: XDP
on:
workflow_dispatch:
inputs:
ref:
required: false
default: ''
type: string
repository_dispatch:
types: [run-xdp]
# Args: { guid, sha, ref, pr }
concurrency:
group: xdp-${{ github.event.client_payload.pr || github.event.client_payload.sha }}
cancel-in-progress: true
permissions: read-all
jobs:
# For automated identification of the workflow.
name:
name: For ${{ github.event.client_payload.guid }}
needs: []
runs-on: ubuntu-20.04
steps:
- run: echo "no op"
build:
name: Build Windows
needs: []
strategy:
fail-fast: false
matrix:
os: ['2022']
platform: [x64]
runs-on: windows-${{ matrix.os }}
steps:
- name: Checkout repository
uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac
with:
repository: microsoft/xdp-for-windows
ref: ${{ github.event.client_payload.sha || github.event.client_payload.ref || inputs.ref || 'main' }}
submodules: recursive
- name: Setup MSBuild.exe
uses: microsoft/setup-msbuild@ab534842b4bdf384b8aaf93765dc6f721d9f5fab
- name: Prepare Machine
shell: PowerShell
run: tools/prepare-machine.ps1 -ForBuild -Verbose
- name: Install LLVM 11.0
run: |
choco install -y llvm --version 11.0.1 --allow-downgrade
echo "C:\Program Files\LLVM\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
- name: Nuget Restore
run: nuget.exe restore xdp.sln -ConfigFile src/nuget.config
- name: Prepare for compiling eBPF programs
run: tools/prepare-machine.ps1 -ForEbpfBuild -Verbose
- name: Build
run: msbuild xdp.sln /m /p:configuration=Release /p:platform=${{ matrix.platform }}
- name: Sign Binaries
shell: PowerShell
run: tools/sign.ps1 -Config Release -Arch ${{ matrix.platform }}
- name: Build Installer
shell: PowerShell
run: tools/create-installer.ps1 -Config Release -Platform ${{ matrix.platform }}
- name: Filter Artifacts
shell: pwsh
run: |
$src = "artifacts/bin/${{ matrix.platform }}_Release"
$dest = "artifacts/bin2/${{ matrix.platform }}_Release"
mkdir $dest | Out-Null
copy -Recurse $src/xdp $dest
copy -Recurse $src/xdpinstaller $dest
copy $src/xdppcw.man $dest
copy $src/xdp.pdb $dest
copy $src/xdpapi.pdb $dest
copy $src/pktcmd.exe $dest
copy $src/pktcmd.pdb $dest
copy $src/xskbench.exe $dest
copy $src/xskbench.pdb $dest
- name: Upload Artifacts
uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32
with:
name: bin_Release_${{ matrix.os }}_${{ matrix.platform }}
path: artifacts/bin2
test:
name: Test Windows
needs: [build]
strategy:
fail-fast: false
matrix:
os: ['2022']
arch: [x64]
runs-on:
- self-hosted
- "windows"
- ${{ matrix.arch }}
- "azure"
steps:
- name: Checkout repository
uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac
with:
repository: microsoft/xdp-for-windows
ref: ${{ github.event.client_payload.sha || github.event.client_payload.ref || inputs.ref || 'main' }}
sparse-checkout: tools
- name: Download Artifacts
uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a
with:
name: bin_Release_${{ matrix.os }}_${{ matrix.arch }}
path: artifacts/bin
- name: Run Tests
shell: pwsh
run: tools/two-machine-perf.ps1 -Config Release -Arch ${{ matrix.arch }}
- name: Upload Logs
if: ${{ always() }}
uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32
with:
name: logs_Release_${{ matrix.os }}_${{ matrix.arch }}
path: artifacts/logs