Unlike cached approach, this is simpler but takes much longer to setup on each run.
Intel APT repo is used.
# this method does not use Github Actions cache--good for infrequent simple runs | |
jobs: | |
linux-intel-oneapi: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
oneapi: [2025.1] | |
steps: | |
- name: Intel Apt repository | |
timeout-minutes: 5 | |
run: | | |
curl -sS -L https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB | gpg --dearmor | sudo tee /usr/share/keyrings/oneapi-archive-keyring.gpg > /dev/null | |
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 | |
sudo apt-get update -o Dir::Etc::sourcelist="sources.list.d/oneAPI.list" -o APT::Get::List-Cleanup="0" | |
- name: Install Intel oneAPI compilers | |
timeout-minutes: 5 | |
run: sudo apt-get install --no-install-recommends intel-oneapi-compiler-fortran-${{ matrix.oneapi}} intel-oneapi-compiler-dpcpp-cpp-${{ matrix.oneapi }} | |
- name: Setup Intel oneAPI environment | |
run: | | |
source /opt/intel/oneapi/${{ matrix.oneapi }}/oneapi-vars.sh | |
printenv >> $GITHUB_ENV | |
- name: checkout project code | |
uses: actions/checkout@v4 | |
- name: CMake Configure | |
run: cmake -B build | |
- name: CMake build | |
run: cmake --build build | |
- name: CMake test | |
run: ctest --test-dir build |
Thanks I've corrected this example. I'm going to make it a repo so it will run in Github Actions.