# | |
# 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@407ffafae6a767df3e0230c3df91b6443ae8df75 | |
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\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 lock_ --test_file_directory ..\..\external\tests --plugin_path ubpf_plugin.exe --plugin_options --jit | |
if ($LastExitCode -ne 0) { throw "Test failed"; } | |
& $BPF_CONFORMANCE_RUNNER --exclude lock_ --test_file_directory ..\..\external\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@407ffafae6a767df3e0230c3df91b6443ae8df75 |