Report more warnings, summarize job output #792
Workflow file for this run
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: oneDPL CI Testing | |
on: | |
push: | |
branches: [main] | |
pull_request: | |
branches: | |
- main | |
- 'release/**' | |
paths: | |
- '.github/**/*' | |
- 'cmake/**/*' | |
- 'include/**/*' | |
- 'test/**/*' | |
- 'CMakeLists.txt' | |
- '.clang-format' | |
permissions: read-all | |
env: | |
BUILD_CONCURRENCY: 4 | |
MACOS_BUILD_CONCURRENCY: 3 | |
TEST_TIMEOUT: 360 | |
WINDOWS_TBB_DOWNLOAD_LINK: https://registrationcenter-download.intel.com/akdlm/IRC_NAS/18b6bbb1-7b63-4949-8488-ba2b14cebe12/intel-onetbb-2022.0.0.397_offline.exe | |
WINDOWS_ICPX_DOWNLOAD_LINK: https://registrationcenter-download.intel.com/akdlm/IRC_NAS/90492fdd-9cdc-4423-b9d2-c35de9510fd2/intel-dpcpp-cpp-compiler-2025.0.4.21_offline.exe | |
WINDOWS_ONEAPI_PATH: C:\Program Files (x86)\Intel\oneAPI | |
LINUX_ONEAPI_PATH: /opt/intel/oneapi | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | |
cancel-in-progress: ${{ !contains(github.ref, 'refs/heads/main') }} | |
jobs: | |
clang-format: | |
if: github.event_name == 'pull_request' | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
ref: ${{ github.event.pull_request.head.sha }} | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: '3.x' | |
- name: Get clang-format | |
run: sudo apt-get install -yqq clang-format | |
- name: Applying clang-format for changed files | |
run: | | |
MERGE_BASE=$(git merge-base ${{ github.event.pull_request.head.sha }} ${{ github.event.pull_request.base.sha }}) | |
FILES=$(git diff --diff-filter=d --name-only $MERGE_BASE | grep ^include | grep -v nanorange\.hpp\$ || true) | |
CLANG_FORMAT_DIFF_PATH=$(which clang-format-diff) | |
echo $FILES | xargs -n1 -t -r git diff -U0 --no-color --relative $MERGE_BASE | python3 $CLANG_FORMAT_DIFF_PATH -i -p1 -style file | |
if: github.event_name == 'pull_request' || github.event_name == 'push' | |
- name: Creating diff | |
run: git diff > clang-format.diff | |
- name: Checking if diff is empty | |
run: if [ -s clang-format.diff ]; then cat clang-format.diff; exit 1; fi | |
- if: failure() | |
name: Save artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: clang-format-diff | |
path: clang-format.diff | |
retention-days: 3 | |
linux-testing: | |
name: ${{ matrix.device_type }},bknd=${{ matrix.backend }},cmplr=${{ matrix.cxx_compiler }},${{ matrix.os }},std=с++${{ matrix.std }},cfg=${{ matrix.build_type }} | |
runs-on: ['${{ matrix.os }}'] | |
timeout-minutes: 60 | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- os: ubuntu-latest | |
cxx_compiler: icpx | |
std: 17 | |
build_type: release | |
backend: dpcpp | |
device_type: CPU | |
- os: ubuntu-latest | |
cxx_compiler: icpx | |
std: 17 | |
build_type: release | |
backend: dpcpp | |
device_type: FPGA_EMU | |
- os: ubuntu-latest | |
cxx_compiler: icpx | |
std: 17 | |
build_type: release | |
backend: tbb | |
device_type: HOST | |
- os: ubuntu-latest | |
cxx_compiler: icpx | |
std: 17 | |
build_type: release | |
backend: omp | |
device_type: HOST | |
- os: ubuntu-latest | |
cxx_compiler: g++ | |
std: 17 | |
build_type: release | |
backend: omp | |
device_type: HOST | |
- os: ubuntu-latest | |
cxx_compiler: g++ | |
std: 17 | |
build_type: release | |
backend: tbb | |
device_type: HOST | |
- os: ubuntu-latest | |
cxx_compiler: g++ | |
std: 17 | |
build_type: release | |
backend: tbb | |
device_type: HOST | |
- os: ubuntu-latest | |
cxx_compiler: clang++ | |
std: 17 | |
build_type: release | |
backend: tbb | |
device_type: HOST | |
- os: ubuntu-latest | |
cxx_compiler: clang++ | |
std: 17 | |
build_type: release | |
backend: omp | |
device_type: HOST | |
- os: ubuntu-latest | |
cxx_compiler: clang++ | |
std: 17 | |
build_type: release | |
backend: tbb | |
device_type: HOST | |
- os: ubuntu-latest | |
cxx_compiler: icpx | |
std: 17 | |
build_type: release | |
backend: tbb | |
device_type: HOST | |
- os: ubuntu-latest | |
cxx_compiler: g++ | |
std: 17 | |
build_type: release | |
backend: serial | |
device_type: HOST | |
- os: ubuntu-latest | |
cxx_compiler: icpx | |
std: 20 | |
build_type: release | |
backend: dpcpp | |
device_type: CPU | |
- os: ubuntu-latest | |
cxx_compiler: icpx | |
std: 20 | |
build_type: release | |
backend: tbb | |
device_type: HOST | |
- os: ubuntu-latest | |
cxx_compiler: icpx | |
std: 20 | |
build_type: release | |
backend: omp | |
device_type: HOST | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Intel APT repository | |
if: (matrix.backend == 'tbb' || matrix.backend == 'dpcpp' || matrix.cxx_compiler == 'icpx' || matrix.cxx_compiler == 'icx' || matrix.cxx_compiler == 'icx-cl' || matrix.cxx_compiler == 'dpcpp' || matrix.cxx_compiler == 'dpcpp-cl') | |
run: | | |
# https://www.intel.com/content/www/us/en/docs/oneapi/installation-guide-linux/2024-0/apt.html | |
wget -O- https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB \ | |
| gpg --dearmor | sudo tee /usr/share/keyrings/oneapi-archive-keyring.gpg > /dev/null | |
echo "deb [signed-by=/usr/share/keyrings/oneapi-archive-keyring.gpg] https://apt.repos.intel.com/oneapi all main" | sudo tee /etc/apt/sources.list.d/oneAPI.list | |
sudo apt-get update -y | |
- name: Install Intel® oneAPI Threading Building Blocks | |
if: (matrix.backend == 'tbb' || matrix.backend == 'dpcpp') | |
run: | | |
sudo apt-get install intel-oneapi-tbb-devel -y | |
- name: Install Intel® oneAPI DPC++/C++ Compiler | |
if: (matrix.cxx_compiler == 'icpx' || matrix.cxx_compiler == 'icx' || matrix.cxx_compiler == 'icx-cl' || matrix.cxx_compiler == 'dpcpp' || matrix.cxx_compiler == 'dpcpp-cl') | |
run: | | |
sudo apt-get install intel-oneapi-compiler-dpcpp-cpp -y | |
# Avoid accidental use of a released version, keeping libpstloffload.so | |
sudo rm -rf ${LINUX_ONEAPI_PATH}/dpl/latest/include | |
- name: Install Intel® oneAPI DPC++/C++ Compiler SYCL* FPGA Emulator Runtime | |
if: (matrix.device_type == 'FPGA_EMU') | |
run: | | |
sudo apt-get install intel-oneapi-compiler-fpga -y | |
- name: Install OpenMP dependencies | |
if: (matrix.os == 'ubuntu-latest' && matrix.cxx_compiler == 'clang++' && matrix.backend == 'omp') | |
run: | | |
sudo apt-get install libomp5 libomp-dev -y | |
- name: Run testing | |
shell: bash | |
run: | | |
set -x | |
if [[ -f "${LINUX_ONEAPI_PATH}/setvars.sh" ]]; then | |
source ${LINUX_ONEAPI_PATH}/setvars.sh | |
fi | |
if [[ "${{ matrix.backend }}" == "dpcpp" ]]; then | |
make_targets="build-onedpl-sycl_iterator-tests build-onedpl-ranges-tests" | |
ctest_flags="-R (sycl_iterator_.*)|(std_ranges_.*)\.pass" | |
else | |
make_targets="build-onedpl-tests" | |
fi | |
mkdir build && cd build | |
lscpu | |
cmake -DCMAKE_CXX_STANDARD=${{ matrix.std }} -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \ | |
-DCMAKE_CXX_COMPILER=${{ matrix.cxx_compiler }} -DONEDPL_BACKEND=${{ matrix.backend }} -DONEDPL_DEVICE_TYPE=${{ matrix.device_type }} -DCMAKE_CXX_FLAGS="-Wall" .. | |
make VERBOSE=1 -j${BUILD_CONCURRENCY} ${make_targets} |& tee build.log | |
ctest --timeout ${TEST_TIMEOUT} --output-on-failure ${ctest_flags} |& tee ctest.log | |
# Generate a summary | |
os_name=$(uname -a | head -n 1) | |
cmake_version=$(cmake --version | head -n 1) | |
compiler_version=$(${{ matrix.cxx_compiler }} --version | head -n 1) | |
cpu_model=$(lscpu | grep "Model name") | |
python ${GITHUB_WORKSPACE}/.github/scripts/job_summary.py --build-log build.log \ | |
--ctest-log ctest.log \ | |
--output-file summary.md \ | |
--os "${os_name}" \ | |
--cmake-version "${cmake_version}" \ | |
--compiler-version "${compiler_version}" \ | |
--cpu-model "${cpu_model}" | |
cat summary.md > $GITHUB_STEP_SUMMARY | |
windows-testing: | |
name: ${{ matrix.device_type }},bknd=${{ matrix.backend }},cmplr=${{ matrix.cxx_compiler }},${{ matrix.os }},std=c++${{ matrix.std }},cfg=${{ matrix.build_type }} | |
runs-on: ['${{ matrix.os }}'] | |
timeout-minutes: 60 | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- os: windows-latest | |
cxx_compiler: icx-cl | |
std: 17 | |
build_type: release | |
backend: tbb | |
device_type: HOST | |
- os: windows-latest | |
cxx_compiler: cl | |
std: 17 | |
build_type: release | |
backend: tbb | |
device_type: HOST | |
- os: windows-latest | |
cxx_compiler: icx | |
std: 17 | |
build_type: release | |
backend: dpcpp | |
device_type: CPU | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install Intel® oneAPI Threading Building Blocks | |
if: (matrix.backend == 'tbb' || matrix.backend == 'dpcpp') | |
shell: cmd | |
run: | | |
curl %WINDOWS_TBB_DOWNLOAD_LINK% --output tbb_install.exe | |
tbb_install.exe -s -a --silent --eula accept -p=NEED_VS2019_INTEGRATION=0 -p=NEED_VS2022_INTEGRATION=0 | |
del tbb_install.exe | |
- name: Install Intel® oneAPI DPC++/C++ Compiler | |
shell: cmd | |
run: | | |
curl %WINDOWS_ICPX_DOWNLOAD_LINK% --output icpx_install.exe | |
icpx_install.exe -s -a --silent --eula accept -p=NEED_VS2019_INTEGRATION=0 -p=NEED_VS2022_INTEGRATION=0 | |
del icpx_install.exe | |
:: Avoid accidental use of a released version | |
rd /s /q "%WINDOWS_ONEAPI_PATH%\dpl" | |
- name: Run testing | |
shell: cmd | |
run: | | |
if exist "%WINDOWS_ONEAPI_PATH%\setvars.bat" ( | |
call "%WINDOWS_ONEAPI_PATH%\setvars.bat" | |
) | |
if "${{ matrix.cxx_compiler }}" == "cl" ( | |
call "C:\Program Files (x86)\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" x64 | |
) | |
if "${{ matrix.backend }}" == "dpcpp" ( | |
set ninja_targets="build-onedpl-sycl_iterator-tests" | |
set ctest_flags=-R sycl_iterator_.*\.pass | |
) else ( | |
set ninja_targets=build-onedpl-tests | |
) | |
mkdir build && cd build | |
:: Preserve the code of an unsuccessful command if any. | |
:: By default, CMD shell only reports the error level of the final command. | |
set exit_code=0 | |
cmake -G "Ninja" -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -DCMAKE_CXX_STANDARD=${{ matrix.std }} -DCMAKE_CXX_COMPILER=${{ matrix.cxx_compiler }} -DONEDPL_BACKEND=${{ matrix.backend }} -DONEDPL_DEVICE_TYPE=${{ matrix.device_type }} -DCMAKE_CXX_FLAGS="/W4" .. || set exit_code=%errorlevel% | |
ninja -j 2 -v %ninja_targets% > build.log 2>&1 || set exit_code=%errorlevel% | |
:: Display the results after executing all tests because "tee" alternative is unavailable in CMD. | |
type build.log | |
ctest --timeout %TEST_TIMEOUT% -C ${{ matrix.build_type }} --output-on-failure %ctest_flags% > ctest.log 2>&1 || set exit_code=%errorlevel% | |
type ctest.log | |
:: Generate a summary | |
for /f "usebackq tokens=*" %%i in (`powershell -command "(Get-CimInstance -ClassName Win32_OperatingSystem).Caption"`) do set os_name=%%i | |
for /f "usebackq tokens=*" %%i in (`powershell -command "cmake --version | Select-Object -First 1"`) do set cmake_version=%%i | |
for /f "usebackq tokens=*" %%i in (`powershell -command "${{ matrix.cxx_compiler }} --version | Select-Object -First 1"`) do set compiler_version=%%i | |
for /f "usebackq tokens=*" %%i in (`powershell -command "(Get-CimInstance -ClassName Win32_Processor).Name"`) do set cpu_model=%%i | |
python %GITHUB_WORKSPACE%\.github\scripts\job_summary.py --build-log build.log ^ | |
--ctest-log ctest.log ^ | |
--output-file summary.md ^ | |
--os "%os_name%" ^ | |
--cmake-version "%cmake_version%" ^ | |
--compiler-version "%compiler_version%" ^ | |
--cpu-model "%cpu_model%" | |
type summary.md > %GITHUB_STEP_SUMMARY% | |
exit /b %exit_code% | |
macos-testing: | |
name: HOST,bknd=${{ matrix.backend }},cmplr=${{ matrix.cxx_compiler }},${{ matrix.os }},std=c++${{ matrix.std }},cfg=${{ matrix.build_type }} | |
runs-on: ['${{ matrix.os }}'] | |
timeout-minutes: 60 | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- os: macos-latest | |
cxx_compiler: clang++ | |
std: 17 | |
build_type: release | |
backend: omp | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install OpenMP for Clang++ | |
run: | | |
brew install libomp | |
- name: Run testing | |
shell: bash | |
run: | | |
set -x | |
sysctl -a | grep machdep.cpu | |
# workaround for CMake not being able to find OpenMP: see https://discourse.cmake.org/t/how-to-find-openmp-with-clang-on-macos/8860 | |
# -DCMAKE_POLICY_DEFAULT_CMP0074=NEW below is forced to make sure CMake uses <PackageName>_ROOT variables. | |
export OpenMP_ROOT=$(brew --prefix)/opt/libomp | |
mkdir build && cd build | |
cmake -DCMAKE_CXX_STANDARD=${{ matrix.std }} -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \ | |
-DCMAKE_CXX_COMPILER=${{ matrix.cxx_compiler }} -DONEDPL_BACKEND=${{ matrix.backend }} -DCMAKE_POLICY_DEFAULT_CMP0074=NEW -DCMAKE_CXX_FLAGS="-Wall" .. | |
make VERBOSE=1 build-onedpl-tests -j${MACOS_BUILD_CONCURRENCY} 2>&1 | tee build.log | |
ctest --timeout ${TEST_TIMEOUT} --output-on-failure -E "${EXCLUDE_FROM_TESTING}" 2>&1 | tee ctest.log | |
# Generate a summary | |
os_name=$(uname -a | head -n 1) | |
cmake_version=$(cmake --version | head -n 1) | |
compiler_version=$(${{ matrix.cxx_compiler }} --version | head -n 1) | |
cpu_model=$(sysctl -n machdep.cpu.brand_string) | |
python ${GITHUB_WORKSPACE}/.github/scripts/job_summary.py --build-log build.log \ | |
--ctest-log ctest.log \ | |
--output-file summary.md \ | |
--os "${os_name}" \ | |
--cmake-version "${cmake_version}" \ | |
--compiler-version "${compiler_version}" \ | |
--cpu-model "${cpu_model}" | |
cat summary.md > $GITHUB_STEP_SUMMARY |