Skip to content

Commit 532d601

Browse files
authored
Merge pull request #182 from padelsbach/wp_shrink_cache_footprint
Reduce the size of the github action caches
2 parents 5fa65a5 + e4ea2a5 commit 532d601

22 files changed

Lines changed: 165 additions & 180 deletions

.github/scripts/check-workflow-result.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,9 @@ if [ "$WOLFPROV_FORCE_FAIL" = "WOLFPROV_FORCE_FAIL=1" ]; then
5454

5555
# Define expected failures based on curl version
5656
case "$CURL_VERSION" in
57+
"curl-7_88_1")
58+
EXPECTED_FAILS="9 39 41 44 64 65 70 71 72 88 153 154 158 163 166 167 168 169 170 173 186 206 245 246 258 259 273 277 327 335 388 540 551 552 554 565 579 584 643 645 646 647 648 649 650 651 652 653 654 666 667 668 669 670 671 672 673 1001 1002 1030 1053 1060 1061 1071 1072 1079 1095 1133 1136 1158 1186 1187 1189 1190 1191 1192 1193 1194 1195 1196 1198 1199 1229 1284 1285 1286 1293 1315 1404 1412 1418 1437 1568 1905 1916 1917 2024 2026 2027 2028 2030 2058 2059 2060 2061 2062 2063 2064 2065 2066 2067 2068 2069 2073 2076 2200 2201 2202 2203 2204 3017 3018"
59+
;;
5760
"curl-8_4_0")
5861
EXPECTED_FAILS="9 31 39 41 44 46 61 64 65 70 71 72 73 88 153 154 158 163 166 167 168 169 170 171 173 186 206 245 246 258 259 273 277 327 335 388 420 444 540 551 552 554 565 579 584 643 645 646 647 648 649 650 651 652 653 654 666 667 668 669 670 671 672 673 977 1001 1002 1030 1053 1060 1061 1071 1072 1079 1095 1105 1133 1136 1151 1155 1158 1160 1161 1186 1187 1189 1190 1191 1192 1193 1194 1195 1196 1198 1199 1229 1284 1285 1286 1293 1315 1404 1412 1415 1418 1437 1568 1903 1905 1916 1917 1964 2024 2026 2027 2028 2030 2058 2059 2060 2061 2062 2063 2064 2065 2066 2067 2068 2069 2073 2076 2200 2201 2202 2203 2204 3017 3018"
5962
;;

.github/workflows/build-wolfprovider.yml

Lines changed: 23 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -22,110 +22,70 @@ jobs:
2222
outputs:
2323
cache_key: wolfprov-${{ inputs.wolfssl_ref }}-${{ inputs.openssl_ref }}-${{ github.sha }}
2424
steps:
25-
# Check if this version of wolfssl/wolfprovider has already been built,
26-
# mark to cache these items on post if we do end up building
27-
# On a push, the first workflow(s) will complete the build and cache it
28-
# and any delayed workflow will be able to utilize it.
29-
# This is not designed to cache builds across commits.
30-
- name: Checking wolfSSL/wolfProvider in cache
31-
uses: actions/cache@v4
32-
id: wolfprov-cache
33-
with:
34-
path: |
35-
scripts
36-
wolfssl-source
37-
wolfssl-install
38-
wolfprov-install
39-
openssl-install
40-
provider.conf
41-
42-
key: wolfprov-${{ inputs.wolfssl_ref }}-${{ inputs.openssl_ref }}-${{ github.sha }}
43-
lookup-only: true
44-
45-
# if cache hit, exit the workflow
46-
- name: Exit workflow if cache hit
47-
if: steps.wolfprov-cache.outputs.cache-hit == 'true'
25+
- name: Install build dependencies
4826
run: |
49-
echo "Found cached build, exiting workflow"
50-
exit 0
27+
sudo apt-get update
28+
sudo apt-get install -y build-essential autoconf libtool pkg-config
5129
5230
- name: Checkout wolfProvider
53-
if: steps.wolfprov-cache.outputs.cache-hit != 'true'
5431
uses: actions/checkout@v4
5532
with:
5633
fetch-depth: 1
5734

58-
# Convert OpenSSL branch name to commit hash if needed
5935
- name: Get OpenSSL commit hash
60-
if: steps.wolfprov-cache.outputs.cache-hit != 'true'
6136
id: openssl-ref
6237
run: |
63-
if [[ "${{ inputs.openssl_ref }}" =~ ^[0-9a-f]{40}$ ]]; then
64-
echo "ref=${{ inputs.openssl_ref }}" >> $GITHUB_OUTPUT
65-
else
66-
sha=$(curl -s "https://api.github.com/repos/openssl/openssl/commits/${{ inputs.openssl_ref }}" | jq -r '.sha')
67-
echo "ref=$sha" >> $GITHUB_OUTPUT
68-
echo "OpenSSL ref ${{ inputs.openssl_ref }} is commit $sha"
69-
fi
38+
sha=$(./scripts/resolve-ref.sh "${{ inputs.openssl_ref }}" "openssl/openssl")
39+
echo "ref=$sha" >> "$GITHUB_OUTPUT"
40+
env:
41+
# Used token to bypass rate limits
42+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
43+
44+
- name: Get WolfSSL commit hash
45+
id: wolfssl-ref
46+
run: |
47+
sha=$(./scripts/resolve-ref.sh "${{ inputs.wolfssl_ref }}" "wolfssl/wolfssl")
48+
echo "ref=$sha" >> "$GITHUB_OUTPUT"
49+
env:
50+
# Used token to bypass rate limits
51+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
7052

