forked from rlane/ubpf
107 lines (90 loc) · 3.35 KB
/
windows.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
#
# Copyright (c) 2022-present, IO Visor Project
# All rights reserved.
#
# This source code is licensed in accordance with the terms specified in
# the LICENSE file found in the root directory of this source tree.
#
name: Windows
on:
workflow_call:
inputs:
platform:
required: true
type: string
build_type:
required: true
type: string
upload_packages:
required: true
type: boolean
build_codeql:
required: false
type: boolean
disable_retpolines:
required: false
type: boolean
jobs:
build:
runs-on: ${{ inputs.platform }}
steps:
- uses: actions/checkout@v4
with:
submodules: 'recursive'
- name: Initialize CodeQL
if: inputs.build_codeql == true
uses: github/codeql-action/init@d39d31e687223d841ef683f52467bd88e9b21c14
with:
languages: 'cpp'
- name: Configure uBPF
run: |
cmake `
-S . `
-B build `
-DUBPF_ENABLE_TESTS=true `
-DUBPF_DISABLE_RETPOLINES=${{ inputs.disable_retpolines }} `
-DUBPF_ENABLE_INSTALL=true
- name: Build uBPF
run: |
cmake `
--build build `
--config ${{ inputs.build_type }}
# Switch this to Docker when a Windows image is available.
- name: Run the bpf_conformance tests (Windows)
run: |
cd .\build\bin\${{ inputs.build_type }}
$BPF_CONFORMANCE_RUNNER = "..\..\external\bpf_conformance\bin\${{ inputs.build_type }}\bpf_conformance_runner.exe"
& $BPF_CONFORMANCE_RUNNER --test_file_directory ..\tests --plugin_path ubpf_plugin.exe --plugin_options --jit
if ($LastExitCode -ne 0) { throw "Test failed"; }
& $BPF_CONFORMANCE_RUNNER --test_file_directory ..\tests --plugin_path ubpf_plugin.exe --plugin_options --interpret
if ($LastExitCode -ne 0) { throw "Test failed"; }
& $BPF_CONFORMANCE_RUNNER --exclude_regex lock_ --test_file_directory ..\..\external\bpf_conformance\tests --plugin_path ubpf_plugin.exe --plugin_options --jit
if ($LastExitCode -ne 0) { throw "Test failed"; }
& $BPF_CONFORMANCE_RUNNER --exclude_regex lock_ --test_file_directory ..\..\external\bpf_conformance\tests --plugin_path ubpf_plugin.exe --plugin_options --interpret
if ($LastExitCode -ne 0) { throw "Test failed"; }
- name: Generate the TGZ package
run: |
cmake `
-S . `
-B build `
-DUBPF_ENABLE_PACKAGE=true `
-DCPACK_GENERATOR=TGZ
cmake `
--build build `
--target package
- name: Locate the packages
id: package_locations
if: inputs.upload_packages == true
shell: bash
run: |
echo "REL_TGZ_PACKAGE_PATH=$(ls build/*.tar.gz)" >> $GITHUB_OUTPUT
- name: Upload the Windows TGZ package
if: inputs.upload_packages == true
uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32
with:
name: windows_tgz_package
path: ${{ steps.package_locations.outputs.REL_TGZ_PACKAGE_PATH }}
retention-days: 5
- name: Perform CodeQL Analysis
if: inputs.build_codeql == true
uses: github/codeql-action/analyze@d39d31e687223d841ef683f52467bd88e9b21c14