clang warning fixes #46
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
name: Build and test | |
on: [push, pull_request] | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} | |
cancel-in-progress: true | |
permissions: | |
contents: read | |
pull-requests: write | |
jobs: | |
ubuntu-build: | |
name: Build - Ubuntu | |
strategy: | |
matrix: | |
os: ['ubuntu-20.04', 'ubuntu-22.04'] | |
build_type: [Debug, Release] | |
compiler: [{c: gcc, cxx: g++}] | |
libbacktrace: ['-DVAL_USE_LIBBACKTRACE_BACKTRACE=OFF'] | |
pool_tracking: ['-DUMF_ENABLE_POOL_TRACKING=ON', '-DUMF_ENABLE_POOL_TRACKING=OFF'] | |
include: | |
- os: 'ubuntu-22.04' | |
build_type: Release | |
compiler: {c: clang, cxx: clang++} | |
libbacktrace: '-DVAL_USE_LIBBACKTRACE_BACKTRACE=OFF' | |
- os: 'ubuntu-22.04' | |
build_type: Release | |
compiler: {c: gcc, cxx: g++} | |
libbacktrace: '-DVAL_USE_LIBBACKTRACE_BACKTRACE=ON' | |
- os: 'ubuntu-22.04' | |
build_type: Release | |
compiler: {c: clang, cxx: clang++} | |
libbacktrace: '-DVAL_USE_LIBBACKTRACE_BACKTRACE=ON' | |
- os: 'ubuntu-20.04' | |
build_type: Release | |
compiler: {c: gcc-7, cxx: g++-7} | |
runs-on: ${{matrix.os}} | |
steps: | |
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 | |
- name: Install apt packages | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y doxygen ${{matrix.compiler.c}} | |
- name: Install libhwloc | |
run: .github/scripts/install_hwloc.sh | |
- name: Install g++-7 | |
if: matrix.compiler.cxx == 'g++-7' | |
run: | | |
sudo apt-get install -y ${{matrix.compiler.cxx}} | |
- name: Install pip packages | |
run: pip install -r third_party/requirements.txt | |
- name: Install libbacktrace | |
if: matrix.libbacktrace == '-DVAL_USE_LIBBACKTRACE_BACKTRACE=ON' | |
run: | | |
git clone https://github.com/ianlancetaylor/libbacktrace.git | |
cd libbacktrace | |
./configure | |
make | |
sudo make install | |
cd .. | |
- name: Download DPC++ | |
if: matrix.os == 'ubuntu-22.04' | |
run: | | |
sudo apt install libncurses5 | |
wget -O ${{github.workspace}}/dpcpp_compiler.tar.gz https://github.com/intel/llvm/releases/download/nightly-2024-01-29/sycl_linux.tar.gz | |
mkdir -p ${{github.workspace}}/dpcpp_compiler | |
tar -xvf ${{github.workspace}}/dpcpp_compiler.tar.gz -C ${{github.workspace}}/dpcpp_compiler | |
- name: Configure CMake | |
if: matrix.os == 'ubuntu-22.04' | |
run: > | |
cmake | |
-B${{github.workspace}}/build | |
-DCMAKE_C_COMPILER=${{matrix.compiler.c}} | |
-DCMAKE_CXX_COMPILER=${{matrix.compiler.cxx}} | |
-DUR_ENABLE_TRACING=ON | |
-DCMAKE_BUILD_TYPE=${{matrix.build_type}} | |
-DUR_BUILD_TESTS=ON | |
-DUR_FORMAT_CPP_STYLE=ON | |
-DUR_DPCXX=${{github.workspace}}/dpcpp_compiler/bin/clang++ | |
${{matrix.libbacktrace}} | |
${{matrix.pool_tracking}} | |
- name: Configure CMake | |
if: matrix.os == 'ubuntu-20.04' | |
run: > | |
cmake | |
-B${{github.workspace}}/build | |
-DCMAKE_C_COMPILER=${{matrix.compiler.c}} | |
-DCMAKE_CXX_COMPILER=${{matrix.compiler.cxx}} | |
-DUR_ENABLE_TRACING=ON | |
-DCMAKE_BUILD_TYPE=${{matrix.build_type}} | |
-DUR_BUILD_TESTS=ON | |
-DUR_FORMAT_CPP_STYLE=ON | |
${{matrix.libbacktrace}} | |
${{matrix.pool_tracking}} | |
- name: Generate source from spec, check for uncommitted diff | |
if: matrix.os == 'ubuntu-22.04' | |
run: cmake --build ${{github.workspace}}/build --target check-generated | |
- name: Verify that each source file contains a license | |
run: cmake --build ${{github.workspace}}/build --target verify-licenses | |
- name: Build | |
run: cmake --build ${{github.workspace}}/build -j $(nproc) | |
- name: Test | |
working-directory: ${{github.workspace}}/build | |
run: ctest -C ${{matrix.build_type}} --output-on-failure -L "umf|loader|validation|tracing|unit|urtrace" | |
fuzztest-build: | |
name: Build and run quick fuzztest scenarios | |
strategy: | |
matrix: | |
build_type: [Debug, Release] | |
compiler: [{c: clang, cxx: clang++}] | |
runs-on: 'ubuntu-22.04' | |
steps: | |
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 | |
- name: Install pip packages | |
run: pip install -r third_party/requirements.txt | |
- name: Install apt packages | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y libhwloc-dev | |
- name: Download DPC++ | |
run: | | |
sudo apt install libncurses5 | |
wget -O ${{github.workspace}}/dpcpp_compiler.tar.gz https://github.com/intel/llvm/releases/download/sycl-nightly%2F20230626/dpcpp-compiler.tar.gz | |
tar -xvf ${{github.workspace}}/dpcpp_compiler.tar.gz | |
- name: Setup DPC++ | |
run: | | |
source ${{github.workspace}}/dpcpp_compiler/startup.sh | |
- name: Configure CMake | |
run: > | |
cmake | |
-B${{github.workspace}}/build | |
-DCMAKE_C_COMPILER=${{matrix.compiler.c}} | |
-DCMAKE_CXX_COMPILER=${{matrix.compiler.cxx}} | |
-DUR_ENABLE_TRACING=ON | |
-DCMAKE_BUILD_TYPE=${{matrix.build_type}} | |
-DUR_BUILD_TESTS=ON | |
-DUR_USE_ASAN=ON | |
-DUR_USE_UBSAN=ON | |
-DUR_DPCXX=${{github.workspace}}/dpcpp_compiler/bin/clang++ | |
- name: Build | |
run: cmake --build ${{github.workspace}}/build -j $(nproc) | |
- name: Fuzz test | |
working-directory: ${{github.workspace}}/build | |
run: ctest -C ${{matrix.build_type}} --output-on-failure -L "fuzz-short" --verbose | |
level-zero: | |
name: Level Zero | |
uses: ./.github/workflows/build-hw-reusable.yml | |
with: | |
name: L0 | |
opencl: | |
name: OpenCL | |
uses: ./.github/workflows/build-hw-reusable.yml | |
with: | |
name: OPENCL | |
platform: "Intel(R) OpenCL" | |
cuda: | |
name: CUDA | |
uses: ./.github/workflows/build-hw-reusable.yml | |
with: | |
name: CUDA | |
hip: | |
name: HIP | |
uses: ./.github/workflows/build-hw-reusable.yml | |
with: | |
name: HIP | |
native-cpu: | |
name: Native CPU | |
uses: ./.github/workflows/build-hw-reusable.yml | |
with: | |
name: NATIVE_CPU | |
e2e-level-zero: | |
name: E2E L0 | |
permissions: | |
contents: read | |
pull-requests: write | |
needs: [ubuntu-build, level-zero] | |
uses: ./.github/workflows/e2e_level_zero.yml | |
e2e-opencl: | |
name: E2E OpenCL | |
permissions: | |
contents: read | |
pull-requests: write | |
needs: [ubuntu-build, opencl] | |
uses: ./.github/workflows/e2e_opencl.yml | |
e2e-cuda: | |
name: E2E CUDA | |
permissions: | |
contents: read | |
pull-requests: write | |
needs: [ubuntu-build, cuda] | |
uses: ./.github/workflows/e2e_cuda.yml | |
windows-build: | |
name: Build - Windows | |
strategy: | |
matrix: | |
os: ['windows-2019', 'windows-2022'] | |
adapter: [ | |
{name: None, var: ''}, {name: L0, var: '-DUR_BUILD_ADAPTER_L0=ON'} | |
] | |
# TODO: building level zero loader on windows-2019 and clang-cl is currently broken | |
exclude: | |
- os: 'windows-2019' | |
adapter: {name: L0, var: '-DUR_BUILD_ADAPTER_L0=ON'} | |
- adapter: {name: L0, var: '-DUR_BUILD_ADAPTER_L0=ON'} | |
compiler: {c: clang-cl, cxx: clang-cl} | |
# TODO: testing is flaky on windows-2022 in Release mode | |
- os: 'windows-2022' | |
build_type: Release | |
build_type: [Debug, Release] | |
compiler: [{c: cl, cxx: cl}, {c: clang-cl, cxx: clang-cl}] | |
include: | |
- compiler: {c: clang-cl, cxx: clang-cl} | |
toolset: "-T ClangCL" | |
runs-on: ${{matrix.os}} | |
steps: | |
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 | |
- uses: actions/setup-python@0a5c61591373683505ea898e09a3ea4f39ef2b9c # v5.0.0 | |
with: | |
python-version: 3.9 | |
- name: Install prerequisites | |
run: python3 -m pip install -r third_party/requirements.txt | |
- name: Install doxygen | |
run: | | |
$WorkingDir = $PWD.Path | |
Invoke-WebRequest -Uri https://github.com/doxygen/doxygen/releases/download/Release_1_9_8/doxygen-1.9.8.windows.x64.bin.zip -OutFile "$WorkingDir\doxygen.zip" | |
Expand-Archive -Path "$WorkingDir\doxygen.zip" | |
Add-Content $env:GITHUB_PATH "$WorkingDir\doxygen" | |
- name: Install hwloc | |
run: vcpkg install hwloc:x64-windows | |
- name: Configure CMake | |
env: | |
VCPKG_PATH: "C:/vcpkg/packages/hwloc_x64-windows" | |
run: > | |
cmake | |
-B${{github.workspace}}/build | |
${{matrix.toolset}} | |
-DCMAKE_PREFIX_PATH="${{env.VCPKG_PATH}}" | |
-DCMAKE_C_COMPILER=${{matrix.compiler.c}} | |
-DCMAKE_CXX_COMPILER=${{matrix.compiler.cxx}} | |
-DCMAKE_POLICY_DEFAULT_CMP0094=NEW | |
-DUR_ENABLE_TRACING=ON | |
-DUR_DEVELOPER_MODE=ON | |
-DUR_BUILD_TESTS=ON | |
-DUR_FORMAT_CPP_STYLE=ON | |
${{matrix.adapter.var}} | |
# TODO: re-enable when check-generated is fixed for windows runners see #888 | |
# - name: Generate source from spec, check for uncommitted diff | |
# if: matrix.os == 'windows-2022' | |
# run: cmake --build ${{github.workspace}}/build --target check-generated --config ${{matrix.build_type}} | |
- name: Build all | |
run: cmake --build ${{github.workspace}}/build --config ${{matrix.build_type}} -j $Env:NUMBER_OF_PROCESSORS | |
- name: Test | |
working-directory: ${{github.workspace}}/build | |
run: ctest -C ${{matrix.build_type}} --output-on-failure -L "umf|loader|validation|tracing|unit|urtrace" | |
macos-build: | |
name: Build - MacOS | |
strategy: | |
matrix: | |
os: ['macos-12', 'macos-13'] | |
runs-on: ${{matrix.os}} | |
steps: | |
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 | |
- uses: actions/setup-python@0a5c61591373683505ea898e09a3ea4f39ef2b9c # v5.0.0 | |
with: | |
python-version: 3.9 | |
- name: Install prerequisites | |
run: python3 -m pip install -r third_party/requirements.txt | |
- name: Install hwloc | |
run: brew install hwloc | |
- name: Configure CMake | |
run: > | |
cmake | |
-B${{github.workspace}}/build | |
-DUR_ENABLE_TRACING=ON | |
-DUR_DEVELOPER_MODE=ON | |
-DCMAKE_BUILD_TYPE=Release | |
-DUR_BUILD_TESTS=ON | |
-DUR_FORMAT_CPP_STYLE=ON | |
-DUMF_ENABLE_POOL_TRACKING=ON | |
- name: Build | |
run: cmake --build ${{github.workspace}}/build -j $(sysctl -n hw.logicalcpu) |