Skip to content

Commit fbb06b5

Browse files
committed
Add support for testing the cjose project
1 parent 76f15e4 commit fbb06b5

File tree

1 file changed

+109
-0
lines changed

1 file changed

+109
-0
lines changed

.github/workflows/cjose.yml

Lines changed: 109 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
1+
name: cjose 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+
uses: ./.github/workflows/build-wolfprovider.yml
18+
with:
19+
wolfssl_ref: ${{ matrix.wolfssl_ref }}
20+
openssl_ref: ${{ matrix.openssl_ref }}
21+
strategy:
22+
matrix:
23+
wolfssl_ref: [ 'master', 'v5.8.0-stable' ]
24+
openssl_ref: [ 'openssl-3.5.0' ]
25+
26+
test_cjose:
27+
runs-on: ubuntu-22.04
28+
needs: build_wolfprovider
29+
# This should be a safe limit for the tests to run.
30+
timeout-minutes: 20
31+
strategy:
32+
matrix:
33+
cjose_ref: [ 'master', 'v0.6.2.1' ]
34+
wolfssl_ref: [ 'master', 'v5.8.0-stable' ]
35+
openssl_ref: [ 'openssl-3.5.0' ]
36+
force_fail: [ 'WOLFPROV_FORCE_FAIL=1', '' ]
37+
steps:
38+
# Checkout the source so we can run the check-workflow-result script
39+
- name: Checkout wolfProvider
40+
uses: actions/checkout@v4
41+
with:
42+
sparse-checkout: |
43+
.github
44+
45+
- name: Retrieving OpenSSL from cache
46+
uses: actions/cache/restore@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+
fail-on-cache-miss: true
55+
56+
- name: Retrieving wolfSSL/wolfProvider from cache
57+
uses: actions/cache/restore@v4
58+
id: wolfprov-cache
59+
with:
60+
path: |
61+
wolfssl-source
62+
wolfssl-install
63+
wolfprov-install
64+
provider.conf
65+
66+
key: wolfprov-${{ matrix.wolfssl_ref }}-${{ github.sha }}
67+
fail-on-cache-miss: true
68+
69+
- name: Install cjose dependencies
70+
run: |
71+
sudo apt-get update
72+
sudo apt-get install build-essential autoconf libtool pkg-config clang libc++-dev
73+
sudo apt-get install libjansson-dev check
74+
75+
- name: Download cjose
76+
uses: actions/checkout@v4
77+
with:
78+
repository: OpenIDC/cjose
79+
ref: ${{ matrix.cjose_ref }}
80+
path: cjose
81+
82+
- name: Build cjose
83+
working-directory: cjose
84+
run: |
85+
# Configure with OpenSSL
86+
./configure CFLAGS="-Wno-error=deprecated-declarations" --with-openssl=/git/wolfProvider/openssl-install
87+
88+
# Build cjose
89+
make
90+
91+
- name: Run cjose tests
92+
working-directory: cjose
93+
run: |
94+
# Set up the environment for wolfProvider
95+
export LD_LIBRARY_PATH=$GITHUB_WORKSPACE/wolfssl-install/lib:$GITHUB_WORKSPACE/openssl-install/lib64
96+
export OPENSSL_CONF=$GITHUB_WORKSPACE/provider.conf
97+
export OPENSSL_MODULES=$GITHUB_WORKSPACE/wolfprov-install/lib
98+
export ${{ matrix.force_fail }}
99+
export SHELL=/bin/bash
100+
101+
# Verify OpenSSL loads wolfProvider
102+
$GITHUB_WORKSPACE/openssl-install/bin/openssl list -providers | grep libwolfprov
103+
104+
# Run tests
105+
make test || true
106+
107+
# Capture result
108+
TEST_RESULT=$(tail -1 ./test/check_cjose.log | grep PASS; echo $?)
109+
$GITHUB_WORKSPACE/.github/scripts/check-workflow-result.sh $TEST_RESULT ${{ matrix.force_fail }} cjose

0 commit comments

Comments
 (0)