@@ -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
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
0 commit comments