Skip to content

Commit 9e48dcb

Browse files
committed
add python workflow
1 parent 707a45a commit 9e48dcb

1 file changed

Lines changed: 172 additions & 0 deletions

File tree

.github/workflows/python.yml

Lines changed: 172 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,172 @@
1+
name: Python Tests
2+
3+
# START OF COMMON SECTION
4+
on:
5+
push:
6+
# TODO restore `on` rules
7+
# branches: [ 'master', 'main', 'release/**' ]
8+
# pull_request:
9+
# branches: [ '*' ]
10+
11+
# concurrency:
12+
# group: ${{ github.workflow }}-${{ github.ref }}
13+
# cancel-in-progress: true
14+
# END OF COMMON SECTION
15+
16+
jobs:
17+
build_wolfssl:
18+
name: Build wolfSSL
19+
if: github.repository_owner == 'wolfssl'
20+
runs-on: ubuntu-24.04
21+
timeout-minutes: 10
22+
steps:
23+
- name: Build wolfSSL
24+
uses: wolfSSL/actions-build-autotools-project@v1
25+
with:
26+
path: wolfssl
27+
configure: >-
28+
--enable-all --enable-tlsv10
29+
'CPPFLAGS=-DHAVE_SECRET_CALLBACK -DWOLFSSL_PYTHON'
30+
check: false
31+
install: true
32+
33+
- name: tar build-dir
34+
run: tar -zcf build-dir.tgz build-dir
35+
36+
- name: Upload built lib
37+
uses: actions/upload-artifact@v4
38+
with:
39+
name: wolf-install-python
40+
path: build-dir.tgz
41+
retention-days: 5
42+
43+
python_check:
44+
strategy:
45+
fail-fast: false
46+
matrix:
47+
include:
48+
- python_ver: 3.12.11
49+
tests: >-
50+
test_ssl
51+
test.test_asyncio.test_ssl
52+
test.test_asyncio.test_sslproto
53+
test_hashlib
54+
test_hmac
55+
test_secrets
56+
test_ftplib
57+
test_imaplib
58+
test_poplib
59+
test_smtplib
60+
test_httplib
61+
test_urllib2_localnet
62+
test_xmlrpc
63+
test_docxmlrpc
64+
- python_ver: 3.13.4
65+
tests: >-
66+
test_ssl
67+
test.test_asyncio.test_ssl
68+
test.test_asyncio.test_sslproto
69+
test_hashlib
70+
test_hmac
71+
test_secrets
72+
test_ftplib
73+
test_imaplib
74+
test_poplib
75+
test_smtplib
76+
test_httplib
77+
test_urllib2_localnet
78+
test_xmlrpc
79+
test_docxmlrpc
80+
- python_ver: 3.13.7
81+
tests: >-
82+
test_ssl
83+
test.test_asyncio.test_ssl
84+
test.test_asyncio.test_sslproto
85+
test_hashlib
86+
test_hmac
87+
test_secrets
88+
test_ftplib
89+
test_imaplib
90+
test_poplib
91+
test_smtplib
92+
test_httplib
93+
test_urllib2_localnet
94+
test_xmlrpc
95+
test_docxmlrpc
96+
name: Python ${{ matrix.python_ver }}
97+
if: github.repository_owner == 'wolfssl'
98+
runs-on: ubuntu-24.04
99+
timeout-minutes: 60
100+
needs: build_wolfssl
101+
steps:
102+
- name: Install dependencies
103+
run: |
104+
sudo apt-get update
105+
sudo apt-get install -y \
106+
build-essential autoconf automake \
107+
libffi-dev libbz2-dev libreadline-dev libsqlite3-dev \
108+
zlib1g-dev libncursesw5-dev libgdbm-dev libnss3-dev \
109+
liblzma-dev uuid-dev
110+
111+
- name: Download wolfSSL
112+
uses: actions/download-artifact@v4
113+
with:
114+
name: wolf-install-python
115+
116+
- name: Untar wolfSSL build
117+
run: tar -xf build-dir.tgz
118+
119+
- name: Checkout OSP
120+
uses: actions/checkout@v4
121+
with:
122+
# TODO: change back to wolfssl/osp master when the PR is merged
123+
repository: julek-wolfssl/osp
124+
ref: python-3.13.4
125+
path: osp
126+
127+
- name: Checkout CPython
128+
uses: actions/checkout@v4
129+
with:
130+
repository: python/cpython
131+
ref: v${{ matrix.python_ver }}
132+
path: cpython
133+
134+
- name: Apply wolfSSL patch
135+
working-directory: cpython
136+
run: patch -p1 < $GITHUB_WORKSPACE/osp/Python/wolfssl-python-${{ matrix.python_ver }}.patch
137+
138+
- name: Build CPython
139+
working-directory: cpython
140+
run: |
141+
autoreconf -fi
142+
./configure --with-wolfssl=$GITHUB_WORKSPACE/build-dir
143+
144+
- name: Configure CPython with wolfSSL
145+
working-directory: cpython
146+
run: ./configure --with-wolfssl=$GITHUB_WORKSPACE/build-dir
147+
148+
- name: Build CPython
149+
working-directory: cpython
150+
run: make -j$(nproc)
151+
152+
- name: Build CPython and run SSL and crypto tests
153+
working-directory: cpython
154+
run: |
155+
export LD_LIBRARY_PATH=$GITHUB_WORKSPACE/build-dir/lib:$LD_LIBRARY_PATH
156+
autoreconf -fi
157+
./configure --with-wolfssl=$GITHUB_WORKSPACE/build-dir
158+
make test TESTOPTS="-v \
159+
test_ssl \
160+
test.test_asyncio.test_ssl \
161+
test.test_asyncio.test_sslproto \
162+
test_hashlib \
163+
test_hmac \
164+
test_secrets \
165+
test_ftplib \
166+
test_imaplib \
167+
test_poplib \
168+
test_smtplib \
169+
test_httplib \
170+
test_urllib2_localnet \
171+
test_xmlrpc \
172+
test_docxmlrpc"

0 commit comments

Comments
 (0)