Skip to content
Snippets Groups Projects
Commit ade1c1220676 authored by Christian Heimes's avatar Christian Heimes
Browse files

bpo-43811: Test multiple OpenSSL versions on GHA (GH-25360)




The new checks are only executed when one or more OpenSSL-related files are modified. The checks run a handful of networking and hashing test suites. All SSL checks are optional. This PR also introduces ccache to speed up compilation. In common cases it speeds up configure and compile time from about 90 seconds to less than 30 seconds.

Signed-off-by: default avatarChristian Heimes <christian@python.org>
parent 8c1ed915d32a
No related branches found
No related tags found
No related merge requests found
...@@ -23,6 +23,7 @@ ...@@ -23,6 +23,7 @@
runs-on: ubuntu-latest runs-on: ubuntu-latest
outputs: outputs:
run_tests: ${{ steps.check.outputs.run_tests }} run_tests: ${{ steps.check.outputs.run_tests }}
run_ssl_tests: ${{ steps.check.outputs.run_ssl_tests }}
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
- name: Check for source changes - name: Check for source changes
...@@ -30,6 +31,7 @@ ...@@ -30,6 +31,7 @@
run: | run: |
if [ -z "$GITHUB_BASE_REF" ]; then if [ -z "$GITHUB_BASE_REF" ]; then
echo '::set-output name=run_tests::true' echo '::set-output name=run_tests::true'
echo '::set-output name=run_ssl_tests::true'
else else
git fetch origin $GITHUB_BASE_REF --depth=1 git fetch origin $GITHUB_BASE_REF --depth=1
# git diff "origin/$GITHUB_BASE_REF..." (3 dots) may be more # git diff "origin/$GITHUB_BASE_REF..." (3 dots) may be more
...@@ -46,6 +48,7 @@ ...@@ -46,6 +48,7 @@
# #
# https://github.com/python/core-workflow/issues/373 # https://github.com/python/core-workflow/issues/373
git diff --name-only origin/$GITHUB_BASE_REF.. | grep -qvE '(\.rst$|^Doc|^Misc)' && echo '::set-output name=run_tests::true' || true git diff --name-only origin/$GITHUB_BASE_REF.. | grep -qvE '(\.rst$|^Doc|^Misc)' && echo '::set-output name=run_tests::true' || true
git diff --name-only origin/$GITHUB_BASE_REF.. | grep -qE '(ssl|hashlib|hmac|^.github)' && echo '::set-output name=run_ssl_tests::true' || true
fi fi
check_generated_files: check_generated_files:
...@@ -138,6 +141,11 @@ ...@@ -138,6 +141,11 @@
run: echo "::add-matcher::.github/problem-matchers/gcc.json" run: echo "::add-matcher::.github/problem-matchers/gcc.json"
- name: Install Dependencies - name: Install Dependencies
run: sudo ./.github/workflows/posix-deps-apt.sh run: sudo ./.github/workflows/posix-deps-apt.sh
- name: Configure OpenSSL env vars
run: |
echo "MULTISSL_DIR=${GITHUB_WORKSPACE}/multissl" >> $GITHUB_ENV
echo "OPENSSL_DIR=${GITHUB_WORKSPACE}/multissl/openssl/${OPENSSL_VER}" >> $GITHUB_ENV
echo "LD_LIBRARY_PATH=${GITHUB_WORKSPACE}/multissl/openssl/${OPENSSL_VER}/lib" >> $GITHUB_ENV
- name: 'Restore OpenSSL build' - name: 'Restore OpenSSL build'
id: cache-openssl id: cache-openssl
uses: actions/cache@v2.1.4 uses: actions/cache@v2.1.4
...@@ -146,5 +154,10 @@ ...@@ -146,5 +154,10 @@
key: ${{ runner.os }}-multissl-openssl-${{ env.OPENSSL_VER }} key: ${{ runner.os }}-multissl-openssl-${{ env.OPENSSL_VER }}
- name: Install OpenSSL - name: Install OpenSSL
if: steps.cache-openssl.outputs.cache-hit != 'true' if: steps.cache-openssl.outputs.cache-hit != 'true'
run: python3 Tools/ssl/multissltests.py --steps=library --base-directory $PWD/multissl --openssl $OPENSSL_VER --system Linux run: python3 Tools/ssl/multissltests.py --steps=library --base-directory $MULTISSL_DIR --openssl $OPENSSL_VER --system Linux
- name: Add ccache to PATH
run: |
echo "PATH=/usr/lib/ccache:$PATH" >> $GITHUB_ENV
- name: Configure ccache action
uses: hendrikmuhs/ccache-action@v1
- name: Configure CPython - name: Configure CPython
...@@ -150,8 +163,8 @@ ...@@ -150,8 +163,8 @@
- name: Configure CPython - name: Configure CPython
run: ./configure --with-pydebug --with-openssl=$PWD/multissl/openssl/$OPENSSL_VER run: ./configure --with-pydebug --with-openssl=$OPENSSL_DIR
- name: Build CPython - name: Build CPython
run: make -j4 run: make -j4
- name: Display build info - name: Display build info
run: make pythoninfo run: make pythoninfo
- name: Tests - name: Tests
run: xvfb-run make buildbottest TESTOPTS="-j4 -uall,-cpu" run: xvfb-run make buildbottest TESTOPTS="-j4 -uall,-cpu"
...@@ -152,6 +165,54 @@ ...@@ -152,6 +165,54 @@
- name: Build CPython - name: Build CPython
run: make -j4 run: make -j4
- name: Display build info - name: Display build info
run: make pythoninfo run: make pythoninfo
- name: Tests - name: Tests
run: xvfb-run make buildbottest TESTOPTS="-j4 -uall,-cpu" run: xvfb-run make buildbottest TESTOPTS="-j4 -uall,-cpu"
build_ubuntu_ssltests:
name: 'Ubuntu SSL tests with OpenSSL ${{ matrix.openssl_ver }}'
runs-on: ubuntu-20.04
needs: check_source
if: needs.check_source.outputs.run_tests == 'true' && needs.check_source.outputs.run_ssl_tests == 'true'
strategy:
fail-fast: false
matrix:
openssl_ver: [1.0.2u, 1.1.0l, 1.1.1k, 3.0.0-alpha14]
env:
OPENSSL_VER: ${{ matrix.openssl_ver }}
MULTISSL_DIR: ${{ github.workspace }}/multissl
OPENSSL_DIR: ${{ github.workspace }}/multissl/openssl/${{ matrix.openssl_ver }}
LD_LIBRARY_PATH: ${{ github.workspace }}/multissl/openssl/${{ matrix.openssl_ver }}/lib
steps:
- uses: actions/checkout@v2
- name: Register gcc problem matcher
run: echo "::add-matcher::.github/problem-matchers/gcc.json"
- name: Install Dependencies
run: sudo ./.github/workflows/posix-deps-apt.sh
- name: Configure OpenSSL env vars
run: |
echo "MULTISSL_DIR=${GITHUB_WORKSPACE}/multissl" >> $GITHUB_ENV
echo "OPENSSL_DIR=${GITHUB_WORKSPACE}/multissl/openssl/${OPENSSL_VER}" >> $GITHUB_ENV
echo "LD_LIBRARY_PATH=${GITHUB_WORKSPACE}/multissl/openssl/${OPENSSL_VER}/lib" >> $GITHUB_ENV
- name: 'Restore OpenSSL build'
id: cache-openssl
uses: actions/cache@v2.1.4
with:
path: ./multissl/openssl/${{ env.OPENSSL_VER }}
key: ${{ runner.os }}-multissl-openssl-${{ env.OPENSSL_VER }}
- name: Install OpenSSL
if: steps.cache-openssl.outputs.cache-hit != 'true'
run: python3 Tools/ssl/multissltests.py --steps=library --base-directory $MULTISSL_DIR --openssl $OPENSSL_VER --system Linux
- name: Add ccache to PATH
run: |
echo "PATH=/usr/lib/ccache:$PATH" >> $GITHUB_ENV
- name: Configure ccache action
uses: hendrikmuhs/ccache-action@v1
- name: Configure CPython
run: ./configure --with-pydebug --with-openssl=$OPENSSL_DIR
- name: Build CPython
run: make -j4
- name: Display build info
run: make pythoninfo
- name: SSL tests
run: ./python Lib/test/ssltests.py
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
apt-get -yq install \ apt-get -yq install \
build-essential \ build-essential \
ccache \
gdb \ gdb \
lcov \ lcov \
libbz2-dev \ libbz2-dev \
......
Tests multiple OpenSSL versions on GitHub Actions. Use ccache to speed up
testing.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment