Skip to content

Commit 2d763f3

Browse files
committed
Add cached install of Intel oneAPI
1 parent ddcaff3 commit 2d763f3

File tree

3 files changed

+51
-6
lines changed

3 files changed

+51
-6
lines changed

.github/workflow_scripts/oneapi_cache_exclude_linux.sh

Whitespace-only changes.
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#!/bin/bash
2+
3+
# SPDX-FileCopyrightText: 2020 Intel Corporation
4+
#
5+
# SPDX-License-Identifier: MIT
6+
7+
wget https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS-2023.PUB
8+
sudo apt-key add GPG-PUB-KEY-INTEL-SW-PRODUCTS-2023.PUB
9+
echo "deb https://apt.repos.intel.com/oneapi all main" | sudo tee /etc/apt/sources.list.d/oneAPI.list
10+
sudo apt-get update -o Dir::Etc::sourcelist="sources.list.d/oneAPI.list" -o APT::Get::List-Cleanup="0"

.github/workflows/build.yaml

Lines changed: 41 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,52 @@
1+
# based on: https://gist.github.com/scivision/b22455e3322826a1c385d5d4b1a8d25e
2+
13
name: Build project
24

3-
on: [push]
5+
env:
6+
LINUX_CPP_COMPONENTS: intel-oneapi-compiler-dpcpp-cpp-and-cpp-classic
7+
# https://github.com/oneapi-src/oneapi-ci/blob/master/.github/workflows/build_all.yml
8+
CTEST_NO_TESTS_ACTION: error
9+
10+
on:
11+
push:
12+
paths:
13+
- "**.cpp"
14+
- "**.hpp"
15+
- "CMakeLists.txt"
16+
- ".github/workflows/*.yaml"
17+
- "build.sh"
418

519
jobs:
6-
build:
20+
linux:
721
runs-on: ubuntu-latest
822

923
steps:
10-
- name: Checkout repository
11-
uses: actions/checkout@v2
24+
# must be first as we're using scripts from this repo
25+
- uses: actions/checkout@v4
26+
27+
- name: cache install oneAPI
28+
id: cache-install
29+
uses: actions/cache@v3
30+
with:
31+
path: |
32+
/opt/intel/oneapi
33+
key: install-apt
1234

13-
- name: Set up environment
14-
run: sudo apt-get update && sudo apt-get install -y build-essential
35+
- name: non-cache install oneAPI
36+
if: steps.cache-install.outputs.cache-hit != 'true'
37+
timeout-minutes: 10
38+
run: |
39+
sh -c .github/workflow_scripts/oneapi_setup_apt_repo_linux.sh
40+
sudo apt install ${{ env.LINUX_CPP_COMPONENTS }}
41+
42+
- name: Setup Intel oneAPI environment
43+
run: |
44+
source /opt/intel/oneapi/setvars.sh
45+
printenv >> $GITHUB_ENV
1546
1647
- name: Run build script
1748
run: ./build.sh
49+
50+
- name: exclude unused files from cache
51+
if: steps.cache-install.outputs.cache-hit != 'true'
52+
run: sh -c .github/workflow_scripts/oneapi_cache_exclude_linux.sh

0 commit comments

Comments
 (0)