forked from microsoft/ebpf-for-windows-demo
-
Notifications
You must be signed in to change notification settings - Fork 0
119 lines (101 loc) · 4.93 KB
/
cicd.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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
# 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