From c137f3bc4e526c87e475adec69e524ca52f987ff Mon Sep 17 00:00:00 2001 From: MDW Date: Wed, 21 Aug 2024 14:10:43 +0200 Subject: [PATCH] Qual: Fix caching for windows workflow (#30705) * Qual: Adjust cache configuration for windows-ci # Qual: Adjust cache configuration for windows-ci actions/cache@v4 is flawed on windows, try suggestions from issue discussion to fix it. https://github.com/actions/cache/issues/1361 . * Make cache key depend on install path directory --- .github/workflows/windows-ci.yml | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/.github/workflows/windows-ci.yml b/.github/workflows/windows-ci.yml index 7f550037416..9dbdf1b5ee4 100644 --- a/.github/workflows/windows-ci.yml +++ b/.github/workflows/windows-ci.yml @@ -61,19 +61,22 @@ jobs: - name: Restore cache id: cache uses: actions/cache/restore@v4 + env: + HASH: ${{ hashFiles('htdocs/install/**') }} + KEY_ROOT: ${{ matrix.os }}-${{ env.ckey }}-${{ matrix.php_version }} with: # See https://github.com/actions/cache/issues/1275#issuecomment-1925217178 enableCrossOsArchive: true path: | - db_init.sql - db_init.sql.md5 - key: ${{ matrix.os }}-${{ env.ckey }}-${{ matrix.php_version }}-${{ env.CACHE_KEY_PART - }}-${{ github.run_id }} + ./db_init.sql + ./db_init.sql.md5 + key: ${{ env.KEY_ROOT }}-${{ env.HASH }}-${{ env.CACHE_KEY_PART }}-${{ github.run_id }} restore-keys: | - ${{ matrix.os }}-${{ env.ckey }}-${{ matrix.php_version }}-${{ env.CACHE_KEY_PART }}- - ${{ matrix.os }}-${{ env.ckey }}-${{ matrix.php_version }}-${{ github.head_ref }}- - ${{ matrix.os }}-${{ env.ckey }}-${{ matrix.php_version }}-${{ github.base_ref }}- - ${{ matrix.os }}-${{ env.ckey }}-${{ matrix.php_version }}- + ${{ env.KEY_ROOT }}-${{ env.HASH }}-${{ env.CACHE_KEY_PART }}- + ${{ env.KEY_ROOT }}-${{ env.HASH }}-${{ github.head_ref }}- + ${{ env.KEY_ROOT }}-${{ env.HASH }}-${{ github.base_ref }}- + ${{ env.KEY_ROOT }}-${{ env.HASH }}- + ${{ env.KEY_ROOT }}- - name: Create local php.ini with open_basedir restrictions shell: cmd @@ -183,4 +186,6 @@ jobs: # See https://github.com/actions/cache/issues/1275#issuecomment-1925217178 enableCrossOsArchive: true key: ${{ steps.cache.outputs.cache-primary-key }} - path: db_init.* + path: | + ./db_init.sql + ./db_init.sql.md5