Skip to content

Commit e78adc0

Browse files
authored
Merge pull request #98 from aidangarske/stunnel-workflow
stunnel.yml - CI github workflow
2 parents 93eee96 + c117a28 commit e78adc0

File tree

1 file changed

+127
-0
lines changed

1 file changed

+127
-0
lines changed

.github/workflows/stunnel.yml

Lines changed: 127 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,127 @@
1+
name: Stunnel Tests
2+
3+
# START OF COMMON SECTION
4+
on:
5+
push:
6+
branches: [ 'master', 'main', 'release/**' ]
7+
pull_request:
8+
branches: [ '*' ]
9+
10+
concurrency:
11+
group: ${{ github.workflow }}-${{ github.ref }}
12+
cancel-in-progress: true
13+
# END OF COMMON SECTION
14+
15+
jobs:
16+
build_wolfprovider:
17+
name: Build wolfProvider
18+
runs-on: ubuntu-22.04
19+
timeout-minutes: 10
20+
strategy:
21+
matrix:
22+
wolfssl_ref: [ 'master', 'v5.7.4-stable' ]
23+
steps:
24+
- name: Checkout wolfProvider
25+
uses: actions/checkout@v4
26+
27+
# Check if this version of wolfssl/wolfprovider has already been built,
28+
# mark to cache these items on post if we do end up building
29+
- name: Checking wolfSSL/wolfProvider in cache
30+
uses: actions/cache@v4
31+
id: wolfprov-cache
32+
with:
33+
path: |
34+
wolfssl-source
35+
wolfssl-install
36+
wolfprov-install
37+
provider.conf
38+
39+
key: wolfprov-${{ matrix.wolfssl_ref }}-${{ github.sha }}
40+
lookup-only: true
41+
42+
# If wolfssl/wolfprovider have not yet been built, pull ossl from cache
43+
- name: Checking OpenSSL in cache
44+
if: steps.wolfprov-${{ matrix.wolfssl_ref }}-cache.hit != 'true'
45+
uses: actions/cache@v4
46+
id: openssl-cache
47+
with:
48+
path: |
49+
openssl-source
50+
openssl-install
51+
52+
key: ossl-depends
53+
54+
# If not yet built this version, build it now
55+
- name: Build wolfProvider
56+
if: steps.wolfprov-${{ matrix.wolfssl_ref }}-cache.hit != 'true'
57+
run: |
58+
WOLFSSL_TAG=${{ matrix.wolfssl_ref }} ./scripts/build-wolfprovider.sh
59+
60+
- name: Print errors
61+
if: ${{ failure() }}
62+
run: |
63+
if [ -f test-suite.log ] ; then
64+
cat test-suite.log
65+
fi
66+
67+
test_stunnel:
68+
runs-on: ubuntu-22.04
69+
needs: build_wolfprovider
70+
# This should be a safe limit for the tests to run.
71+
timeout-minutes: 10
72+
strategy:
73+
matrix:
74+
stunnel_ref: [ 5.67 ]
75+
wolfssl_ref: [ 'master', 'v5.7.4-stable' ]
76+
steps:
77+
- name: Retrieving OpenSSL from cache
78+
uses: actions/cache/restore@v4
79+
id: openssl-cache
80+
with:
81+
path: |
82+
openssl-source
83+
openssl-install
84+
85+
key: ossl-depends
86+
fail-on-cache-miss: true
87+
88+
- name: Retrieving wolfSSL/wolfProvider from cache
89+
uses: actions/cache/restore@v4
90+
id: wolfprov-cache
91+
with:
92+
path: |
93+
wolfssl-source
94+
wolfssl-install
95+
wolfprov-install
96+
provider.conf
97+
98+
key: wolfprov-${{ matrix.wolfssl_ref }}-${{ github.sha }}
99+
fail-on-cache-miss: true
100+
101+
- name: Install dependencies
102+
run: |
103+
sudo apt-get update
104+
sudo apt-get install -y build-essential autoconf automake \
105+
libtool pkg-config libwrap0-dev autoconf-archive \
106+
autotools-dev m4
107+
108+
- name: Build stunnel
109+
uses: wolfSSL/actions-build-autotools-project@v1
110+
with:
111+
repository: mtrojnar/stunnel
112+
ref: stunnel-${{ matrix.stunnel_ref }}
113+
path: stunnel
114+
configure: --with-ssl=$GITHUB_WORKSPACE/openssl-install/
115+
check: true
116+
117+
- name: Verify stunnel with wolfProvider
118+
working-directory: ./stunnel
119+
run: |
120+
# Setup environment for wolfProvider
121+
export LD_LIBRARY_PATH=$GITHUB_WORKSPACE/wolfssl-install/lib:$GITHUB_WORKSPACE/openssl-install/lib64
122+
export OPENSSL_CONF=$GITHUB_WORKSPACE/provider.conf
123+
export OPENSSL_MODULES=$GITHUB_WORKSPACE/wolfprov-install/lib
124+
125+
# Verify stunnel
126+
ldd src/stunnel | grep -E '(libssl|libcrypto)'
127+
./src/stunnel -version

0 commit comments

Comments
 (0)