Skip to content

Commit b363e6d

Browse files
committed
Experimental support for a common build-wolfprovider and common section for build/cache/restore
1 parent c9279b6 commit b363e6d

12 files changed

Lines changed: 196 additions & 716 deletions

File tree

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
name: Build wolfProvider
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
wolfssl_ref:
7+
required: true
8+
type: string
9+
openssl_ref:
10+
required: true
11+
type: string
12+
outputs:
13+
cache_key:
14+
description: "Cache key for the build artifacts"
15+
value: ${{ jobs.build_wolfprovider.outputs.cache_key }}
16+
17+
jobs:
18+
build_wolfprovider:
19+
name: Build wolfProvider
20+
runs-on: ubuntu-22.04
21+
timeout-minutes: 20
22+
outputs:
23+
cache_key: wolfprov-${{ inputs.wolfssl_ref }}-${{ github.sha }}
24+
steps:
25+
- name: Checkout wolfProvider
26+
uses: actions/checkout@v4
27+
28+
# Check if this version of wolfssl/wolfprovider has already been built,
29+
# mark to cache these items on post if we do end up building
30+
- name: Checking wolfSSL/wolfProvider in cache
31+
uses: actions/cache@v4
32+
id: wolfprov-cache
33+
with:
34+
path: |
35+
wolfssl-source
36+
wolfssl-install
37+
wolfprov-install
38+
provider.conf
39+
40+
key: wolfprov-${{ inputs.wolfssl_ref }}-${{ github.sha }}
41+
lookup-only: true
42+
43+
# If wolfssl/wolfprovider have not yet been built, pull ossl from cache
44+
- name: Checking OpenSSL in cache
45+
if: steps.wolfprov-cache.outputs.cache-hit != 'true'
46+
uses: actions/cache@v4
47+
id: openssl-cache
48+
with:
49+
path: |
50+
openssl-source
51+
openssl-install
52+
53+
key: ossl-depends-${{ inputs.openssl_ref }}-${{ github.sha }}
54+
lookup-only: true
55+
56+
# If not yet built this version, build it now
57+
- name: Build wolfProvider
58+
if: steps.wolfprov-cache.outputs.cache-hit != 'true'
59+
run: |
60+
OPENSSL_TAG=${{ inputs.openssl_ref }} WOLFSSL_TAG=${{ inputs.wolfssl_ref }} ./scripts/build-wolfprovider.sh
61+
62+
- name: Print errors
63+
if: ${{ failure() }}
64+
run: |
65+
if [ -f test-suite.log ] ; then
66+
cat test-suite.log
67+
fi

.github/workflows/common.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: Common Configuration
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
workflow_name:
7+
required: true
8+
type: string
9+
wolfssl_ref:
10+
required: true
11+
type: string
12+
openssl_ref:
13+
required: true
14+
type: string
15+
16+
jobs:
17+
common:
18+
name: Common Configuration
19+
runs-on: ubuntu-22.04
20+
steps:
21+
- name: Checkout wolfProvider
22+
uses: actions/checkout@v4
23+
24+
- name: Retrieving OpenSSL from cache
25+
uses: actions/cache/restore@v4
26+
id: openssl-cache
27+
with:
28+
path: |
29+
openssl-source
30+
openssl-install
31+
key: ossl-depends-${{ inputs.openssl_ref }}-${{ github.sha }}
32+
fail-on-cache-miss: true
33+
34+
- name: Retrieving wolfSSL/wolfProvider from cache
35+
uses: actions/cache/restore@v4
36+
id: wolfprov-cache
37+
with:
38+
path: |
39+
wolfssl-source
40+
wolfssl-install
41+
wolfprov-install
42+
provider.conf
43+
key: wolfprov-${{ inputs.wolfssl_ref }}-${{ github.sha }}
44+
fail-on-cache-miss: true

.github/workflows/curl.yml

Lines changed: 9 additions & 73 deletions
Original file line numberDiff line numberDiff line change
@@ -14,57 +14,14 @@ concurrency:
1414

