MSBuild #307
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# For documentation on the github environment, see | |
# https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners | |
# | |
# For documentation on the syntax of this file, see | |
# https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions | |
name: MSBuild | |
on: | |
schedule: | |
- cron: '00 21 * * *' | |
pull_request: | |
push: | |
branches: [ main ] | |
concurrency: | |
# Cancel any CI/CD workflow currently in progress for the same PR. | |
# Allow running concurrently with any other commits. | |
group: cicd-${{ github.event.pull_request.number || github.sha }} | |
cancel-in-progress: true | |
jobs: | |
build: | |
strategy: | |
matrix: | |
configurations: [Debug, Release] | |
runs-on: windows-2022 | |
env: | |
# Solution file names. | |
DEMO_SOLUTION_FILE: ebpf-for-windows-demo.sln | |
# Configuration type to build. | |
# You can convert this to a build matrix if you need coverage of multiple configuration types. | |
# https://docs.github.com/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix | |
BUILD_CONFIGURATION: ${{matrix.configurations}} | |
BUILD_PLATFORM: x64 | |
steps: | |
- uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c | |
with: | |
submodules: 'recursive' | |
- name: Add MSBuild to PATH | |
uses: microsoft/setup-msbuild@becb80cf9a036187bb1e07e74eb64e25850d757a | |
- name: Install ProcDump64 | |
working-directory: ${{env.GITHUB_WORKSPACE}} | |
run: | | |
curl -fsSL -o Procdump.zip https://download.sysinternals.com/files/Procdump.zip | |
7z x Procdump.zip -y -o"C:/Program Files/ProcDump" | |
echo "C:\Program Files\ProcDump" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append | |
mkdir c:/dumps/${{env.BUILD_PLATFORM}}/${{env.BUILD_CONFIGURATION}} | |
echo "test" > c:/dumps/${{env.BUILD_PLATFORM}}/${{env.BUILD_CONFIGURATION}}/test.txt | |
- name: Set AeDebug registry key | |
working-directory: c:/dumps/${{env.BUILD_PLATFORM}}/${{env.BUILD_CONFIGURATION}} | |
run: | | |
procdump64.exe -accepteula -i -r -ma c:/dumps/${{env.BUILD_PLATFORM}}/${{env.BUILD_CONFIGURATION}} | |
- name: Install LLVM and Clang | |
working-directory: ${{env.GITHUB_WORKSPACE}} | |
run: | | |
curl -fsSL -o LLVM11.exe https://github.com/llvm/llvm-project/releases/download/llvmorg-11.1.0/LLVM-11.1.0-win64.exe | |
7z x LLVM11.exe -y -o"C:/Program Files/LLVM" | |
echo "C:\Program Files\LLVM\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append | |
- name: Cache nuget packages | |
uses: actions/cache@6998d139ddd3e68c71e9e398d8e40b71a2f39812 | |
env: | |
cache-name: cache-nuget-modules | |
with: | |
path: packages | |
key: ${{ runner.os }}-${{env.BUILD_PLATFORM}}-${{env.BUILD_CONFIGURATION}}-${{env.BUILD_ARTIFACT_NAME}}-${{ hashFiles('**/packages.config') }} | |
- name: Restore NuGet packages for ebpf-for-windows-demo | |
working-directory: ${{env.GITHUB_WORKSPACE}} | |
run: | | |
nuget restore ${{env.DEMO_SOLUTION_FILE}} | |
- name: Configure eBPF store | |
id: configure_ebpf_store | |
working-directory: ${{env.GITHUB_WORKSPACE}} | |
run: | | |
packages\eBPF-for-Windows.0.5.0\build\native\bin\export_program_info.exe --clear | |
packages\eBPF-for-Windows.0.5.0\build\native\bin\export_program_info.exe | |
- name: Create catch2 project for ebpf-for-windows-demo | |
working-directory: ${{env.GITHUB_WORKSPACE}} | |
run: | | |
cmake -G "Visual Studio 17 2022" -S external\catch2 -B external\catch2\build -DBUILD_TESTING=OFF | |
- name: Build eBPF-for-Windows-Demo | |
working-directory: ${{env.GITHUB_WORKSPACE}} | |
# Add additional options to the MSBuild command line here (like platform or verbosity level). | |
# See https://docs.microsoft.com/visualstudio/msbuild/msbuild-command-line-reference | |
run: | | |
msbuild /m /p:Configuration=${{env.BUILD_CONFIGURATION}} /p:Platform=${{env.BUILD_PLATFORM}} /p:Analysis='True' ${{env.DEMO_SOLUTION_FILE}} | |
- name: Upload Build Output | |
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce | |
with: | |
name: Build x64 ${{ matrix.configurations }} | |
path: ${{ github.workspace }}/${{env.BUILD_PLATFORM}}/${{env.BUILD_CONFIGURATION}} | |
retention-days: 5 | |
# Upload Cilium demo artifacts only for 'schedule' and 'push' | |
- name: Upload Compiled Cilium XDP Files | |
if: github.event_name == 'schedule' || github.event_name == 'push' | |
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce | |
with: | |
name: x64-${{ matrix.configurations }}-cilium-xdp | |
path: ${{ github.workspace }}/${{env.BUILD_PLATFORM}}/${{env.BUILD_CONFIGURATION}}/cilium/object/* | |
retention-days: 5 | |
# Run tests only for 'schedule' and 'pull_request' | |
- name: Run Cilium XDP Tests | |
if: github.event_name == 'schedule' || github.event_name == 'pull_request' | |
working-directory: ./${{env.BUILD_PLATFORM}}/${{env.BUILD_CONFIGURATION}} | |
run: ./cilium_test.exe -s |