Skip to content

Commit 3aa7f4a

Browse files
committed
ci: Cache Windows OpenSSL install
1 parent f311581 commit 3aa7f4a

1 file changed

Lines changed: 13 additions & 1 deletion

File tree

.github/actions/install-openssl/action.yml

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,24 @@ runs:
2727
# The Windows runner has an older version of OpenSSL and needs to be upgraded.
2828
# Additionally, it seems to randomly be installed in OpenSSL-Win64 or OpenSSL depending on
2929
# the runner Github gives us.
30+
- name: Cache OpenSSL (Windows)
31+
if: runner.os == 'Windows'
32+
id: cache-openssl-windows
33+
uses: actions/cache@2c8a9bd7457de244a408f35966fab2fb45fda9c8 # v6.0.0
34+
with:
35+
path: |
36+
C:\Program Files\OpenSSL-Win64
37+
C:\Program Files\OpenSSL
38+
key: openssl-windows-4.0.1
39+
3040
- name: Install for Windows
3141
id: choco-action
3242
if: runner.os == 'Windows'
3343
shell: bash
3444
run: |
35-
choco install openssl --version 4.0.1 -y --no-progress
45+
if [ "${{ steps.cache-openssl-windows.outputs.cache-hit }}" != "true" ]; then
46+
choco install openssl --version 4.0.1 -y --no-progress
47+
fi
3648
if [ -d "C:\Program Files\OpenSSL-Win64" ]; then
3749
echo "OPENSSL_ROOT_DIR=C:\Program Files\OpenSSL-Win64" >> $GITHUB_OUTPUT
3850
else

0 commit comments

Comments
 (0)