1515
jobs:
1616
build_wolfprovider:
17-
name: Build wolfProvider
18-
runs-on: ubuntu-22.04
19-
timeout-minutes: 20
17+
uses: ./.github/workflows/build-wolfprovider.yml
18+
with:
19+
wolfssl_ref: ${{ matrix.wolfssl_ref }}
20+
openssl_ref: ${{ matrix.openssl_ref }}
2021
strategy:
2122
matrix:
2223
wolfssl_ref: [ 'master', 'v5.8.0-stable' ]
2324
openssl_ref: [ 'openssl-3.5.0' ]
24-
steps:
25-
- name: Checkout wolfProvider
26-
uses: actions/checkout@v4
27-
28-
# Check if this version of wolfssl/wolfprovider has already been built,
29-
# mark to cache these items on post if we do end up building
30-
- name: Checking wolfSSL/wolfProvider in cache
31-
uses: actions/cache@v4
32-
id: wolfprov-cache
33-
with:
34-
path: |
35-
wolfssl-source
36-
wolfssl-install
37-
wolfprov-install
38-
provider.conf
39-
40-
key: wolfprov-${{ matrix.wolfssl_ref }}-${{ github.sha }}
41-
lookup-only: true
42-
43-
# If wolfssl/wolfprovider have not yet been built, pull ossl from cache
44-
- name: Checking OpenSSL in cache
45-
if: steps.wolfprov-${{ matrix.wolfssl_ref }}-cache.hit != 'true'
46-
uses: actions/cache@v4
47-
id: openssl-cache
48-
with:
49-
path: |
50-
openssl-source
51-
openssl-install
52-
53-
key: ossl-depends-${{ matrix.openssl_ref }}-${{ github.sha }}
54-
lookup-only: true
55-
56-
# If not yet built this version, build it now
57-
- name: Build wolfProvider
58-
if: steps.wolfprov-${{ matrix.wolfssl_ref }}-cache.hit != 'true'
59-
run: |
60-
OPENSSL_TAG=${{ matrix.openssl_ref }} WOLFSSL_TAG=${{ matrix.wolfssl_ref }} ./scripts/build-wolfprovider.sh
61-
62-
- name: Print errors
63-
if: ${{ failure() }}
64-
run: |
65-
if [ -f test-suite.log ] ; then
66-
cat test-suite.log
67-
fi
6825

6926
test_curl:
7027
runs-on: ubuntu-22.04
@@ -81,34 +38,13 @@ jobs:
8138
- curl_ref: 'master'
8239
force_fail: 'WOLFPROV_FORCE_FAIL=1'
8340
steps:
84-
- name: Checkout wolfProvider
85-
uses: actions/checkout@v4
86-
87-
- name: Retrieving OpenSSL from cache
88-
uses: actions/cache/restore@v4
89-
id: openssl-cache
41+
- uses: ./.github/workflows/common.yml
9042
with:
91-
path: |
92-
openssl-source
93-
openssl-install
94-
95-
key: ossl-depends-${{ matrix.openssl_ref }}-${{ github.sha }}
96-
fail-on-cache-miss: true
97-
98-
- name: Retrieving wolfSSL/wolfProvider from cache
99-
uses: actions/cache/restore@v4
100-
id: wolfprov-cache
101-
with:
102-
path: |
103-
wolfssl-source
104-
wolfssl-install
105-
wolfprov-install
106-
provider.conf
107-
108-
key: wolfprov-${{ matrix.wolfssl_ref }}-${{ github.sha }}
109-
fail-on-cache-miss: true
43+
workflow_name: curl
44+
wolfssl_ref: ${{ matrix.wolfssl_ref }}
45+
openssl_ref: ${{ matrix.openssl_ref }}
11046

111-
- name: Install curl test dependencies
47+
- name: Install dependencies
11248
run: |
11349
sudo apt-get update
11450
sudo apt-get install nghttp2 libpsl5 libpsl-dev python3-impacket

.github/workflows/grpc.yml

Lines changed: 9 additions & 73 deletions
Original file line numberDiff line numberDiff line change
@@ -14,57 +14,14 @@ concurrency:
1414

