Skip to content

CI

CI #1210

Workflow file for this run

name: CI
on:
push:
branches:
- main
- release/*
- prerelease/*
pull_request:
branches:
- main
- release/*
- prerelease/*
schedule:
- cron: '37 12 * * 2'
concurrency:
# Cancel any workflow currently in progress for the same PR.
# Allow running concurrently with any other commits.
group: ci-${{ github.event.pull_request.number || github.sha }}
cancel-in-progress: true
permissions: read-all
jobs:
build:
name: Build
strategy:
fail-fast: false
matrix:
# Some driver developers are building for WS2022 LTSC targets using VS2019 +
# the Windows Server 2022 WDK, so validate our project still builds in that
# environment, in addition to the default WS 2022.
os: [2019, 2022]
config: [Release, Debug]
arch: [x64]
permissions:
actions: read
contents: read
security-events: write # For CodeQL
uses: ./.github/workflows/build.yml
with:
config: ${{ matrix.config }}
os: ${{ matrix.os }}
arch: ${{ matrix.arch }}
codeql: ${{ github.event_name == 'schedule' }}
upload_artifacts: ${{ matrix.os == 2022 }}
publish_symbols: ${{ github.event_name != 'pull_request' && matrix.os == 2022 }}
secrets:
publish_symbols_pat: ${{ secrets.AZDO_PAT }}
functional_tests:
name: Functional Tests
needs: build
env:
# For 'main' commits
fullRuntime: 120 # minutes. Update timeout-minutes with any changes.
fullIters: 10
# For PRs
prRuntime: 15 # minutes. Update timeout-minutes with any changes.
prIters: 1
strategy:
fail-fast: false
matrix:
windows: [2019, 2022, Prerelease]
configuration: [Release, Debug]
platform: [x64]
runs-on:
- self-hosted
- "1ES.Pool=xdp-ci-functional-gh"
- "1ES.ImageOverride=WS${{ matrix.windows }}-Functional"
steps:
- name: Checkout repository
uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b
with:
sparse-checkout: tools
- name: Check Drivers
shell: PowerShell
run: tools/check-drivers.ps1 -Config ${{ matrix.configuration }} -Arch ${{ matrix.platform }} -Verbose
- name: Prepare Machine
shell: PowerShell
run: tools/prepare-machine.ps1 -ForFunctionalTest -NoReboot -Verbose
- name: Download Artifacts
uses: actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e
with:
name: bin_${{ matrix.configuration }}_${{ matrix.platform }}
path: artifacts/bin
- name: Run Tests (PR)
if: ${{ github.event_name == 'pull_request' }}
shell: PowerShell
timeout-minutes: 15
run: tools/functional.ps1 -Verbose -Config ${{ matrix.configuration }} -Arch ${{ matrix.platform }} -Iterations ${{ env.prIters }} -Timeout ${{ env.fullRuntime }}
- name: Run Tests (main)
if: ${{ github.event_name != 'pull_request' }}
shell: PowerShell
timeout-minutes: 120
run: tools/functional.ps1 -Verbose -Config ${{ matrix.configuration }} -Arch ${{ matrix.platform }} -Iterations ${{ env.fullIters }} -Timeout ${{ env.fullRuntime }}
- name: Convert Logs
if: ${{ always() }}
timeout-minutes: 5
shell: PowerShell
run: tools/log.ps1 -Convert -Name xdpfunc* -Verbose -Config ${{ matrix.configuration }} -Arch ${{ matrix.platform }}
- name: Upload Logs
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808
if: ${{ always() }}
with:
name: logs_func_win${{ matrix.windows }}_${{ matrix.configuration }}_${{ matrix.platform }}
path: artifacts/logs
- name: Check Drivers
if: ${{ always() }}
shell: PowerShell
run: tools/check-drivers.ps1 -Config ${{ matrix.configuration }} -Arch ${{ matrix.platform }} -Verbose
stress_tests:
name: Stress Tests
needs: build
env:
successThresholdPercent: 1
xdpmpPollProvider: 'FNDIS'
# For 'main' commits
fullRuntime: 60 # minutes. Update timeout-minutes with any changes.
# For PRs
prRuntime: 10 # minutes. Update timeout-minutes with any changes.
strategy:
fail-fast: false
matrix:
windows: [2019, 2022]
configuration: [Release, Debug]
platform: [x64]
timeout-minutes: 75 # Ideally this would be only 25 min for PR runs, but GitHub Actions don't support that.
runs-on:
- self-hosted
- "1ES.Pool=xdp-ci-spinxsk-gh"
- "1ES.ImageOverride=WS${{ matrix.windows }}-Spinxsk"
steps:
- name: Checkout repository
uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b
with:
sparse-checkout: tools
- name: Check Drivers
shell: PowerShell
run: tools/check-drivers.ps1 -Config ${{ matrix.configuration }} -Arch ${{ matrix.platform }} -Verbose
- name: Prepare Machine
shell: PowerShell
run: tools/prepare-machine.ps1 -ForSpinxskTest -NoReboot -Verbose
- name: Download Artifacts
uses: actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e
with:
name: bin_${{ matrix.configuration }}_${{ matrix.platform }}
path: artifacts/bin
- name: Run spinxsk (PR)
if: ${{ github.event_name == 'pull_request' }}
shell: PowerShell
timeout-minutes: 15
run: tools/spinxsk.ps1 -Verbose -Stats -Config ${{ matrix.configuration }} -Arch ${{ matrix.platform }} -Minutes ${{ env.prRuntime }} -XdpmpPollProvider ${{ env.xdpmpPollProvider }} -SuccessThresholdPercent ${{ env.successThresholdPercent }} -EnableEbpf
- name: Run spinxsk (main)
if: ${{ github.event_name != 'pull_request' }}
shell: PowerShell
timeout-minutes: 65
run: tools/spinxsk.ps1 -Verbose -Stats -Config ${{ matrix.configuration }} -Arch ${{ matrix.platform }} -Minutes ${{ env.fullRuntime }} -XdpmpPollProvider ${{ env.xdpmpPollProvider }} -SuccessThresholdPercent ${{ env.successThresholdPercent }} -EnableEbpf
- name: Convert Logs
if: ${{ always() }}
timeout-minutes: 5
shell: PowerShell
run: tools/log.ps1 -Convert -Name spinxsk -Verbose -Config ${{ matrix.configuration }} -Arch ${{ matrix.platform }}
- name: Upload Logs
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808
if: ${{ always() }}
with:
name: logs_stress_win${{ matrix.windows }}_${{ matrix.configuration }}_${{ matrix.platform }}
path: artifacts/logs
- name: Check Drivers
if: ${{ always() }}
shell: PowerShell
run: tools/check-drivers.ps1 -Config ${{ matrix.configuration }} -Arch ${{ matrix.platform }} -Verbose
pktfuzz_tests:
name: Fuzz Packet Parsing
needs: build
strategy:
fail-fast: false
matrix:
windows: [2022] # ASAN is currently buggy on Prerelease and 2019.
configuration: [Release, Debug]
platform: [x64]
runs-on:
- self-hosted
- "1ES.Pool=xdp-ci-fuzz-gh"
- "1ES.ImageOverride=WS${{ matrix.windows }}"
steps:
- name: Checkout repository
uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b
with:
sparse-checkout: tools
- name: Download Artifacts
uses: actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e
with:
name: bin_${{ matrix.configuration }}_${{ matrix.platform }}
path: artifacts/bin
- name: Run pktfuzz
shell: PowerShell
run: tools/pktfuzz.ps1 -Minutes 10 -Workers 8 -Config ${{ matrix.configuration }} -Arch ${{ matrix.platform }} -Verbose
- name: Upload Logs
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808
if: ${{ always() }}
with:
name: logs_pktfuzz_win${{ matrix.windows }}_${{ matrix.configuration }}_${{ matrix.platform }}
path: artifacts/logs
perf_tests:
name: Perf Tests
needs: build
strategy:
fail-fast: false
matrix:
windows: [2019, 2022, Prerelease]
configuration: [Release]
platform: [x64]
timeout-minutes: 75 # Ideally this would be only 25 min for PR runs, but GitHub Actions don't support that.
runs-on:
- self-hosted
- "1ES.Pool=xdp-ci-perf-gh"
- "1ES.ImageOverride=WS${{ matrix.windows }}"
steps:
- name: Checkout repository
uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b
with:
sparse-checkout: tools
- name: Check Drivers
shell: PowerShell
run: tools/check-drivers.ps1 -Config ${{ matrix.configuration }} -Arch ${{ matrix.platform }} -Verbose
- name: Prepare Machine
shell: PowerShell
run: tools/prepare-machine.ps1 -ForPerfTest -NoReboot -Verbose
- name: Download Artifacts
uses: actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e
with:
name: bin_${{ matrix.configuration }}_${{ matrix.platform }}
path: artifacts/bin
- name: Run xskperfsuite (Generic, Native)
shell: PowerShell
run: tools/xskperfsuite.ps1 -Verbose -Config ${{ matrix.configuration }} -Arch ${{ matrix.platform }} -Fndis -RawResultsFile "artifacts/logs/xskperfsuite.csv" -XperfDirectory "artifacts/logs" -CommitHash ${{ github.sha }}
- name: Run xskperfsuite (TX-inspect, RX-inject)
shell: PowerShell
run: tools/xskperfsuite.ps1 -Verbose -Config ${{ matrix.configuration }} -Arch ${{ matrix.platform }} -Fndis -XdpModes "Generic" -TxInspect -RxInject -RawResultsFile "artifacts/logs/xskperfsuite.csv" -XperfDirectory "artifacts/logs" -CommitHash ${{ github.sha }}
- name: Run xskperfsuite (Winsock, RIO)
shell: PowerShell
run: tools/xskperfsuite.ps1 -Verbose -Config ${{ matrix.configuration }} -Arch ${{ matrix.platform }} -Fndis -XdpModes "Winsock", "RIO" -Modes "RX", "TX" -RawResultsFile "artifacts/logs/xskperfsuite.csv" -XperfDirectory "artifacts/logs" -CommitHash ${{ github.sha }}
- name: Upload Logs
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808
if: ${{ always() }}
with:
name: logs_perf_win${{ matrix.windows }}_${{ matrix.configuration }}_${{ matrix.platform }}
path: artifacts/logs
- name: Check Drivers
if: ${{ always() }}
shell: PowerShell
run: tools/check-drivers.ps1 -Config ${{ matrix.configuration }} -Arch ${{ matrix.platform }} -Verbose
downlevel_functional_tests:
name: Downlevel Functional Tests
needs: build
env:
Runtime: 15 # minutes. Update timeout-minutes with any changes.
Iters: 1
strategy:
fail-fast: false
matrix:
downlevel_release: [1.0.2]
windows: [2019, 2022, Prerelease]
configuration: [Release]
platform: [x64]
runs-on:
- self-hosted
- "1ES.Pool=xdp-ci-functional-gh"
- "1ES.ImageOverride=WS${{ matrix.windows }}-Functional"
steps:
- name: Checkout repository
uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b
with:
sparse-checkout: tools
- name: Check Drivers
shell: PowerShell
run: tools/check-drivers.ps1 -Config ${{ matrix.configuration }} -Arch ${{ matrix.platform }} -Verbose
- name: Prepare Machine
shell: PowerShell
run: tools/prepare-machine.ps1 -ForFunctionalTest -NoReboot -Verbose -UseJitEbpf
- name: Download Artifacts
uses: actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e
with:
name: bin_${{ matrix.configuration }}_${{ matrix.platform }}
path: artifacts/bin
- name: Download Downlevel Tests
shell: PowerShell
run: |
Invoke-WebRequest -Uri "https://github.com/microsoft/xdp-for-windows/releases/download/v${{ matrix.downlevel_release }}/xdp-tests-${{ matrix.platform }}-${{ matrix.downlevel_release }}.zip" -OutFile "artifacts/downlevel-test.zip"
Expand-Archive -Path artifacts/downlevel-test.zip -DestinationPath artifacts/downlevel-test/${{ matrix.platform }}
Copy-Item -Path artifacts/downlevel-test/${{ matrix.platform }}/bin/* -Destination artifacts/bin/${{ matrix.platform }}_${{ matrix.configuration }}
- name: Run Tests
shell: PowerShell
timeout-minutes: 15
run: tools/functional.ps1 -Verbose -Config ${{ matrix.configuration }} -Arch ${{ matrix.platform }} -Iterations ${{ env.Iters }} -Timeout ${{ env.Runtime }} -UseJitEbpf
- name: Convert Logs
if: ${{ always() }}
timeout-minutes: 5
shell: PowerShell
run: tools/log.ps1 -Convert -Name xdpfunc* -Verbose -Config ${{ matrix.configuration }} -Arch ${{ matrix.platform }}
- name: Upload Logs
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808
if: ${{ always() }}
with:
name: logs_downlevel_${{ matrix.downlevel_release }}_win${{ matrix.windows }}_${{ matrix.configuration }}_${{ matrix.platform }}
path: artifacts/logs
- name: Check Drivers
if: ${{ always() }}
shell: PowerShell
run: tools/check-drivers.ps1 -Config ${{ matrix.configuration }} -Arch ${{ matrix.platform }} -Verbose
create_artifacts:
name: Create Release Artifacts
needs: build
strategy:
fail-fast: false
matrix:
configuration: [Release]
platform: [x64]
runs-on: windows-2022
steps:
- name: Checkout repository
uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b
- name: Download Artifacts
uses: actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e
with:
name: bin_${{ matrix.configuration }}_${{ matrix.platform }}
path: artifacts/bin
- name: Create Dev Kit
shell: PowerShell
run: tools/create-devkit.ps1 -Config ${{ matrix.configuration }} -Platform ${{ matrix.platform }}
- name: Create Test Archive
shell: PowerShell
run: tools/create-test-archive.ps1 -Config ${{ matrix.configuration }} -Platform ${{ matrix.platform }}
- name: Upload Release Artifacts
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808
with:
name: release_artifacts_${{ matrix.configuration }}_${{ matrix.platform }}
path: |
artifacts/kit/**/*.zip
artifacts/tests/**/*.zip
etw:
name: ETW Plugin
needs: []
runs-on: windows-latest
strategy:
fail-fast: false
matrix:
configuration: [Release, Debug]
permissions:
security-events: write # For CodeQL
steps:
- name: Checkout repository
uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b
- name: Initialize CodeQL
if: ${{ github.event_name == 'schedule' }}
uses: github/codeql-action/init@v3
with:
languages: csharp
- name: Setup .NET
uses: actions/setup-dotnet@4d6c8fcf3c8f7a60068d26b594648e99df24cee3
with:
dotnet-version: 6.0.x
- name: Prepare Machine
shell: PowerShell
run: tools/prepare-machine.ps1 -ForBuild -Verbose
- name: Build
run: dotnet build src\xdpetwplugin\xdpetwplugin.sln -c ${{ matrix.configuration }}
- uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808
with:
name: etw_${{ matrix.configuration }}
path: artifacts/bin
- name: Perform CodeQL Analysis
if: ${{ github.event_name == 'schedule' }}
uses: github/codeql-action/analyze@v3
with:
category: "/language:csharp"
netperf:
name: Run Perf
needs: []
runs-on: windows-latest
steps:
- name: Run NetPerf Workflow
shell: pwsh
run: |
$url = "https://raw.githubusercontent.com/microsoft/netperf/main/run-workflow.ps1"
if ('${{ secrets.NET_PERF_TRIGGER }}' -eq '') {
Write-Host "Not able to run because no secrets are available!"
return
}
iex "& { $(irm $url) } ${{ secrets.NET_PERF_TRIGGER }} xdp ${{ github.sha }} ${{ github.ref }} ${{ github.event.pull_request.number }}"
Complete:
name: Complete
needs: [build, functional_tests, stress_tests, pktfuzz_tests, perf_tests, downlevel_functional_tests, create_artifacts, etw, netperf]
runs-on: windows-latest
steps:
- run: echo "CI succeeded"