-
Notifications
You must be signed in to change notification settings - Fork 42
87 lines (84 loc) · 2.59 KB
/
build.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
name: Build XDP
# The caller is responsible for making sure all options passed to this workflow are valid and compatible with each other.
on:
workflow_call:
inputs:
ref:
required: false
default: ''
type: string
config:
required: false
default: 'Release'
type: string
# options:
# - Debug
# - Release
os:
required: false
type: string
default: '2022'
# options:
# - 2019
# - 2022
platform:
required: false
default: 'x64'
type: string
# options:
# - x64
# - arm64
codeql:
required: false
default: false
type: boolean
artifact_path:
required: false
default: ''
type: string
jobs:
build:
name: Build ${{ inputs.platform}}_${{ inputs.config }}_${{ inputs.os }}
strategy:
fail-fast: false
runs-on: windows-${{ inputs.os }}
steps:
- name: Checkout repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
with:
repository: microsoft/xdp-for-windows
submodules: recursive
ref: ${{ inputs.ref }}
- name: Initialize CodeQL
if: inputs.codeql
uses: github/codeql-action/init@v3
with:
languages: c-cpp
- name: Setup MSBuild.exe
uses: microsoft/setup-msbuild@6fb02220983dee41ce7ae257b6f4d8f9bf5ed4ce
with:
msbuild-architecture: x64
- name: Prepare Machine
shell: PowerShell
run: tools/prepare-machine.ps1 -ForBuild -Verbose -Platform ${{ inputs.platform }}
- name: Nuget Restore
run: msbuild.exe xdp.sln /t:restore /p:RestoreConfigFile=src/nuget.config /p:Configuration=${{ inputs.config }} /p:Platform=${{ inputs.platform }}
- name: Prepare for compiling eBPF programs
run: tools/prepare-machine.ps1 -ForEbpfBuild -Verbose -Platform ${{ inputs.platform }}
- name: Build
run: msbuild xdp.sln /m /p:configuration=${{ inputs.config }} /p:platform=${{ inputs.platform }} /p:SignMode=TestSign /p:IsAdmin=true
- name: Upload Artifacts
if: inputs.artifact_path != ''
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882
with:
name: ${{inputs.artifact_path}}
path: |
artifacts/bin
!artifacts/bin/**/*.ilk
!artifacts/bin/**/*.exp
!artifacts/bin/**/*.lastcodeanalysissucceeded
- name: Perform CodeQL Analysis
if: inputs.codeql
uses: github/codeql-action/analyze@v3
with:
category: "/language:c-cpp"