1515
jobs:
1616
build_wolfprovider:
17-
name: Build wolfProvider
18-
runs-on: ubuntu-22.04
19-
timeout-minutes: 20
17+
uses: ./.github/workflows/build-wolfprovider.yml
18+
with:
19+
wolfssl_ref: ${{ matrix.wolfssl_ref }}
20+
openssl_ref: ${{ matrix.openssl_ref }}
2021
strategy:
2122
matrix:
2223
wolfssl_ref: [ 'master', 'v5.8.0-stable' ]
2324
openssl_ref: [ 'openssl-3.5.0' ]
24-
steps:
25-
- name: Checkout wolfProvider
26-
uses: actions/checkout@v4
27-
28-
# Check if this version of wolfssl/wolfprovider has already been built,
29-
# mark to cache these items on post if we do end up building
30-
- name: Checking wolfSSL/wolfProvider in cache
31-
uses: actions/cache@v4
32-
id: wolfprov-cache
33-
with:
34-
path: |
35-
wolfssl-source
36-
wolfssl-install
37-
wolfprov-install
38-
provider.conf
39-
40-
key: wolfprov-${{ matrix.wolfssl_ref }}-${{ github.sha }}
41-
lookup-only: true
42-
43-
# If wolfssl/wolfprovider have not yet been built, pull ossl from cache
44-
- name: Checking OpenSSL in cache
45-
if: steps.wolfprov-cache.outputs.cache-hit != 'true'
46-
uses: actions/cache@v4
47-
id: openssl-cache
48-
with:
49-
path: |
50-
openssl-source
51-
openssl-install
52-
53-
key: ossl-depends-${{ matrix.openssl_ref }}-${{ github.sha }}
54-
lookup-only: true
55-
56-
# If not yet built this version, build it now
57-
- name: Build wolfProvider
58-
if: steps.wolfprov-cache.outputs.cache-hit != 'true'
59-
run: |
60-
OPENSSL_TAG=${{ matrix.openssl_ref }} WOLFSSL_TAG=${{ matrix.wolfssl_ref }} ./scripts/build-wolfprovider.sh
61-
62-
- name: Print errors
63-
if: ${{ failure() }}
64-
run: |
65-
if [ -f test-suite.log ] ; then
66-
cat test-suite.log
67-
fi
6825

6926
test_grpc:
7027
runs-on: ubuntu-22.04
@@ -85,38 +42,17 @@ jobs:
8542
wolfssl_ref: [ 'master', 'v5.8.0-stable' ]
8643
openssl_ref: [ 'openssl-3.5.0' ]
8744
steps:
88-
- name: Checkout wolfProvider
89-
uses: actions/checkout@v4
45+
- uses: ./.github/workflows/common.yml
46+
with:
47+
workflow_name: grpc
48+
wolfssl_ref: ${{ matrix.wolfssl_ref }}
49+
openssl_ref: ${{ matrix.openssl_ref }}
9050

9151
- name: Confirm IPv4 and IPv6 support
9252
run: |
9353
ip addr list lo | grep 'inet '
9454
ip addr list lo | grep 'inet6 '
9555
96-
- name: Retrieving OpenSSL from cache
97-
uses: actions/cache/restore@v4
98-
id: openssl-cache
99-
with:
100-
path: |
101-
openssl-source
102-
openssl-install
103-
104-
key: ossl-depends-${{ matrix.openssl_ref }}-${{ github.sha }}
105-
fail-on-cache-miss: true
106-
107-
- name: Retrieving wolfSSL/wolfProvider from cache
108-
uses: actions/cache/restore@v4
109-
id: wolfprov-cache
110-
with:
111-
path: |
112-
wolfssl-source
113-
wolfssl-install
114-
wolfprov-install
115-
provider.conf
116-
117-
key: wolfprov-${{ matrix.wolfssl_ref }}-${{ github.sha }}
118-
fail-on-cache-miss: true
119-
12056
- name: Install prerequisites
12157
run: |
12258
sudo apt-get update

0 commit comments

Comments
 (0)