Fix Intel oneAPI environment setup in CI workflow #10
This file contains hidden or 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: CI | |
| on: | |
| push: | |
| branches: [ master ] | |
| pull_request: | |
| branches: [ master ] | |
| jobs: | |
| build: | |
| name: ${{ matrix.os }} / ${{ matrix.compiler }} | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - os: ubuntu-latest | |
| compiler: gcc | |
| cc: gcc | |
| cxx: g++ | |
| - os: ubuntu-latest | |
| compiler: clang | |
| cc: clang | |
| cxx: clang++ | |
| - os: ubuntu-latest | |
| compiler: intel-icx | |
| cc: icx | |
| cxx: icpx | |
| - os: windows-latest | |
| compiler: msvc | |
| - os: macos-latest | |
| compiler: apple-clang | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install Intel oneAPI (Linux) | |
| if: matrix.compiler == 'intel-icx' && runner.os == 'Linux' | |
| run: | | |
| wget https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB | |
| sudo apt-key add GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB | |
| echo "deb https://apt.repos.intel.com/oneapi all main" | sudo tee /etc/apt/sources.list.d/oneAPI.list | |
| sudo apt-get update | |
| sudo apt-get install -y intel-oneapi-compiler-dpcpp-cpp-and-cpp-classic | |
| - name: Setup Intel oneAPI environment | |
| if: matrix.compiler == 'intel-icx' && runner.os == 'Linux' | |
| run: | | |
| source /opt/intel/oneapi/setvars.sh | |
| echo "CC=icx" >> $GITHUB_ENV | |
| echo "CXX=icpx" >> $GITHUB_ENV | |
| echo "/opt/intel/oneapi/compiler/latest/bin" >> $GITHUB_PATH | |
| - name: Configure CMake | |
| run: > | |
| cmake -B build | |
| -DPCG_CPP_BUILD_SAMPLES=ON | |
| -DPCG_CPP_BUILD_TESTS=ON | |
| -DCMAKE_BUILD_TYPE=Release | |
| env: | |
| CC: ${{ matrix.cc || env.CC }} | |
| CXX: ${{ matrix.cxx || env.CXX }} | |
| - name: Build | |
| run: cmake --build build --config Release | |
| - name: Run CTest | |
| run: | | |
| cd build | |
| ctest -C Release --output-on-failure | |
| - name: Run Scripted Tests (Linux/macOS) | |
| if: runner.os != 'Windows' | |
| run: | | |
| chmod +x ./test-high/run-tests.sh | |
| # run-tests.sh expects binaries in specific locations or build dir | |
| # Our updated run-tests.sh supports ../build/test-high | |
| ./test-high/run-tests.sh | |
| - name: Run Scripted Tests (Windows) | |
| if: runner.os == 'Windows' | |
| shell: pwsh | |
| run: | | |
| ./test-high/run-tests.ps1 |