Skip to content

Commit b625420

Browse files
authored
Merge pull request #1110 from junaruga/wip/ci-cache-openssl-libressl-master-aws-lc-validity
CI: Use year and week number cache key for -master and -latest
2 parents 177a1a7 + 2ef44dd commit b625420

1 file changed

Lines changed: 10 additions & 2 deletions

File tree

.github/workflows/test.yml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,13 +119,21 @@ jobs:
119119
- name: repo checkout
120120
uses: actions/checkout@v7
121121

122-
# Caches not accessed within the last week are evicted.
122+
# Caches not accessed within the last week are evicted. However, if a
123+
# cache is accessed at least once a week, it can remain permanently.
124+
# Use a weekly cache key for -master and -latest builds to keep them
125+
# reasonably fresh, while stable versions use a fixed key.
123126
# https://github.com/actions/cache#cache-limits
127+
- name: Get current week
128+
id: current-week
129+
if: matrix.openssl == 'openssl-master' || matrix.openssl == 'libressl-master' || matrix.openssl == 'aws-lc-latest'
130+
run: echo "week=$(date -u '+%Y%W')" >> "$GITHUB_OUTPUT"
131+
124132
- id: cache-openssl
125133
uses: actions/cache@v6
126134
with:
127135
path: ~/openssl
128-
key: openssl-${{ runner.os }}-${{ matrix.openssl }}-${{ matrix.append-configure || 'default' }}
136+
key: openssl-${{ runner.os }}-${{ matrix.openssl }}-${{ matrix.append-configure || 'default' }}-${{ steps.current-week.outputs.week || 'default' }}
129137

130138
- name: Compile OpenSSL library
131139
if: steps.cache-openssl.outputs.cache-hit != 'true'

0 commit comments

Comments
 (0)