7153
# Look for a cached version of OpenSSL
7254
- name: Checking OpenSSL in cache
73-
if: steps.wolfprov-cache.outputs.cache-hit != 'true'
7455
uses: actions/cache/restore@v4
7556
id: openssl-cache
7657
with:
7758
path: |
78-
openssl-source
7959
openssl-install
80-
8160
key: ossl-depends-${{ steps.openssl-ref.outputs.ref }}
8261
lookup-only: false
8362

84-
# Convert WolfSSL branch name to commit hash if needed
85-
- name: Get WolfSSL commit hash
86-
if: steps.wolfprov-cache.outputs.cache-hit != 'true'
87-
id: wolfssl-ref
88-
run: |
89-
if [[ "${{ inputs.wolfssl_ref }}" =~ ^[0-9a-f]{40}$ ]]; then
90-
echo "ref=${{ inputs.wolfssl_ref }}" >> $GITHUB_OUTPUT
91-
else
92-
sha=$(curl -s "https://api.github.com/repos/wolfssl/wolfssl/commits/${{ inputs.wolfssl_ref }}" | jq -r '.sha')
93-
echo "ref=$sha" >> $GITHUB_OUTPUT
94-
echo "WolfSSL ref ${{ inputs.wolfssl_ref }} is commit $sha"
95-
fi
96-
9763
# Look for a cached version of WolfSSL
9864
- name: Checking WolfSSL in cache
99-
if: steps.wolfprov-cache.outputs.cache-hit != 'true'
10065
uses: actions/cache/restore@v4
10166
id: wolfssl-cache
10267
with:
10368
path: |
104-
wolfssl-source
10569
wolfssl-install
106-
10770
key: wolfssl-depends-${{ steps.wolfssl-ref.outputs.ref }}
10871
lookup-only: false
10972

11073
- name: Build wolfProvider
111-
if: steps.wolfprov-cache.outputs.cache-hit != 'true'
11274
run: |
11375
OPENSSL_TAG=${{ inputs.openssl_ref }} WOLFSSL_TAG=${{ inputs.wolfssl_ref }} ./scripts/build-wolfprovider.sh
11476
115-
# This is potentially chewing up a lot of cache space.
116-
# Could investigate reducing the size of this cache.
117-
# Note that we use actions/cache/save and actions/cache/restore instead of
118-
# actions/cache to reduce the chance of a cache lock issue.
77+
# Save the wolfProvider outputs for use by the parent jobs.
78+
# Note that we don't try to restore since it will likely always
79+
# be a cache miss.
11980
- name: Save wolfProvider into cache
120-
if: steps.wolfprov-cache.outputs.cache-hit != 'true'
12181
uses: actions/cache/save@v4
12282
with:
12383
path: |
124-
wolfssl-source
12584
wolfssl-install
12685
wolfprov-install
127-
openssl-install
128-
provider.conf
86+
openssl-install/lib64
87+
openssl-install/include
88+
openssl-install/bin
12989
key: wolfprov-${{ inputs.wolfssl_ref }}-${{ inputs.openssl_ref }}-${{ github.sha }}
13090

13191
# If openssl cache miss, save it to the cache
@@ -134,7 +94,6 @@ jobs:
13494
uses: actions/cache/save@v4
13595
with:
13696
path: |
137-
openssl-source
13897
openssl-install
13998
key: ossl-depends-${{ steps.openssl-ref.outputs.ref }}
14099

@@ -143,7 +102,6 @@ jobs:
143102
uses: actions/cache/save@v4
144103
with:
145104
path: |
146-
wolfssl-source
147105
wolfssl-install
148106
key: wolfssl-depends-${{ steps.wolfssl-ref.outputs.ref }}
149107

.github/workflows/cjose.yml

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -45,21 +45,18 @@ jobs:
4545
id: wolfprov-cache-restore
4646
with:
4747
path: |
48-
scripts
49-
wolfssl-source
5048
wolfssl-install
5149
wolfprov-install
52-
openssl-install
53-
provider.conf
50+
openssl-install/lib64
51+
openssl-install/include
52+
openssl-install/bin
5453
5554
key: wolfprov-${{ matrix.wolfssl_ref }}-${{ matrix.openssl_ref }}-${{ github.sha }}
5655
fail-on-cache-miss: true
5756

5857
- name: Install cjose dependencies
5958
run: |
60-
sudo apt-get update
61-
sudo apt-get install build-essential autoconf libtool pkg-config clang libc++-dev
62-
sudo apt-get install libjansson-dev check
59+
sudo apt-get install -y libjansson-dev check
6360
6461
- name: Download cjose
6562
uses: actions/checkout@v4

