Skip to content

Commit 67d33e5

Browse files
committed
CI (MSYS2): Update location of compiler cache.
1 parent 30a0ccb commit 67d33e5

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

.github/workflows/dynamic_arch.yml

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -217,11 +217,16 @@ jobs:
217217
- name: Checkout repository
218218
uses: actions/checkout@v3
219219

220+
- name: Prepare ccache
221+
# Get cache location of ccache
222+
id: ccache-prepare
223+
run: |
224+
echo "ccachedir=$(cygpath -m $(ccache -k cache_dir))" >> $GITHUB_OUTPUT
225+
220226
- name: Compilation cache
221227
uses: actions/cache@v3
222228
with:
223-
# It looks like this path needs to be hard-coded.
224-
path: C:/msys64/home/runneradmin/.ccache
229+
path: ${{ steps.ccache-prepare.outputs.ccachedir }}
225230
# We include the commit sha in the cache key, as new cache entries are
226231
# only created if there is no existing entry for the key yet.
227232
key: ccache-msys2-${{ matrix.msystem }}-${{ matrix.idx }}-${{ matrix.build-type }}-${{ github.ref }}-${{ github.sha }}
@@ -234,9 +239,10 @@ jobs:
234239
# Limit the maximum size and switch on compression to avoid exceeding the total disk or cache quota.
235240
run: |
236241
which ccache
237-
test -d ~/.ccache || mkdir -p ~/.ccache
238-
echo "max_size = 250M" > ~/.ccache/ccache.conf
239-
echo "compression = true" >> ~/.ccache/ccache.conf
242+
test -d ${{ steps.ccache-prepare.outputs.ccachedir }} || mkdir -p ${{ steps.ccache-prepare.outputs.ccachedir }}
243+
echo "max_size = 250M" > ${{ steps.ccache-prepare.outputs.ccachedir }}/ccache.conf
244+
echo "compression = true" >> ${{ steps.ccache-prepare.outputs.ccachedir }}/ccache.conf
245+
ccache -p
240246
ccache -s
241247
echo $HOME
242248
cygpath -w $HOME

0 commit comments

Comments
 (0)