8000 bpo-43811: Test multiple OpenSSL versions on GHA · python/cpython@771ad62 · GitHub
[go: up one dir, main page]

Skip to content

Commit 771ad62

Browse files
committed
bpo-43811: Test multiple OpenSSL versions on GHA
Signed-off-by: Christian Heimes <christian@python.org>
1 parent a483388 commit 771ad62

File tree

3 files changed

+63
-2
lines changed

3 files changed

+63
-2
lines changed

.github/workflows/build.yml

Lines changed: 60 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,11 @@ jobs:
138138
run: echo "::add-matcher::.github/problem-matchers/gcc.json"
139139
- name: Install Dependencies
140140
run: sudo ./.github/workflows/posix-deps-apt.sh
141+
- name: Configure OpenSSL env vars
142+
run: |
143+
echo "MULTISSL_DIR=${GITHUB_WORKSPACE}/multissl" >> $GITHUB_ENV
144+
echo "OPENSSL_DIR=${GITHUB_WORKSPACE}/multissl/openssl/${OPENSSL_VER}" >> $GITHUB_ENV
145+
echo "LD_LIBRARY_PATH=${GITHUB_WORKSPACE}/multissl/openssl/${OPENSSL_VER}/lib" >> $GITHUB_ENV
141146
- name: 'Restore OpenSSL build'
142147
id: cache-openssl
143148
uses: actions/cache@v2.1.4
@@ -146,12 +151,65 @@ jobs:
146151
key: ${{ runner.os }}-multissl-openssl-${{ env.OPENSSL_VER }}
147152
- name: Install OpenSSL
148153
if: steps.cache-openssl.outputs.cache-hit != 'true'
149-
run: python3 Tools/ssl/multissltests.py --steps=library --base-directory $PWD/multissl --openssl $OPENSSL_VER --system Linux
154+
run: python3 Tools/ssl/multissltests.py --steps=library --base-directory $MULTISSL_DIR --openssl $OPENSSL_VER --system Linux
155+
- name: Add ccache to PATH
156+
run: |
157+
echo "PATH=/usr/lib/ccache:$PATH" >> $GITHUB_ENV
158+
- name: Configure ccache action
159+
uses: hendrikmuhs/ccache-action@v1
150160
- name: Configure CPython
151-
run: ./configure --with-pydebug --with-openssl=$PWD/multissl/openssl/$OPENSSL_VER
161+
run: ./configure --with-pydebug --with-openssl=$OPENSSL_DIR
152162
- name: Build CPython
153163
run: make -j4
154164
- name: Display build info
155165
run: make pythoninfo
156166
- name: Tests
157167
run: xvfb-run make buildbottest TESTOPTS="-j4 -uall,-cpu"
168+
169+
build_ubuntu_ssltests:
170+
name: 'Ubuntu SSL tests with OpenSSL ${{ matrix.openssl_ver }}'
171+
runs-on: ubuntu-20.04
172+
needs: check_source
173+
if: needs.check_source.outputs.run_tests == 'true'
174+
strategy:
175+
fail-fast: false
176+
matrix:
177+
openssl_ver: [1.0.2u, 1.1.0l, 1.1.1k, 3.0.0-alpha14]
178+
env:
179+
OPENSSL_VER: ${{ matrix.openssl_ver }}
180+
MULTISSL_DIR: ${{ github.workspace }}/multissl
181+
OPENSSL_DIR: ${{ github.workspace }}/multissl/openssl/${{ matrix.openssl_ver }}
182+
LD_LIBRARY_PATH: ${{ github.workspace }}/multissl/openssl/${{ matrix.openssl_ver }}/lib
183+
steps:
184+
- uses: actions/checkout@v2
185+
- name: Register gcc problem matcher
186+
run: echo "::add-matcher::.github/problem-matchers/gcc.json"
187+
- name: Install Dependencies
188+
run: sudo ./.github/workflows/posix-deps-apt.sh
189+
- name: Configure OpenSSL env vars
190+
run: |
191+
echo "MULTISSL_DIR=${GITHUB_WORKSPACE}/multissl" >> $GITHUB_ENV
192+
echo "OPENSSL_DIR=${GITHUB_WORKSPACE}/multissl/openssl/${OPENSSL_VER}" >> $GITHUB_ENV
193+
echo "LD_LIBRARY_PATH=${GITHUB_WORKSPACE}/multissl/openssl/${OPENSSL_VER}/lib" >> $GITHUB_ENV
194+
- name: 'Restore OpenSSL build'
195+
id: cache-openssl
196+
uses: actions/cache@v2.1.4
197+
with:
198+
path: ./multissl/openssl/${{ env.OPENSSL_VER }}
199+
key: ${{ runner.os }}-multissl-openssl-${{ env.OPENSSL_VER }}
200+
- name: Install OpenSSL
201+
if: steps.cache-openssl.outputs.cache-hit != 'true'
202+
run: python3 Tools/ssl/multissltests.py --steps=library --base-directory $MULTISSL_DIR --openssl $OPENSSL_VER --system Linux
203+
- name: Add ccache to PATH
204+
run: |
205+
echo "PATH=/usr/lib/ccache:$PATH" >> $GITHUB_ENV
206+
- name: Configure ccache action
207+
uses: hendrikmuhs/ccache-action@v1
208+
- name: Configure CPython
209+
run: ./configure --with-pydebug --with-openssl=$OPENSSL_DIR
210+
- name: Build CPython
211+
run: make -j4
212+
- name: Display build info
213+
run: make pythoninfo
214+
- name: SSL tests
215+
run: ./python Lib/test/ssltests.py

.github/workflows/posix-deps-apt.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ apt-get update
33

44
apt-get -yq install \
55
build-essential \
6+
ccache \
67
gdb \
78
lcov \
89
libbz2-dev \
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Tests multiple OpenSSL versions on GitHub Actions. Use ccache to speed up
2+
testing.

0 commit comments

Comments
 (0)
0