Skip to content

MSBuild

MSBuild #1096

Workflow file for this run

# 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@b4ffde65f46336ab88eb53be808477a3936bae11
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@704facf57e6136b1bc63b828d79edcd491f0ee84
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: 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: 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.11.0\build\native\bin\export_program_info.exe --clear
packages\eBPF-for-Windows.0.11.0\build\native\bin\export_program_info.exe
- 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@5d5d22a31266ced268874388b861e4b58bb5c2f3
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@5d5d22a31266ced268874388b861e4b58bb5c2f3
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'
# Re-enable this tests once next version of eBPF-for-Windows is released.
# Tracked by GitHub issue #91
# - 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