.github/workflows/curl.yml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030
timeout-minutes: 20
3131
strategy:
3232
matrix:
33-
curl_ref: [ 'master', 'curl-8_4_0' ]
33+
curl_ref: [ 'master', 'curl-8_4_0', 'curl-7_88_1' ]
3434
wolfssl_ref: [ 'master', 'v5.8.0-stable' ]
3535
openssl_ref: [ 'openssl-3.5.0' ]
3636
force_fail: ['WOLFPROV_FORCE_FAIL=1', '']
@@ -48,12 +48,11 @@ jobs:
4848
id: wolfprov-cache
4949
with:
5050
path: |
51-
scripts
52-
wolfssl-source
5351
wolfssl-install
5452
wolfprov-install
55-
openssl-install
56-
provider.conf
53+
openssl-install/lib64
54+
openssl-install/include
55+
openssl-install/bin
5756
5857
key: wolfprov-${{ matrix.wolfssl_ref }}-${{ matrix.openssl_ref }}-${{ github.sha }}
5958
fail-on-cache-miss: true

.github/workflows/grpc.yml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,12 +52,11 @@ jobs:
5252
id: wolfprov-cache
5353
with:
5454
path: |
55-
scripts
56-
wolfssl-source
5755
wolfssl-install
5856
wolfprov-install
59-
openssl-install
60-
provider.conf
57+
openssl-install/lib64
58+
openssl-install/include
59+
openssl-install/bin
6160
6261
key: wolfprov-${{ matrix.wolfssl_ref }}-${{ matrix.openssl_ref }}-${{ github.sha }}
6362
fail-on-cache-miss: true

.github/workflows/iperf.yml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,12 +45,11 @@ jobs:
4545
id: wolfprov-cache
4646
with:
4747
path: |
48-
scripts
49-
wolfssl-source
5048
wolfssl-install
5149
wolfprov-install
52-
openssl-install
53-
provider.conf
50+
openssl-install/lib64
51+
openssl-install/include
52+
openssl-install/bin
5453
5554
key: wolfprov-${{ matrix.wolfssl_ref }}-${{ matrix.openssl_ref }}-${{ github.sha }}
5655
fail-on-cache-miss: true

.github/workflows/ipmitool.yml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,12 +45,11 @@ jobs:
4545
id: wolfprov-cache
4646
with:
4747
path: |
48-
scripts
49-
wolfssl-source
5048
wolfssl-install
5149
wolfprov-install
52-
openssl-install
53-
provider.conf
50+
openssl-install/lib64
51+
openssl-install/include
52+
openssl-install/bin
5453
5554
key: wolfprov-${{ matrix.wolfssl_ref }}-${{ matrix.openssl_ref }}-${{ github.sha }}
5655
fail-on-cache-miss: true

.github/workflows/libfido2.yml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,11 @@ jobs:
4040
id: wolfprov-cache
4141
with:
4242
path: |
43-
scripts
44-
wolfssl-source
4543
wolfssl-install
4644
wolfprov-install
47-
openssl-install
48-
provider.conf
45+
openssl-install/lib64
46+
openssl-install/include
47+
openssl-install/bin
4948
key: wolfprov-${{ matrix.wolfssl_ref }}-${{ matrix.openssl_ref }}-${{ github.sha }}
5049
fail-on-cache-miss: true
5150
- name: Install test dependencies

.github/workflows/liboauth2.yml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,11 @@ jobs:
4444
id: wolfprov-cache
4545
with:
4646
path: |
47-
scripts
48-
wolfssl-source
4947
wolfssl-install
5048
wolfprov-install
51-
openssl-install
52-
provider.conf
49+
openssl-install/lib64
50+
openssl-install/include
51+
openssl-install/bin
5352
5453
key: wolfprov-${{ matrix.wolfssl_ref }}-${{ matrix.openssl_ref }}-${{ github.sha }}
5554
fail-on-cache-miss: true

.github/workflows/libwebsockets.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -42,19 +42,18 @@ jobs:
4242
- name: Checkout wolfProvider
4343
uses: actions/checkout@v4
4444
with:
45-
sparse-checkout: |
46-
.github
45+
fetch-depth: 1
46+
4747
- name: Retrieving wolfProvider from cache
4848
uses: actions/cache/restore@v4
4949
id: wolfprov-cache-restore
5050
with:
5151
path: |
52-
scripts
53-
wolfssl-source
5452
wolfssl-install
5553
wolfprov-install
56-
openssl-install
57-
provider.conf
54+
openssl-install/lib64
55+
openssl-install/include
56+
openssl-install/bin
5857
key: wolfprov-${{ matrix.wolfssl_ref }}-${{ matrix.openssl_ref }}-${{ github.sha }}
5958
fail-on-cache-miss: true
6059

@@ -77,6 +76,7 @@ jobs:
7776
cmake ..
7877
make -j$(nproc)
7978
sudo make install
79+
8080
- name: Run libwebsockets tests
8181
working-directory: libwebsockets
8282
run: |

0 commit comments

Comments
 (0)