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

This commit is contained in:
Anonymous Maarten 2023-03-23 05:26:56 +01:00 committed by Anonymous Maarten
parent e5ebbdafd4
commit b58285b7ed

View file

@ -15,17 +15,22 @@ jobs:
fail-fast: false fail-fast: false
matrix: matrix:
platform: platform:
- { name: Windows (mingw32), os: windows-latest, shell: 'msys2 {0}', msystem: mingw32, msys-env: mingw-w64-i686 } - { name: Windows (mingw32), os: windows-latest, shell: 'msys2 {0}', msystem: mingw32, msys-env: mingw-w64-i686 }
- { name: Windows (mingw64), os: windows-latest, shell: 'msys2 {0}', msystem: mingw64, msys-env: mingw-w64-x86_64 } - { name: Windows (mingw64), os: windows-latest, shell: 'msys2 {0}', msystem: mingw64, msys-env: mingw-w64-x86_64 }
- { name: Windows (clang32), os: windows-latest, shell: 'msys2 {0}', msystem: clang32, msys-env: mingw-w64-clang-i686 } - { name: Windows (clang32), os: windows-latest, shell: 'msys2 {0}', msystem: clang32, msys-env: mingw-w64-clang-i686 }
- { name: Windows (clang64), os: windows-latest, shell: 'msys2 {0}', msystem: clang64, msys-env: mingw-w64-clang-x86_64 } - { name: Windows (clang64), os: windows-latest, shell: 'msys2 {0}', msystem: clang64, msys-env: mingw-w64-clang-x86_64 }
- { name: Windows (ucrt64), os: windows-latest, shell: 'msys2 {0}', msystem: ucrt64, msys-env: mingw-w64-ucrt-x86_64 } - { name: Windows (ucrt64), os: windows-latest, shell: 'msys2 {0}', msystem: ucrt64, msys-env: mingw-w64-ucrt-x86_64 }
- { name: Ubuntu 20.04 (CMake), os: ubuntu-20.04, shell: sh } - { name: Ubuntu 20.04 (CMake), os: ubuntu-20.04, shell: sh }
- { name: Ubuntu 20.04 (autotools), os: ubuntu-20.04, shell: sh, autotools: true } - { name: Ubuntu 20.04 (autotools), os: ubuntu-20.04, shell: sh, autotools: true }
- { name: Ubuntu 22.04 (CMake), os: ubuntu-22.04, shell: sh } - { name: Intel oneAPI (Ubuntu 20.04), os: ubuntu-20.04, shell: bash, artifact: 'SDL-ubuntu20.04-oneapi', intel: true,
- { name: Ubuntu 22.04 (autotools), os: ubuntu-22.04, shell: sh, autotools: true } source_cmd: 'source /opt/intel/oneapi/setvars.sh; export CC=icx; export CXX=icx;'}
- { name: MacOS (CMake), os: macos-latest, shell: sh, cmake: '-DCMAKE_OSX_ARCHITECTURES="x86_64;arm64"' } - { name: Intel Compiler (Ubuntu 20.04), os: ubuntu-20.04, shell: bash, artifact: 'SDL-ubuntu20.04-icc', intel: true, cmake: '-DSDL_CLANG_TIDY=OFF',
- { name: MacOS (autotools), os: macos-latest, shell: sh, autotools: true } 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 (CMake), os: ubuntu-22.04, shell: sh }
- { name: Ubuntu 22.04 (autotools), os: ubuntu-22.04, shell: sh, autotools: true }
- { name: MacOS (CMake), os: macos-latest, shell: sh, cmake: '-DCMAKE_OSX_ARCHITECTURES="x86_64;arm64"' }
- { name: MacOS (autotools), os: macos-latest, shell: sh, autotools: true }
steps: steps:
- name: Set up MSYS2 - name: Set up MSYS2
@ -61,6 +66,19 @@ jobs:
brew install \ brew install \
ninja \ ninja \
pkg-config pkg-config
- 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
@ -69,6 +87,7 @@ jobs:
- name: Configure (CMake) - name: Configure (CMake)
if: "! matrix.platform.autotools" if: "! matrix.platform.autotools"
run: | run: |
${{ matrix.platform.source_cmd }}
cmake -S . -B build -G Ninja \ cmake -S . -B build -G Ninja \
-DSDL_TESTS=ON \ -DSDL_TESTS=ON \
-DSDL_WERROR=ON \ -DSDL_WERROR=ON \
@ -80,11 +99,13 @@ jobs:
- name: Build (CMake) - name: Build (CMake)
if: "! matrix.platform.autotools" if: "! matrix.platform.autotools"
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)
if: "! matrix.platform.autotools" if: "! matrix.platform.autotools"
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
@ -102,6 +123,7 @@ jobs:
if: matrix.platform.autotools if: matrix.platform.autotools
run: | run: |
set -eu set -eu
${{ matrix.platform.source_cmd }}
rm -fr build-autotools rm -fr build-autotools
mkdir build-autotools mkdir build-autotools
./autogen.sh ./autogen.sh
@ -133,6 +155,7 @@ jobs:
if: matrix.platform.autotools if: matrix.platform.autotools
run: | run: |
set -eu set -eu
${{ matrix.platform.source_cmd }}
parallel="$(getconf _NPROCESSORS_ONLN)" parallel="$(getconf _NPROCESSORS_ONLN)"
make -j"${parallel}" -C build-autotools V=1 make -j"${parallel}" -C build-autotools V=1
if test "${{ runner.os }}" != "macOS" ; then if test "${{ runner.os }}" != "macOS" ; then
@ -142,6 +165,7 @@ jobs:
if: ${{ matrix.platform.autotools && (runner.os != 'macOS') }} if: ${{ matrix.platform.autotools && (runner.os != 'macOS') }}
run: | run: |
set -eu set -eu
${{ matrix.platform.source_cmd }}
curdir="$(pwd)" curdir="$(pwd)"
parallel="$(getconf _NPROCESSORS_ONLN)" parallel="$(getconf _NPROCESSORS_ONLN)"
export SDL_TESTS_QUICK=1 export SDL_TESTS_QUICK=1
@ -154,6 +178,7 @@ jobs:
if: matrix.platform.autotools if: matrix.platform.autotools
run: | run: |
set -eu set -eu
${{ matrix.platform.source_cmd }}
curdir="$(pwd)" curdir="$(pwd)"
parallel="$(getconf _NPROCESSORS_ONLN)" parallel="$(getconf _NPROCESSORS_ONLN)"
make -j"${parallel}" -C build-autotools install V=1 make -j"${parallel}" -C build-autotools install V=1
@ -164,16 +189,19 @@ jobs:
echo "SDL2_DIR=$(pwd)/autotools_prefix" >> $GITHUB_ENV echo "SDL2_DIR=$(pwd)/autotools_prefix" >> $GITHUB_ENV
- 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 \
-DCMAKE_BUILD_TYPE=Release \ -DCMAKE_BUILD_TYPE=Release \
-DCMAKE_PREFIX_PATH=${{ env.SDL2_DIR }} -DCMAKE_PREFIX_PATH=${{ env.SDL2_DIR }}
cmake --build cmake_config_build --verbose cmake --build cmake_config_build --verbose
- name: Verify sdl2-config - name: Verify sdl2-config
run: | run: |
${{ matrix.platform.source_cmd }}
export PATH=${{ env.SDL2_DIR }}/bin:$PATH export PATH=${{ env.SDL2_DIR }}/bin:$PATH
cmake/test/test_sdlconfig.sh cmake/test/test_sdlconfig.sh
- name: Verify sdl2.pc - name: Verify sdl2.pc
run: | run: |
${{ matrix.platform.source_cmd }}
export PKG_CONFIG_PATH=${{ env.SDL2_DIR }}/lib/pkgconfig export PKG_CONFIG_PATH=${{ env.SDL2_DIR }}/lib/pkgconfig
cmake/test/test_pkgconfig.sh cmake/test/test_pkgconfig.sh
- name: Distcheck (Autotools) - name: Distcheck (Autotools)
@ -192,6 +220,7 @@ jobs:
if: "runner.os == 'Linux' && matrix.platform.autotools" if: "runner.os == 'Linux' && matrix.platform.autotools"
run: | run: |
set -eu set -eu
${{ matrix.platform.source_cmd }}
parallel="$(getconf _NPROCESSORS_ONLN)" parallel="$(getconf _NPROCESSORS_ONLN)"
sudo make -j"${parallel}" -C build-autotools install sudo make -j"${parallel}" -C build-autotools install
sudo make -j"${parallel}" -C build-autotools/test install sudo make -j"${parallel}" -C build-autotools/test install