Skip to content

Commit 1308aec

Browse files
authored
Merge pull request #103 from aidangarske/grpc-workflow
grpc.yml - CI github workflow
2 parents 8c58714 + 36efe09 commit 1308aec

File tree

1 file changed

+163
-0
lines changed

1 file changed

+163
-0
lines changed

.github/workflows/grpc.yml

Lines changed: 163 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,163 @@
1+
name: gRPC 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: 20
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-cache.outputs.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+
fail-on-cache-miss: false
54+
55+
# If not yet built this version, build it now
56+
- name: Build wolfProvider
57+
if: steps.wolfprov-cache.outputs.cache-hit != 'true'
58+
run: |
59+
WOLFSSL_TAG=${{ matrix.wolfssl_ref }} ./scripts/build-wolfprovider.sh
60+
61+
- name: Print errors
62+
if: ${{ failure() }}
63+
run: |
64+
if [ -f test-suite.log ] ; then
65+
cat test-suite.log
66+
fi
67+
68+
test_grpc:
69+
runs-on: ubuntu-22.04
70+
needs: build_wolfprovider
71+
# This should be a safe limit for the tests to run.
72+
timeout-minutes: 30
73+
strategy:
74+
fail-fast: false
75+
matrix:
76+
include:
77+
- ref: v1.60.0
78+
tests: >-
79+
bad_ssl_alpn_test bad_ssl_cert_test client_ssl_test
80+
crl_ssl_transport_security_test server_ssl_test
81+
ssl_transport_security_test ssl_transport_security_utils_test
82+
test_core_security_ssl_credentials_test test_cpp_end2end_ssl_credentials_test
83+
h2_ssl_cert_test h2_ssl_session_reuse_test
84+
wolfssl_ref: [ 'master', 'v5.7.4-stable' ]
85+
steps:
86+
- name: Confirm IPv4 and IPv6 support
87+
run: |
88+
ip addr list lo | grep 'inet '
89+
ip addr list lo | grep 'inet6 '
90+
91+
- name: Retrieving OpenSSL from cache
92+
uses: actions/cache/restore@v4
93+
id: openssl-cache
94+
with:
95+
path: |
96+
openssl-source
97+
openssl-install
98+
99+
key: ossl-depends
100+
fail-on-cache-miss: false
101+
102+
- name: Retrieving wolfSSL/wolfProvider from cache
103+
uses: actions/cache/restore@v4
104+
id: wolfprov-cache
105+
with:
106+
path: |
107+
wolfssl-source
108+
wolfssl-install
109+
wolfprov-install
110+
provider.conf
111+
112+
key: wolfprov-${{ matrix.wolfssl_ref }}-${{ github.sha }}
113+
fail-on-cache-miss: true
114+
115+
- name: Install prerequisites
116+
run: |
117+
sudo apt-get update
118+
sudo apt-get install -y build-essential autoconf libtool pkg-config clang libc++-dev
119+
120+
- name: Setup cmake version
121+
uses: jwlawson/actions-setup-cmake@v2
122+
with:
123+
cmake-version: '3.25.x'
124+
125+
- name: Checkout grpc
126+
uses: actions/checkout@v4
127+
with:
128+
repository: grpc/grpc
129+
path: grpc
130+
ref: ${{ matrix.ref }}
131+
132+
- name: Build grpc with wolfProvider
133+
working-directory: ./grpc
134+
run: |
135+
# Setup environment for wolfProviders
136+
export LD_LIBRARY_PATH=$GITHUB_WORKSPACE/wolfssl-install/lib:$GITHUB_WORKSPACE/openssl-install/lib64
137+
export OPENSSL_CONF=$GITHUB_WORKSPACE/provider.conf
138+
export OPENSSL_MODULES=$GITHUB_WORKSPACE/wolfprov-install/lib
139+
140+
# Initialize submodules
141+
git submodule update --init
142+
143+
# Build
144+
mkdir -p cmake/build
145+
cd cmake/build
146+
147+
# Configure with OpenSSL and wolfProvider
148+
cmake -DgRPC_BUILD_TESTS=ON -DgRPC_SSL_PROVIDER=package \
149+
-DOPENSSL_ROOT_DIR=$GITHUB_WORKSPACE/openssl-install ../..
150+
151+
# Build the tests
152+
make -j $(nproc) ${{ matrix.tests }}
153+
154+
- name: Run grpc tests with wolfProvider
155+
working-directory: ./grpc
156+
run: |
157+
# Start the port server
158+
./tools/run_tests/start_port_server.py
159+
160+
# Run the tests
161+
for t in ${{ matrix.tests }} ; do
162+
./cmake/build/$t
163+
done

0 commit comments

Comments
 (0)