Skip to content

Commit ecb568e

Browse files
authored
[CI] Enable cached checkout in main pipeline (#5180)
Enabling repo cache significantly improves performance for LLVM Test Suite jobs (approx. 10 minutes down to 5). For yet unknown reason, enabling cache doesn't work for intel/llvm repo in LLVM Test Suite jobs, but since LLVM Test Suite action will be packaged with containers in future, this is not a big deal.
1 parent a068b15 commit ecb568e

File tree

2 files changed

+31
-12
lines changed

2 files changed

+31
-12
lines changed

.github/workflows/sycl_linux_build_and_test.yml

Lines changed: 27 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -109,11 +109,16 @@ jobs:
109109
image: ${{ fromJSON(needs.configure.outputs.params).build_image }}
110110
options: -u 1001:1001
111111
steps:
112-
- uses: actions/checkout@v2
112+
# GHA requires relative paths for actions. Copy actions from container root
113+
# to CWD.
114+
- run: cp -r /actions .
115+
# Cleanup will be run after all actions are completed.
116+
- name: Register cleanup after job is finished
117+
uses: ./actions/cleanup
118+
- uses: ./actions/cached_checkout
113119
with:
114120
path: src
115-
- name: Register cleanup after job is finished
116-
uses: ./src/devops/actions/cleanup
121+
cache_path: "/__w/repo_cache/"
117122
- name: Setup Cache
118123
uses: actions/cache@v2
119124
if: ${{ steps.parameters.build_github_cache }}
@@ -213,11 +218,14 @@ jobs:
213218
image: ${{ fromJSON(needs.configure.outputs.params).intel_drivers_image }}
214219
options: -u 1001 --device=/dev/dri
215220
steps:
221+
- run: cp -r /actions .
222+
- name: Register cleanup after job is finished
223+
uses: ./actions/cleanup
224+
# FIXME cached_checkout fails here, but works everywhere else
216225
- uses: actions/checkout@v2
217226
with:
218227
path: llvm
219-
- name: Register cleanup after job is finished
220-
uses: ./llvm/devops/actions/cleanup
228+
# TODO should this action be packed into container as well?
221229
- uses: ./llvm/devops/actions/llvm_test_suite
222230
name: Run LLVM Test Suite
223231
with:
@@ -240,11 +248,13 @@ jobs:
240248
image: ${{ fromJSON(needs.configure.outputs.params).intel_drivers_image }}
241249
options: -u 1001 --device=/dev/dri
242250
steps:
251+
- run: cp -r /actions .
252+
- name: Register cleanup after job is finished
253+
uses: ./actions/cleanup
254+
# FIXME cached_checkout fails here, but works everywhere else
243255
- uses: actions/checkout@v2
244256
with:
245257
path: llvm
246-
- name: Register cleanup after job is finished
247-
uses: ./llvm/devops/actions/cleanup
248258
- uses: ./llvm/devops/actions/llvm_test_suite
249259
name: Run LLVM Test Suite
250260
with:
@@ -267,11 +277,13 @@ jobs:
267277
image: ${{ fromJSON(needs.configure.outputs.params).intel_drivers_image }}
268278
options: -u 1001
269279
steps:
280+
- run: cp -r /actions .
281+
- name: Register cleanup after job is finished
282+
uses: ./actions/cleanup
283+
# FIXME cached_checkout fails here, but works everywhere else
270284
- uses: actions/checkout@v2
271285
with:
272286
path: llvm
273-
- name: Register cleanup after job is finished
274-
uses: ./llvm/devops/actions/cleanup
275287
- uses: ./llvm/devops/actions/llvm_test_suite
276288
name: Run LLVM Test Suite
277289
with:
@@ -293,11 +305,15 @@ jobs:
293305
image: ${{ fromJSON(needs.configure.outputs.params).amdgpu_image }}
294306
options: --device=/dev/dri --device=/dev/kfd
295307
steps:
308+
- run: cp -r /actions .
309+
- name: Register cleanup after job is finished
310+
uses: ./actions/cleanup
311+
# TODO remove this step one LLVM Test Suite action is settled and packed
312+
# into container.
313+
# FIXME cached_checkout fails here, but works everywhere else
296314
- uses: actions/checkout@v2
297315
with:
298316
path: llvm
299-
- name: Register cleanup after job is finished
300-
uses: ./llvm/devops/actions/cleanup
301317
- uses: ./llvm/devops/actions/llvm_test_suite
302318
name: Run LLVM Test Suite
303319
with:

devops/actions/llvm_test_suite/action.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,15 @@ post-if: false
3333
runs:
3434
using: "composite"
3535
steps:
36+
- run: cp -r /actions .
37+
shell: bash
3638
- name: Checkout LLVM Test Suite
37-
uses: actions/checkout@v2
39+
uses: ./actions/cached_checkout
3840
with:
3941
path: llvm_test_suite
4042
repository: 'intel/llvm-test-suite'
4143
ref: ${{ inputs.test_ref }}
44+
cache_path: "/__w/repo_cache/"
4245
- name: Download compiler toolchain
4346
uses: actions/download-artifact@v2
4447
with:

0 commit comments

Comments
 (0)