Skip to content

ci: Build cu132 wheels using PyTorch 2.12.0.dev nightly #1972

ci: Build cu132 wheels using PyTorch 2.12.0.dev nightly

ci: Build cu132 wheels using PyTorch 2.12.0.dev nightly #1972

Workflow file for this run

name: C++ Testing
on: # yamllint disable-line rule:truthy
push:
branches:
- master
pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}-${{ startsWith(github.ref, 'refs/pull/') || github.run_number }} # yamllint disable-line
# Only cancel intermediate builds if on a PR:
cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }}
jobs:
gtest:
runs-on: ubuntu-22.04
steps:
- name: Checkout repostiory
uses: actions/checkout@v6
with:
submodules: recursive
- name: Setup packages
uses: ./.github/actions/setup
- name: Configure MKL
run: |
mkdir build
cd build
# TODO: Support building with MKL and CXX11 ABI
if [ `python -c 'import torch;print(torch.compiled_with_cxx11_abi())'` = "False" ]; then
export MKL_VERSION=`python ../tools/print_mkl_version.py`
uv pip install --no-cache-dir mkl-include==${MKL_VERSION} mkl-static==${MKL_VERSION}
export _BLAS_INCLUDE_DIR=`python -c 'import os;import sysconfig;data=sysconfig.get_path("data");print(f"{data}{os.sep}include")'`
export MKL_DIR=`python -c 'import os;import sysconfig;data=sysconfig.get_path("data");print(f"{data}{os.sep}lib{os.sep}cmake{os.sep}mkl")'`
Torch_DIR=`python -c 'import torch;print(torch.utils.cmake_prefix_path)'` cmake .. -GNinja -DBUILD_TEST=ON -DWITH_COV=ON -DCMAKE_BUILD_TYPE=DEBUG -DUSE_MKL_BLAS=ON -DBLAS_INCLUDE_DIR=$_BLAS_INCLUDE_DIR -DMKL_DIR=${MKL_DIR}
unset _BLAS_INCLUDE_DIR
else
Torch_DIR=`python -c 'import torch;print(torch.utils.cmake_prefix_path)'` cmake .. -GNinja -DBUILD_TEST=ON -DWITH_COV=ON -DCMAKE_BUILD_TYPE=DEBUG
fi
cd ..
- name: Build
run: |
cd build
cmake --build .
cd ..
- name: Run tests
run: |
cd build
ctest --verbose --output-on-failure
cd ..
- name: Collect coverage
run: |
sudo apt-get install lcov
lcov --directory . --capture --output-file .coverage.info
lcov --remove .coverage.info '*/test/*' --output-file .coverage.info
- name: Upload coverage
uses: codecov/codecov-action@v5
with:
files: .coverage.info
fail_ci_if_error: false