Skip to content

cache intel compiler #152

cache intel compiler

cache intel compiler #152

Workflow file for this run

name: ci-linux
on:
push:
tags-ignore:
- v*.*
branches:
- '*'
pull_request:
branches:
- '*'
permissions:
contents: read
jobs:
build:
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
compiler: [ ninja-gcc, ninja-clang, ninja-clang-libcpp, ninja-intel ]
cxx_version: [ 17, 20 ]
target: [ Debug, Release ]
steps:
- name: Harden Runner
uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1
with:
egress-policy: audit
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Cache CMake build files
uses: actions/cache@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4.1.2
with:
path: build
key: ${{ runner.os }}-cmake-${{ matrix.compiler }}-${{ matrix.cxx_version }}-${{ matrix.target }}
restore-keys: |
${{ runner.os }}-cmake-${{ matrix.compiler }}-${{ matrix.cxx_version }}-
${{ runner.os }}-cmake-${{ matrix.compiler }}-
- name: Cache Compiler
uses: actions/cache@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4.1.2
with:
path: /opt/intel
key: ${{ runner.os }}-compiler-intel-${{ matrix.compiler }}-${{ matrix.cxx_version }}
restore-keys: |
${{ runner.os }}-compiler-intel-
- name: install dependencies
run: sudo apt install -yqq ninja-build
- name: Install compiler
if: steps.cache-compiler.outputs.cache-hit != 'true'
run: |
wget --progress=dot:giga https://registrationcenter-download.intel.com/akdlm/IRC_NAS/ac92f2bb-4818-4e53-a432-f8b34d502f23/intel-dpcpp-cpp-compiler-2025.0.0.740_offline.sh
sudo bash intel-dpcpp-cpp-compiler-2025.0.0.740_offline.sh -s -a -s --action install --eula accept
- name: configure cmake
run: |
source /opt/intel/oneapi/setvars.sh
cmake -S . --preset=${{matrix.compiler}} -B build -DCMAKE_CXX_STANDARD=${{matrix.cxx_version}}
- name: build
run: |
source /opt/intel/oneapi/setvars.sh
cmake --build build --config=${{matrix.target}}
test:
runs-on: ubuntu-22.04
needs: build
strategy:
fail-fast: false
matrix:
compiler: [ ninja-gcc, ninja-clang, ninja-clang-libcpp ]
cxx_version: [ 17, 20 ]
target: [ Debug, Release ]
steps:
- name: Harden Runner
uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1
with:
egress-policy: audit
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Cache CMake build files
uses: actions/cache@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4.1.2
with:
path: build
key: ${{ runner.os }}-cmake-${{ matrix.compiler }}-${{ matrix.cxx_version }}-${{ matrix.target }}
- name: Cache Compiler
uses: actions/cache@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4.1.2
with:
path: /opt/intel
key: ${{ runner.os }}-compiler-intel-${{ matrix.compiler }}-${{ matrix.cxx_version }}
- name: test
run: |
source /opt/intel/oneapi/setvars.sh
cd build && ctest -C ${{matrix.target}} --output-on-failure