Skip to content

Commit eca5ce3

Browse files
committed
Added install folder caching in GitHub Actions for Windows and MacOS runs
1 parent 9d162f8 commit eca5ce3

File tree

4 files changed

+51
-4
lines changed

4 files changed

+51
-4
lines changed

.github/workflows/build_all.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,14 @@ jobs:
2828
shell: bash
2929
steps:
3030
- uses: actions/checkout@v2
31+
- name: cache install
32+
id: cache-install
33+
uses: actions/cache@v2
34+
with:
35+
path: C:\Program Files (x86)\Intel\oneAPI\compiler
36+
key: install-${{ env.WINDOWS_HPCKIT_URL }}-${{ env.WINDOWS_CPP_COMPONENTS }}-compiler
3137
- name: install
38+
if: steps.cache-install.outputs.cache-hit != 'true'
3239
run: scripts/install_windows.bat $WINDOWS_HPCKIT_URL $WINDOWS_CPP_COMPONENTS
3340
- name: build
3441
run: scripts/build_windows.bat c++
@@ -52,7 +59,14 @@ jobs:
5259
shell: bash
5360
steps:
5461
- uses: actions/checkout@v2
62+
- name: cache install
63+
id: cache-install
64+
uses: actions/cache@v2
65+
with:
66+
path: C:\Program Files (x86)\Intel\oneAPI\compiler
67+
key: install-${{ env.WINDOWS_HPCKIT_URL }}-${{ env.WINDOWS_FORTRAN_COMPONENTS }}-compiler
5568
- name: install
69+
if: steps.cache-install.outputs.cache-hit != 'true'
5670
run: scripts/install_windows.bat $WINDOWS_HPCKIT_URL $WINDOWS_FORTRAN_COMPONENTS
5771
- name: build
5872
run: scripts/build_windows.bat fortran
@@ -76,7 +90,17 @@ jobs:
7690
shell: bash
7791
steps:
7892
- uses: actions/checkout@v2
93+
- name: cache install
94+
id: cache-install
95+
uses: actions/cache@v2
96+
with:
97+
path: |
98+
C:\Program Files (x86)\Intel\oneAPI\compiler
99+
C:\Program Files (x86)\Intel\oneAPI\tbb
100+
C:\Windows\System32\OpenCL.dll
101+
key: install-${{ env.WINDOWS_BASEKIT_URL }}-${{ env.WINDOWS_DPCPP_COMPONENTS }}-compiler-tbb-opencl
79102
- name: install
103+
if: steps.cache-install.outputs.cache-hit != 'true'
80104
run: scripts/install_windows.bat $WINDOWS_BASEKIT_URL $WINDOWS_DPCPP_COMPONENTS
81105
- name: build
82106
run: scripts/build_windows.bat dpc++
@@ -166,7 +190,18 @@ jobs:
166190
shell: bash
167191
steps:
168192
- uses: actions/checkout@v2
193+
- name: prepare for cache restore
194+
run: |
195+
sudo mkdir -p /opt/intel
196+
sudo chown $USER /opt/intel
197+
- name: cache install
198+
id: cache-install
199+
uses: actions/cache@v2
200+
with:
201+
path: /opt/intel/oneapi
202+
key: install-${{ env.MACOS_HPCKIT_URL }}-${{ env.MACOS_CPP_COMPONENTS }}
169203
- name: install
204+
if: steps.cache-install.outputs.cache-hit != 'true'
170205
run: scripts/install_macos.sh $MACOS_HPCKIT_URL $MACOS_CPP_COMPONENTS
171206
- name: build
172207
run: scripts/build_macos.sh c++
@@ -189,7 +224,18 @@ jobs:
189224
shell: bash
190225
steps:
191226
- uses: actions/checkout@v2
227+
- name: Prepare for cache restore
228+
run: |
229+
sudo mkdir -p /opt/intel
230+
sudo chown $USER /opt/intel
231+
- name: cache install
232+
id: cache-install
233+
uses: actions/cache@v2
234+
with:
235+
path: /opt/intel/oneapi
236+
key: install-${{ env.MACOS_HPCKIT_URL }}-${{ env.MACOS_FORTRAN_COMPONENTS }}
192237
- name: install
238+
if: steps.cache-install.outputs.cache-hit != 'true'
193239
run: scripts/install_macos.sh $MACOS_HPCKIT_URL $MACOS_FORTRAN_COMPONENTS
194240
- name: build
195241
run: scripts/build_macos.sh fortran

scripts/build_linux.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
LANGUAGE=$1
88

9-
git clone https://github.com/oneapi-src/oneAPI-samples.git
9+
git clone --depth 1 https://github.com/oneapi-src/oneAPI-samples.git
1010

1111
source /opt/intel/oneapi/setvars.sh
1212

scripts/build_macos.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
LANGUAGE=$1
88

9-
git clone https://github.com/oneapi-src/oneAPI-samples.git
9+
git clone --depth 1 https://github.com/oneapi-src/oneAPI-samples.git
1010

1111
source /opt/intel/oneapi/setvars.sh
1212

scripts/build_windows.bat

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ IF "%VS_VER%"=="2019_build_tools" (
1313
@call "C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Auxiliary\Build\vcvars64.bat"
1414
)
1515

16-
@call "C:\Program Files (x86)\Intel\oneAPI\setvars.bat"
16+
@call "C:\Program Files (x86)\Intel\oneAPI\compiler\2021.1-beta10\env\vars.bat"
1717

18-
git clone https://github.com/oneapi-src/oneAPI-samples.git
18+
git clone --depth 1 https://github.com/oneapi-src/oneAPI-samples.git
1919

2020
if "%LANGUAGE%" == "c++" goto cpp
2121
if "%LANGUAGE%" == "fortran" goto fortran
@@ -41,6 +41,7 @@ set RESULT=%ERRORLEVEL%
4141
goto exit
4242

4343
:dpcpp
44+
@call "C:\Program Files (x86)\Intel\oneAPI\tbb\2021.1-beta10\env\vars.bat"
4445
cd oneAPI-samples\DirectProgramming\DPC++\DenseLinearAlgebra\vector-add
4546
nmake -f Makefile.win
4647
nmake -f Makefile.win run

0 commit comments

Comments
 (0)