diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index b48b8c069..cff7bf879 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -119,13 +119,21 @@ jobs: - name: repo checkout uses: actions/checkout@v7 - # Caches not accessed within the last week are evicted. + # Caches not accessed within the last week are evicted. However, if a + # cache is accessed at least once a week, it can remain permanently. + # Use a weekly cache key for -master and -latest builds to keep them + # reasonably fresh, while stable versions use a fixed key. # https://github.com/actions/cache#cache-limits + - name: Get current week + id: current-week + if: matrix.openssl == 'openssl-master' || matrix.openssl == 'libressl-master' || matrix.openssl == 'aws-lc-latest' + run: echo "week=$(date -u '+%Y%W')" >> "$GITHUB_OUTPUT" + - id: cache-openssl uses: actions/cache@v6 with: path: ~/openssl - key: openssl-${{ runner.os }}-${{ matrix.openssl }}-${{ matrix.append-configure || 'default' }} + key: openssl-${{ runner.os }}-${{ matrix.openssl }}-${{ matrix.append-configure || 'default' }}-${{ steps.current-week.outputs.week || 'default' }} - name: Compile OpenSSL library if: steps.cache-openssl.outputs.cache-hit != 'true'