Skip to content

Commit b068eda

Browse files
committed
ci: fix home directory for vcplg/pnpm cache
1 parent cb62da5 commit b068eda

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

.github/workflows/CI.yml

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,22 @@ jobs:
3232

3333
- uses: pnpm/action-setup@v4
3434

35+
- name: Setup Home Directory
36+
id: home
37+
shell: bash
38+
run: |
39+
if [[ ${{ runner.os }} == "Windows" ]]; then
40+
echo "HOME=$USERPROFILE" >> $GITHUB_OUTPUT
41+
else
42+
echo "HOME=$HOME" >> $GITHUB_OUTPUT
43+
fi
44+
3545
- name: Cache vcpkg/pnpm
3646
uses: actions/cache@v4
3747
with:
3848
path: |
39-
${{ env.HOME || env.USERPROFILE }}/.pnpm-store
40-
${{ env.HOME || env.USERPROFILE }}/vcpkg
49+
${{ steps.home.outputs.HOME }}/.pnpm-store
50+
${{ steps.home.outputs.HOME }}/vcpkg
4151
key: ${{ matrix.os }}-${{ matrix.cpp_arch }}-${{ hashFiles('pnpm-lock.yaml', 'package.json') }}
4252
restore-keys: |
4353
${{ matrix.os }}-${{ matrix.cpp_arch }}-

0 commit comments

Comments
 (0)