Skip to content

build and test Debug and Release configs in single job #1

build and test Debug and Release configs in single job

build and test Debug and Release configs in single job #1

Workflow file for this run

# This workflow builds and tests providers using GPU memory. It requires properly
# labelled self-hosted runners on systems with the correct GPU and drivers.
name: GPU
on:
workflow_call:
inputs:
provider:
description: Provider name
type: string
required: true
runner:
description: Runner name (without 'DSS-' prefix)
type: string
required: true
os:
description: A list of OSes
type: string
default: "['Ubuntu', 'Windows']"
shared_lib:
description: A list of options for building shared library
type: string
default: "['ON', 'OFF']"
permissions:
contents: read
env:
BUILD_DEBUG_DIR : "${{github.workspace}}/debug/build"
BUILD_RELEASE_DIR : "${{github.workspace}}/release/build"
INSTL_DEBUG_DIR : "${{github.workspace}}/debug/install-dir"
INSTL_RELEASE_DIR : "${{github.workspace}}/release/install-dir"
COVERAGE_DIR : "${{github.workspace}}/coverage"
jobs:
gpu:
env:
VCPKG_PATH: "${{github.workspace}}/vcpkg/packages/hwloc_x64-windows;${{github.workspace}}/vcpkg/packages/tbb_x64-windows;${{github.workspace}}/vcpkg/packages/jemalloc_x64-windows;"
COVERAGE_NAME : "exports-coverage-${{inputs.provider}}-${{inputs.runner}}"
# run only on upstream; forks will not have the HW
if: github.repository == 'oneapi-src/unified-memory-framework'
strategy:
fail-fast: false
matrix:
shared_library: ${{ fromJSON(inputs.shared_lib)}}
os: ${{ fromJSON(inputs.os)}}
name: GPU (${{matrix.os}}, shared=${{matrix.shared_library}})
runs-on: ["DSS-${{inputs.runner}}", "DSS-${{matrix.os}}"]
steps:
# Set various build params based on OS
- name: "[Win] Establish build params"
if : ${{ matrix.os == 'Windows' }}
run: |
echo "C_COMPILER=cl" >> $env:GITHUB_ENV
echo "CXX_COMPILER=cl" >> $env:GITHUB_ENV
echo "PROCS=$Env:NUMBER_OF_PROCESSORS" >> $env:GITHUB_ENV
echo "EXTRA_CMAKE_PATH=$Env:CUDA_PATH" >> $env:GITHUB_ENV
- name: "[Lin] Establish build params"
if : ${{ matrix.os == 'Ubuntu' }}
run: |
echo "C_COMPILER=gcc" >> $GITHUB_ENV
echo "CXX_COMPILER=g++" >> $GITHUB_ENV
echo "PROCS=$(nproc)" >> $GITHUB_ENV
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
fetch-depth: 0

Check failure on line 71 in .github/workflows/reusable_gpu.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/reusable_gpu.yml

Invalid workflow file

