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