3838 # you can specify the version after `-` like "llvm-15.0.2".
3939 - llvm-19.1.1
4040 - gcc-14
41+ - intel
4142 generator :
4243 - " Ninja Multi-Config"
4344 build_type :
5455 - os : windows-latest
5556 compiler : gcc-14
5657
58+ # Intel oneAPI is only available on Linux
59+ - os : windows-latest
60+ compiler : intel
61+ - os : macos-latest
62+ compiler : intel
63+
5764 include :
5865 # Add appropriate variables for gcov version required. This will intentionally break
5966 # if you try to use a compiler that does not have gcov set
6572 enable_ipo : Off
6673 gcov_executable : " llvm-cov gcov"
6774
75+ - compiler : intel
76+ enable_ipo : Off
77+ gcov_executable : gcov
78+
6879 - os : macos-latest
6980 enable_ipo : Off
7081
@@ -144,6 +155,7 @@ jobs:
144155
145156
146157 - name : Setup Cpp
158+ if : ${{ matrix.compiler != 'intel' }}
147159 uses : aminya/setup-cpp@v1
148160 with :
149161 compiler : ${{ matrix.compiler }}
@@ -161,9 +173,39 @@ jobs:
161173 gcovr : true
162174 opencppcoverage : true
163175
176+ - name : Install Intel oneAPI
177+ if : ${{ matrix.compiler == 'intel' }}
178+ run : |
179+ wget -qO- https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB | sudo gpg --dearmor -o /usr/share/keyrings/oneapi-archive-keyring.gpg
180+ 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
181+ sudo apt-get update
182+ sudo apt-get install -y intel-oneapi-compiler-dpcpp-cpp cmake ninja-build ccache cppcheck gcovr
183+
184+ - name : Configure Intel oneAPI environment
185+ if : ${{ matrix.compiler == 'intel' }}
186+ run : |
187+ echo "/opt/intel/oneapi/compiler/latest/bin" >> $GITHUB_PATH
188+ echo "LD_LIBRARY_PATH=/opt/intel/oneapi/compiler/latest/lib:$LD_LIBRARY_PATH" >> $GITHUB_ENV
189+ echo "CC=icx" >> $GITHUB_ENV
190+ echo "CXX=icpx" >> $GITHUB_ENV
191+
164192 - name : Install Conan and Lizard
165193 run : pip install conan lizard
166194
195+ - name : Configure Conan for Intel ICX
196+ if : ${{ matrix.compiler == 'intel' }}
197+ run : |
198+ ICX=/opt/intel/oneapi/compiler/latest/bin/icx
199+ ICX_CLANG_VER=$($ICX -dM -E -x c /dev/null 2>/dev/null | grep __clang_major__ | awk '{print $3}')
200+ echo "ICX underlying Clang version: $ICX_CLANG_VER"
201+ CC=clang CXX=clang++ conan profile detect --force
202+ sed -i "s/compiler.version=.*/compiler.version=$ICX_CLANG_VER/" ~/.conan2/profiles/default
203+ sed -i "s/compiler.cppstd=.*/compiler.cppstd=23/" ~/.conan2/profiles/default
204+ cat ~/.conan2/profiles/default
205+ conan install . --output-folder=build --build=missing -s build_type=Debug
206+ conan install . --output-folder=build --build=missing -s build_type=Release
207+ conan install . --output-folder=build --build=missing -s build_type=RelWithDebInfo
208+
167209 - name : Pre-install Conan deps for macOS GCC
168210 if : ${{ runner.os == 'macOS' && contains(matrix.compiler, 'gcc') }}
169211 run : |
@@ -194,8 +236,12 @@ jobs:
194236 run : |
195237 EXTRA_CMAKE_ARGS=""
196238 # macOS GCC: deps pre-installed with libstdc++11 profile
239+ if [[ "${{ matrix.compiler }}" == "intel" ]]; then
240+ EXTRA_CMAKE_ARGS="-D${{ env.PROJECT_NAME }}_SKIP_CONAN_PROVIDER=ON -DCMAKE_PREFIX_PATH=$PWD/build"
241+ fi
242+ # macOS GCC: deps pre-installed with libstdc++11 profile
197243 if [[ "${{ runner.os }}" == "macOS" && "${{ matrix.compiler }}" =~ gcc ]]; then
198- EXTRA_CMAKE_ARGS="-Dmyproject_SKIP_CONAN_PROVIDER =ON -DCMAKE_PREFIX_PATH=$PWD/build"
244+ EXTRA_CMAKE_ARGS="-D${{ env.PROJECT_NAME }}_SKIP_CONAN_PROVIDER =ON -DCMAKE_PREFIX_PATH=$PWD/build"
199245 fi
200246 cmake -S . -B ./build -G "${{matrix.generator}}" $EXTRA_CMAKE_ARGS -D${{ env.PROJECT_NAME }}_ENABLE_IPO=${{matrix.enable_ipo }} -DCMAKE_BUILD_TYPE:STRING=${{matrix.build_type}} -D${{ env.PROJECT_NAME }}_PACKAGING_MAINTAINER_MODE:BOOL=${{matrix.packaging_maintainer_mode}} -D${{ env.PROJECT_NAME }}_ENABLE_COVERAGE:BOOL=${{ matrix.build_type == 'Debug' }} -D${{ env.PROJECT_NAME }}_ENABLE_BLOATY:BOOL=OFF -D${{ env.PROJECT_NAME }}_ENABLE_INCLUDE_WHAT_YOU_USE:BOOL=OFF -DGIT_SHA:STRING=${{ github.sha }}
201247
@@ -211,7 +257,10 @@ jobs:
211257 # See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail
212258 run : |
213259 ctest -C ${{matrix.build_type}}
214- gcovr -j ${{env.nproc}} --root ../ --print-summary --xml-pretty --xml coverage.xml . --gcov-executable '${{ matrix.gcov_executable }}'
260+ # Intel ICX uses a different coverage format incompatible with gcov
261+ if [[ "${{ matrix.compiler }}" != "intel" ]]; then
262+ gcovr -j ${{env.nproc}} --root ../ --print-summary --xml-pretty --xml coverage.xml . --gcov-executable '${{ matrix.gcov_executable }}'
263+ fi
215264
216265 - name : Windows - Test and coverage
217266 if : runner.os == 'Windows'
@@ -234,6 +283,7 @@ jobs:
234283
235284
236285 - name : Publish to codecov
286+ if : ${{ matrix.compiler != 'intel' }}
237287 uses : codecov/codecov-action@v5
238288 with :
239289 fail_ci_if_error : true
0 commit comments