Skip to content

Commit

Permalink
Add cached install of Intel oneAPI
Browse files Browse the repository at this point in the history
  • Loading branch information
gwauge committed Dec 6, 2024
1 parent ddcaff3 commit 2d763f3
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 6 deletions.
Empty file.
10 changes: 10 additions & 0 deletions .github/workflow_scripts/oneapi_setup_apt_repo_linux.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/bash

# SPDX-FileCopyrightText: 2020 Intel Corporation
#
# SPDX-License-Identifier: MIT

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
echo "deb 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"
47 changes: 41 additions & 6 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -1,17 +1,52 @@
# based on: https://gist.github.com/scivision/b22455e3322826a1c385d5d4b1a8d25e

name: Build project

on: [push]
env:
LINUX_CPP_COMPONENTS: intel-oneapi-compiler-dpcpp-cpp-and-cpp-classic
# https://github.com/oneapi-src/oneapi-ci/blob/master/.github/workflows/build_all.yml
CTEST_NO_TESTS_ACTION: error

on:
push:
paths:
- "**.cpp"
- "**.hpp"
- "CMakeLists.txt"
- ".github/workflows/*.yaml"
- "build.sh"

jobs:
build:
linux:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v2
# must be first as we're using scripts from this repo
- uses: actions/checkout@v4

- name: cache install oneAPI
id: cache-install
uses: actions/cache@v3
with:
path: |
/opt/intel/oneapi
key: install-apt

- name: Set up environment
run: sudo apt-get update && sudo apt-get install -y build-essential
- name: non-cache install oneAPI
if: steps.cache-install.outputs.cache-hit != 'true'
timeout-minutes: 10
run: |
sh -c .github/workflow_scripts/oneapi_setup_apt_repo_linux.sh
sudo apt install ${{ env.LINUX_CPP_COMPONENTS }}
- name: Setup Intel oneAPI environment
run: |
source /opt/intel/oneapi/setvars.sh
printenv >> $GITHUB_ENV
- name: Run build script
run: ./build.sh

- name: exclude unused files from cache
if: steps.cache-install.outputs.cache-hit != 'true'
run: sh -c .github/workflow_scripts/oneapi_cache_exclude_linux.sh

0 comments on commit 2d763f3

Please sign in to comment.