Skip to content

run-xdp

run-xdp #158

Workflow file for this run

name: XDP
on:
workflow_dispatch:
inputs:
ref:
description: 'XDP Branch or Commit'
required: false
default: 'main'
type: string
pull_request:
branches:
- main
paths:
- .github/workflows/xdp.yml
repository_dispatch:
types: [run-xdp]
# Args: { guid, sha, ref, pr }
concurrency:
group: xdp-${{ github.event.client_payload.pr || github.event.client_payload.sha || inputs.ref || github.event.pull_request.number || 'main' }}
cancel-in-progress: true
permissions: read-all
jobs:
# For automated identification of the workflow.
name:
name: For ${{ github.event.client_payload.guid }}
if: ${{ github.event_name == 'repository_dispatch' }}
needs: []
runs-on: ubuntu-20.04
steps:
- run: |
echo "guid: ${{ github.event.client_payload.guid }}"
echo "sha: ${{ github.event.client_payload.sha }}"
echo "ref: ${{ github.event.client_payload.ref }}"
echo "pr: ${{ github.event.client_payload.pr }}"
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@b4ffde65f46336ab88eb53be808477a3936bae11
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@5d5d22a31266ced268874388b861e4b58bb5c2f3
with:
name: bin_Release_${{ matrix.os }}_${{ matrix.platform }}
path: artifacts/bin2
test:
name: Test Windows
needs: [build]
strategy:
fail-fast: false
matrix:
vec: [
{ env: "azure", os: "2022", arch: "x64" },
{ env: "azure", os: "2025", arch: "x64" },
{ env: "lab", os: "2022", arch: "x64" },
]
runs-on:
- self-hosted
- ${{ matrix.vec.env }}
- os-windows-${{ matrix.vec.os }}
- ${{ matrix.vec.arch }}
steps:
- name: Checkout repository
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
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@eaceaf801fd36c7dee90939fad912460b18a1ffe
with:
name: bin_Release_2022_${{ matrix.vec.arch }} # Build always comes from 2022 for now
path: artifacts/bin
- name: Run Tests
shell: pwsh
run: tools/two-machine-perf.ps1 -Config Release -Arch ${{ matrix.vec.arch }}
- name: Upload Logs
if: ${{ always() }}
uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3
with:
name: logs_${{ matrix.vec.env }}_${{ matrix.vec.os }}_${{ matrix.vec.arch }}
path: artifacts/logs