You have an error in your yaml syntax on line 71
- name: [Lin] Get information about platform
if: matrix.os == 'Ubuntu'
run: .github/scripts/get_system_info.sh
- name: "[Win] Initialize vcpkg"
if: matrix.os == 'Windows'
uses: lukka/run-vcpkg@5e0cab206a5ea620130caf672fce3e4a6b5666a1 # v11.5
with:
vcpkgGitCommitId: ea2a964f9303270322cf3f2d51c265ba146c422d # 1.04.2025
vcpkgDirectory: ${{github.workspace}}/vcpkg
vcpkgJsonGlob: '**/vcpkg.json'
- name: "[Win] Install dependencies"
if: matrix.os == 'Windows'
run: vcpkg install --triplet x64-windows
# note: disable all providers except the one being tested
# '-DCMAKE_SUPPRESS_REGENERATION=ON' is the WA for the error: "CUSTOMBUILD : CMake error : Cannot restore timestamp"
- name: Configure build (Debug)
run: >
cmake
-DCMAKE_PREFIX_PATH="${{env.VCPKG_PATH}};${{env.EXTRA_CMAKE_PATH}}"
-B ${{env.BUILD_DEBUG_DIR}}
-DCMAKE_INSTALL_PREFIX="${{env.INSTL_DEBUG_DIR}}"
-DCMAKE_BUILD_TYPE=Debug
-DCMAKE_C_COMPILER=${{env.C_COMPILER}}
-DCMAKE_CXX_COMPILER=${{env.CXX_COMPILER}}
-DUMF_BUILD_SHARED_LIBRARY=${{matrix.shared_library}}
-DUMF_BUILD_BENCHMARKS=ON
-DUMF_BUILD_BENCHMARKS_MT=ON
-DUMF_BUILD_TESTS=ON
-DUMF_BUILD_GPU_TESTS=ON
-DUMF_BUILD_GPU_EXAMPLES=ON
-DUMF_DEVELOPER_MODE=ON
-DUMF_BUILD_LIBUMF_POOL_JEMALLOC=ON
-DUMF_BUILD_CUDA_PROVIDER=OFF
-DUMF_BUILD_LEVEL_ZERO_PROVIDER=OFF
-DUMF_BUILD_${{inputs.provider}}_PROVIDER=ON
-DUMF_TESTS_FAIL_ON_SKIP=ON
${{ matrix.os == 'Ubuntu' && '-DUMF_USE_COVERAGE=ON' || '' }}
${{ matrix.os == 'Windows' && '-DCMAKE_SUPPRESS_REGENERATION=ON' || '' }}
- name: Build UMF (Debug)
run: cmake --build ${{env.BUILD_DEBUG_DIR}} --config Debug -j ${{env.PROCS}}
- name: Run tests (Debug)
working-directory: ${{env.BUILD_DEBUG_DIR}}
run: ctest -C Debug --output-on-failure --test-dir test
- name: Run examples (Debug)
working-directory: ${{env.BUILD_DEBUG_DIR}}
run: ctest --output-on-failure --test-dir examples -C Debug
- name: Configure build (Release)
run: >
cmake
-DCMAKE_PREFIX_PATH="${{env.VCPKG_PATH}};${{env.EXTRA_CMAKE_PATH}}"
-B ${{env.BUILD_RELEASE_DIR}}
-DCMAKE_INSTALL_PREFIX="${{env.INSTL_RELEASE_DIR}}"
-DCMAKE_BUILD_TYPE=Release
-DCMAKE_C_COMPILER=${{env.C_COMPILER}}
-DCMAKE_CXX_COMPILER=${{env.CXX_COMPILER}}
-DUMF_BUILD_SHARED_LIBRARY=${{matrix.shared_library}}
-DUMF_BUILD_BENCHMARKS=ON
-DUMF_BUILD_BENCHMARKS_MT=ON
-DUMF_BUILD_TESTS=ON
-DUMF_BUILD_GPU_TESTS=ON
-DUMF_BUILD_GPU_EXAMPLES=ON
-DUMF_DEVELOPER_MODE=ON
-DUMF_BUILD_LIBUMF_POOL_JEMALLOC=ON
-DUMF_BUILD_CUDA_PROVIDER=OFF
-DUMF_BUILD_LEVEL_ZERO_PROVIDER=OFF
-DUMF_BUILD_${{inputs.provider}}_PROVIDER=ON
-DUMF_TESTS_FAIL_ON_SKIP=ON
${{ matrix.os == 'Windows' && '-DCMAKE_SUPPRESS_REGENERATION=ON' || '' }}
- name: Build UMF (Release)
run: cmake --build ${{env.BUILD_RELEASE_DIR}} --config Release -j ${{env.PROCS}}
- name: Run tests (Release)
working-directory: ${{env.BUILD_RELEASE_DIR}}
run: ctest -C Release --output-on-failure --test-dir test
- name: Run examples (Release)
working-directory: ${{env.BUILD_RELEASE_DIR}}
run: ctest --output-on-failure --test-dir examples -C Release
- name: Run benchmarks (Release)
working-directory: ${{env.BUILD_RELEASE_DIR}}
run: ctest --output-on-failure --test-dir benchmark -C Release --exclude-regex umf-multithreaded
- name: [Lin] Check coverage (Debug)
if: ${{ matrix.os == 'Ubuntu' }}
working-directory: ${{env.BUILD_DEBUG_DIR}}
run: |
export COVERAGE_FILE_NAME=${{env.COVERAGE_NAME}}-shared-${{matrix.shared_library}}
echo "COVERAGE_FILE_NAME: $COVERAGE_FILE_NAME"
${{github.workspace}}/scripts/coverage/coverage_capture.sh $COVERAGE_FILE_NAME
mkdir -p ${{env.COVERAGE_DIR}}
mv ./$COVERAGE_FILE_NAME ${{env.COVERAGE_DIR}}
- name: [Lin] Upload coverage
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
if: ${{ matrix.os == 'Ubuntu' }}
with:
name: ${{env.COVERAGE_NAME}}-shared-${{matrix.shared_library}}
path: ${{env.COVERAGE_DIR}}