Skip to content

Commit 8346a0d

Browse files
improve caching logic
1 parent 696ab05 commit 8346a0d

File tree

1 file changed

+11
-7
lines changed

1 file changed

+11
-7
lines changed

.github/workflows/os-llvm-sycl-build.yml

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -33,20 +33,24 @@ jobs:
3333
${{ runner.os }}-
3434
3535
- name: Download nightly and components
36-
if: steps.cache-sycl-bundle.outputs.cache-hit != 'true'
3736
shell: bash -l {0}
3837
run: |
3938
cd /home/runner/work
4039
mkdir -p sycl_bundle
4140
cd sycl_bundle
4241
export LATEST_LLVM_TAG=$(git -c 'versionsort.suffix=-' ls-remote --tags --sort='v:refname' https://github.com/intel/llvm.git | tail --lines=1)
4342
export LATEST_LLVM_TAG_SHA=$(echo ${LATEST_LLVM_TAG} | awk '{print $1}')
44-
export NIGHTLY_TAG=$(python3 -c "import sys, urllib.parse as ul; print (ul.quote_plus(sys.argv[1]))" $(echo ${LATEST_LLVM_TAG} | awk '{gsub(/^refs\/tags\//, "", $2)} {print $2}'))
45-
export DOWNLOAD_URL_PREFIX=https://github.com/intel/llvm/releases/download
46-
wget ${DOWNLOAD_URL_PREFIX}/${NIGHTLY_TAG}/dpcpp-compiler.tar.gz && echo ${LATEST_LLVM_TAG_SHA} > bundle_id.txt || rm -rf bundle_d.txt
47-
wget ${DOWNLOAD_URL_PREFIX}/2021-07/${OCLCPUEXP_FN}
48-
wget ${DOWNLOAD_URL_PREFIX}/2021-07/${FPGAEMU_FN}
49-
wget https://github.com/oneapi-src/oneTBB/releases/download/v2021.4.0/${TBB_FN}
43+
export NIGHTLY_TAG=$(python3 -c "import sys, urllib.parse as ul; print (ul.quote_plus(sys.argv[1]))" \
44+
$(echo ${LATEST_LLVM_TAG} | awk '{gsub(/^refs\/tags\//, "", $2)} {print $2}'))
45+
if [[ -f bundle_id.txt && ( "$(cat bundle_id.txt)" == "${LATEST_LLVM_TAG_SHA}" ) ]]; then
46+
export DOWNLOAD_URL_PREFIX=https://github.com/intel/llvm/releases/download
47+
wget ${DOWNLOAD_URL_PREFIX}/${NIGHTLY_TAG}/dpcpp-compiler.tar.gz && echo ${LATEST_LLVM_TAG_SHA} > bundle_id.txt || rm -rf bundle_id.txt
48+
wget ${DOWNLOAD_URL_PREFIX}/2021-07/${OCLCPUEXP_FN} || rm -rf bundle_id.txt
49+
wget ${DOWNLOAD_URL_PREFIX}/2021-07/${FPGAEMU_FN} || rm -rf bundle_id.txt
50+
wget https://github.com/oneapi-src/oneTBB/releases/download/v2021.4.0/${TBB_FN} || rm -rf bundle_id.txt
51+
else
52+
echo "Using cached download of ${LATEST_LLVM_TAG}"
53+
fi
5054
5155
- name: Install system components
5256
shell: bash -l {0}

0 commit comments

Comments
 (0)