ci: test with (old) Intel compiler + (new) oneAPI compiler

This commit is contained in:
Anonymous Maarten
2023-03-21 20:38:57 +01:00
committed by Anonymous Maarten
parent d392ce516a
commit e66f4fa71c

View File

@@ -25,6 +25,10 @@ jobs:
- { name: Windows (clang64), os: windows-latest, shell: 'msys2 {0}', msystem: clang64, msys-env: mingw-w64-clang-x86_64, artifact: 'SDL-msys2-clang64' } - { name: Windows (clang64), os: windows-latest, shell: 'msys2 {0}', msystem: clang64, msys-env: mingw-w64-clang-x86_64, artifact: 'SDL-msys2-clang64' }
- { name: Windows (ucrt64), os: windows-latest, shell: 'msys2 {0}', msystem: ucrt64, msys-env: mingw-w64-ucrt-x86_64, artifact: 'SDL-msys2-ucrt64' } - { name: Windows (ucrt64), os: windows-latest, shell: 'msys2 {0}', msystem: ucrt64, msys-env: mingw-w64-ucrt-x86_64, artifact: 'SDL-msys2-ucrt64' }
- { name: Ubuntu 20.04, os: ubuntu-20.04, shell: sh, artifact: 'SDL-ubuntu20.04' } - { name: Ubuntu 20.04, os: ubuntu-20.04, shell: sh, artifact: 'SDL-ubuntu20.04' }
- { name: Intel oneAPI (Ubuntu 20.04), os: ubuntu-20.04, shell: bash, artifact: 'SDL-ubuntu20.04-oneapi', intel: true,
source_cmd: 'source /opt/intel/oneapi/setvars.sh; export CC=icx; export CXX=icx;'}
- { name: Intel Compiler (Ubuntu 20.04), os: ubuntu-20.04, shell: bash, artifact: 'SDL-ubuntu20.04-icc', intel: true, cmake: '-DSDL_CLANG_TIDY=OFF',
source_cmd: 'source /opt/intel/oneapi/setvars.sh; export CC=icc; export CXX=icpc; export CFLAGS=-diag-disable=10441; export CXXFLAGS=-diag-disable=10441; '}
- { name: Ubuntu 22.04, os: ubuntu-22.04, shell: sh, artifact: 'SDL-ubuntu22.04' } - { name: Ubuntu 22.04, os: ubuntu-22.04, shell: sh, artifact: 'SDL-ubuntu22.04' }
- { name: MacOS (Framework), os: macos-latest, shell: sh, cmake: '-DCMAKE_OSX_ARCHITECTURES="x86_64;arm64" -DSDL_FRAMEWORK=ON -DSDL_CLANG_TIDY=OFF', skip_test_pkgconfig: true, artifact: 'SDL-macos-framework' } - { name: MacOS (Framework), os: macos-latest, shell: sh, cmake: '-DCMAKE_OSX_ARCHITECTURES="x86_64;arm64" -DSDL_FRAMEWORK=ON -DSDL_CLANG_TIDY=OFF', skip_test_pkgconfig: true, artifact: 'SDL-macos-framework' }
- { name: MacOS (GNU prefix), os: macos-latest, shell: sh, cmake: '-DCMAKE_OSX_ARCHITECTURES="x86_64" -DCLANG_TIDY_BINARY="$(brew --prefix llvm)/bin/clang-tidy"', artifact: 'SDL-macos-gnu' } - { name: MacOS (GNU prefix), os: macos-latest, shell: sh, cmake: '-DCMAKE_OSX_ARCHITECTURES="x86_64" -DCLANG_TIDY_BINARY="$(brew --prefix llvm)/bin/clang-tidy"', artifact: 'SDL-macos-gnu' }
@@ -65,6 +69,19 @@ jobs:
ninja \ ninja \
pkg-config \ pkg-config \
llvm llvm
- name: Setup Intel oneAPI
if: matrix.platform.intel
run: |
# Setup oneAPI repo
wget https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS-2023.PUB
sudo apt-key add GPG-PUB-KEY-INTEL-SW-PRODUCTS-2023.PUB
sudo echo "deb https://apt.repos.intel.com/oneapi all main" | sudo tee /etc/apt/sources.list.d/oneAPI.list
sudo apt-get update -y
# Install oneAPI
sudo apt-get install -y intel-oneapi-compiler-dpcpp-cpp-and-cpp-classic
- uses: actions/checkout@v3 - uses: actions/checkout@v3
- name: Check that versioning is consistent - name: Check that versioning is consistent
# We only need to run this once: arbitrarily use the Linux/CMake build # We only need to run this once: arbitrarily use the Linux/CMake build
@@ -72,6 +89,7 @@ jobs:
run: ./build-scripts/test-versioning.sh run: ./build-scripts/test-versioning.sh
- name: Configure (CMake) - name: Configure (CMake)
run: | run: |
${{ matrix.platform.source_cmd }}
cmake -S . -B build -G Ninja \ cmake -S . -B build -G Ninja \
-Wdeprecated -Wdev -Werror \ -Wdeprecated -Wdev -Werror \
-DSDL_SHARED=ON \ -DSDL_SHARED=ON \
@@ -86,10 +104,12 @@ jobs:
${{ matrix.platform.cmake }} ${{ matrix.platform.cmake }}
- name: Build (CMake) - name: Build (CMake)
run: | run: |
${{ matrix.platform.source_cmd }}
cmake --build build/ --config Release --verbose --parallel cmake --build build/ --config Release --verbose --parallel
- name: Run build-time tests (CMake) - name: Run build-time tests (CMake)
run: | run: |
set -eu set -eu
${{ matrix.platform.source_cmd }}
export SDL_TESTS_QUICK=1 export SDL_TESTS_QUICK=1
ctest -VV --test-dir build/ ctest -VV --test-dir build/
if test "${{ runner.os }}" = "Linux"; then if test "${{ runner.os }}" = "Linux"; then
@@ -99,6 +119,7 @@ jobs:
- name: Install (CMake) - name: Install (CMake)
run: | run: |
set -eu set -eu
${{ matrix.platform.source_cmd }}
cmake --install build/ --config Release cmake --install build/ --config Release
( cd cmake_prefix; find . ) | LC_ALL=C sort -u ( cd cmake_prefix; find . ) | LC_ALL=C sort -u
- name: Package (CPack) - name: Package (CPack)
@@ -106,6 +127,7 @@ jobs:
cmake --build build/ --config Release --target package cmake --build build/ --config Release --target package
- name: Verify CMake configuration files - name: Verify CMake configuration files
run: | run: |
${{ matrix.platform.source_cmd }}
cmake -S cmake/test -B cmake_config_build -G Ninja \ cmake -S cmake/test -B cmake_config_build -G Ninja \
-DTEST_SHARED=ON \ -DTEST_SHARED=ON \
-DTEST_STATIC=ON \ -DTEST_STATIC=ON \
@@ -115,6 +137,7 @@ jobs:
- name: Verify sdl3.pc - name: Verify sdl3.pc
if: ${{ !matrix.platform.skip_test_pkgconfig }} if: ${{ !matrix.platform.skip_test_pkgconfig }}
run: | run: |
${{ matrix.platform.source_cmd }}
export PKG_CONFIG_PATH=$(echo "${{ github.workspace }}/cmake_prefix/lib/pkgconfig" | sed -e 's#\\#/#g') export PKG_CONFIG_PATH=$(echo "${{ github.workspace }}/cmake_prefix/lib/pkgconfig" | sed -e 's#\\#/#g')
cmake/test/test_pkgconfig.sh cmake/test/test_pkgconfig.sh
- uses: actions/upload-artifact@v3 - uses: actions/upload-artifact@v3