Skip to content

Commit 04f33ee

Browse files
committed
ppp workflow
1 parent 664b75a commit 04f33ee

File tree

1 file changed

+106
-0
lines changed

1 file changed

+106
-0
lines changed

.github/workflows/ppp.yml

Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
name: PPP Tests
2+
3+
on:
4+
push:
5+
branches: [ 'master', 'main', 'release/**' ]
6+
pull_request:
7+
branches: [ '*' ]
8+
9+
concurrency:
10+
group: ${{ github.workflow }}-${{ github.ref }}
11+
cancel-in-progress: true
12+
13+
jobs:
14+
build_wolfprovider:
15+
uses: ./.github/workflows/build-wolfprovider.yml
16+
with:
17+
wolfssl_ref: ${{ matrix.wolfssl_ref }}
18+
openssl_ref: ${{ matrix.openssl_ref }}
19+
strategy:
20+
matrix:
21+
wolfssl_ref: [ 'master', 'v5.8.0-stable' ]
22+
openssl_ref: [ 'openssl-3.5.0' ]
23+
24+
test_ppp:
25+
runs-on: ubuntu-22.04
26+
needs: build_wolfprovider
27+
timeout-minutes: 15
28+
strategy:
29+
matrix:
30+
wolfssl_ref: [ 'master', 'v5.8.0-stable' ]
31+
openssl_ref: [ 'openssl-3.5.0' ]
32+
#Switched to v2.5.2 due to significant limitations with v2.4.9, specifically the lack of a test suite, necessary configure options, and compatibility with newer versions of openssl
33+
ppp_ref: [ 'master', 'v2.5.2' ]
34+
force_fail: [ 'WOLFPROV_FORCE_FAIL=1', '' ]
35+
exclude:
36+
- ppp_ref: 'master'
37+
force_fail: 'WOLFPROV_FORCE_FAIL=1'
38+
39+
steps:
40+
# Checkout the source so we can run the check-workflow-result script
41+
- name: Checkout wolfProvider
42+
uses: actions/checkout@v4
43+
with:
44+
fetch-depth: 1
45+
46+
- name: Retrieving wolfProvider from cache
47+
uses: actions/cache/restore@v4
48+
id: wolfprov-cache-restore
49+
with:
50+
path: |
51+
wolfssl-install
52+
wolfprov-install
53+
openssl-install/lib64
54+
openssl-install/include
55+
openssl-install/bin
56+
key: wolfprov-${{ matrix.wolfssl_ref }}-${{ matrix.openssl_ref }}-${{ github.sha }}
57+
fail-on-cache-miss: true
58+
59+
- name: Checkout PPP
60+
uses: actions/checkout@v4
61+
with:
62+
repository: ppp-project/ppp
63+
path: ppp_repo
64+
ref: ${{ matrix.ppp_ref }}
65+
fetch-depth: 1
66+
67+
- name: Apply PPP compatibility fixes for OpenSSL 3.x
68+
working-directory: ppp_repo
69+
run: |
70+
# Disable testing of legacy algorithms
71+
for fn in PPP_crypto_init PPP_crypto_deinit test_md4 test_des_encrypt test_des_decrypt; do
72+
perl -0777 -pi -e '
73+
s/\bint\s+'$fn'\s*\([^)]*\)/int '$fn'() { return 1; }\nint __attribute__((unused)) __replaced_'$fn'()/g
74+
' pppd/crypto.c
75+
done
76+
77+
- name: Build and install PPP
78+
working-directory: ppp_repo
79+
run: |
80+
if [ -f ./autogen.sh ]; then
81+
./autogen.sh
82+
elif [ ! -f ./configure ]; then
83+
autoreconf -fiv
84+
fi
85+
CPPFLAGS="-I$GITHUB_WORKSPACE/openssl-install/include" ./configure --prefix=$GITHUB_WORKSPACE/ppp-install --with-openssl=$GITHUB_WORKSPACE/openssl-install --disable-microsoft-extensions
86+
make -j$(nproc)
87+
make install
88+
89+
- name: Run PPP tests
90+
working-directory: ppp_repo
91+
run: |
92+
# Set up the environment for wolfProvider
93+
source $GITHUB_WORKSPACE/scripts/env-setup
94+
export ${{ matrix.force_fail }}
95+
96+
# Run tests
97+
make check 2>&1 | tee ppp-test.log
98+
99+
# Check test results directly in YAML
100+
if grep -q "# FAIL: 0" pppd/test-suite.log; then
101+
TEST_RESULT=0
102+
else
103+
TEST_RESULT=1
104+
fi
105+
106+
$GITHUB_WORKSPACE/.github/scripts/check-workflow-result.sh $TEST_RESULT ${{ matrix.force_fail }} ppp

0 commit comments

Comments
 (0)