Hello,

this patch introduces github actions cache for SSL libs.
hope it will save couple of minutes.

cheers,
Ilya
From 5c62945e56f3bd36432483b01cba4e734dd44979 Mon Sep 17 00:00:00 2001
From: Ilya Shipitsin <[email protected]>
Date: Sat, 22 Jan 2022 00:00:44 +0500
Subject: [PATCH] CI: github actions: use cache for SSL libs

we have two kinds of SSL libs built - git based and version based.
this commit introduces caching for version based SSL libs.
---
 .github/workflows/vtest.yml | 18 +++++++++++++++++-
 1 file changed, 17 insertions(+), 1 deletion(-)

diff --git a/.github/workflows/vtest.yml b/.github/workflows/vtest.yml
index d748ee28f..ac516054b 100644
--- a/.github/workflows/vtest.yml
+++ b/.github/workflows/vtest.yml
@@ -47,6 +47,22 @@ jobs:
     - uses: actions/checkout@v2
       with:
         fetch-depth: 100
+#
+# Github Action cache key cannot contain comma, so we calculate it based on job name
+#
+    - name: Generate cache key
+      id: generate-cache-key
+      run: |
+        echo "::set-output name=key::$(echo ${{ matrix.name }} | sha256sum | awk '{print $1}')"
+
+    - name: Cache SSL libs
+      if: ${{ matrix.ssl && matrix.ssl != 'stock' && matrix.ssl != 'BORINGSSL=yes' && matrix.ssl != 'QUICTLS=yes' }}
+      id: cache_ssl
+      uses: actions/cache@v2
+      with:
+        path: '~/opt/'
+        key: ssl-${{ steps.generate-cache-key.outputs.key }}
+
     - name: Cache OpenTracing
       if: ${{ contains(matrix.FLAGS, 'USE_OT=1') }}
       id: cache_ot
@@ -73,7 +89,7 @@ jobs:
       run: |
         scripts/build-vtest.sh
     - name: Install SSL ${{ matrix.ssl }}
-      if: ${{ matrix.ssl && matrix.ssl != 'stock' }}
+      if: ${{ matrix.ssl && matrix.ssl != 'stock' && steps.cache_ssl.outputs.cache-hit != 'true' }}
       run: env ${{ matrix.ssl }} scripts/build-ssl.sh
     - name: Install OpenTracing libs
       if: ${{ contains(matrix.FLAGS, 'USE_OT=1') && steps.cache_ot.outputs.cache-hit != 'true'  }}
-- 
2.34.1

Reply via email to