Skip to content

Commit 8537d3d

Browse files
committed
ci: resolve llvm-root for cache@v4
1 parent 3d92071 commit 8537d3d

File tree

1 file changed

+28
-2
lines changed

1 file changed

+28
-2
lines changed

.github/workflows/ci.yml

+28-2
Original file line numberDiff line numberDiff line change
@@ -224,11 +224,24 @@ jobs:
224224
run-tests: false
225225
trace-commands: true
226226

227+
- name: Resolve LLVM Root
228+
id: resolve-llvm-root
229+
run: |
230+
set -x
231+
cd ..
232+
llvm_root=$(pwd)/third-party/llvm-project/install
233+
if [[ ${{ runner.os }} == 'Windows' ]]; then
234+
llvm_root=$(echo "$llvm_root" | sed 's/\\/\//g')
235+
llvm_root=$(echo $llvm_root | sed 's|^/d/|D:/|')
236+
echo "$llvm_root"
237+
fi
238+
echo -E "llvm-root=$llvm_root" >> $GITHUB_OUTPUT
239+
227240
- name: Cached LLVM Binaries
228241
id: llvm-cache
229242
uses: actions/cache@v4
230243
with:
231-
path: ${{ github.workspace }}/${{ matrix.llvm-root }}
244+
path: ${{ steps.resolve-llvm-root.outputs.llvm-root }}
232245
key: ${{ matrix.llvm-cache-key }}
233246

234247
- name: Download LLVM Binaries
@@ -657,12 +670,25 @@ jobs:
657670
fi
658671
echo "exists=$exists" >> $GITHUB_OUTPUT
659672
673+
- name: Resolve LLVM Root
674+
id: resolve-llvm-root
675+
run: |
676+
set -x
677+
cd ..
678+
llvm_root=$(pwd)/third-party/llvm-project/install
679+
if [[ ${{ runner.os }} == 'Windows' ]]; then
680+
llvm_root=$(echo "$llvm_root" | sed 's/\\/\//g')
681+
llvm_root=$(echo $llvm_root | sed 's|^/d/|D:/|')
682+
echo "$llvm_root"
683+
fi
684+
echo -E "llvm-root=$llvm_root" >> $GITHUB_OUTPUT
685+
660686
- name: LLVM Binaries
661687
id: llvm-cache
662688
if: steps.website-releases.outputs.exists != 'true'
663689
uses: actions/cache@v4
664690
with:
665-
path: ${{ github.workspace }}/${{ matrix.llvm-root }}
691+
path: ${{ steps.resolve-llvm-root.outputs.llvm-root }}
666692
key: ${{ matrix.llvm-cache-key }}
667693

668694
- name: Compress LLVM

0 commit comments

Comments
 (0)