@@ -16,13 +16,15 @@ jobs:
1616 runs-on : ubuntu-latest
1717 outputs :
1818 run_tests : ${{ steps.check.outputs.run_tests }}
19+ run_ssl_tests : ${{ steps.check.outputs.run_ssl_tests }}
1920 steps :
2021 - uses : actions/checkout@v2
2122 - name : Check for source changes
2223 id : check
2324 run : |
2425 if [ -z "$GITHUB_BASE_REF" ]; then
2526 echo '::set-output name=run_tests::true'
27+ echo '::set-output name=run_ssl_tests::true'
2628 else
2729 git fetch origin $GITHUB_BASE_REF --depth=1
2830 # git diff "origin/$GITHUB_BASE_REF..." (3 dots) may be more
3941 #
4042 # https://github.com/python/core-workflow/issues/373
4143 git diff --name-only origin/$GITHUB_BASE_REF.. | grep -qvE '(\.rst$|^Doc|^Misc)' && echo '::set-output name=run_tests::true' || true
44+ git diff --name-only origin/$GITHUB_BASE_REF.. | grep -qE '(ssl|hashlib|hmac|^.github)' && echo '::set-output name=run_ssl_tests::true' || true
4245 fi
4346
4447 check_abi :
@@ -145,6 +148,11 @@ jobs:
145148 - uses : actions/checkout@v2
146149 - name : Install Dependencies
147150 run : sudo ./.github/workflows/posix-deps-apt.sh
151+ - name : Configure OpenSSL env vars
152+ run : |
153+ echo "MULTISSL_DIR=${GITHUB_WORKSPACE}/multissl" >> $GITHUB_ENV
154+ echo "OPENSSL_DIR=${GITHUB_WORKSPACE}/multissl/openssl/${OPENSSL_VER}" >> $GITHUB_ENV
155+ echo "LD_LIBRARY_PATH=${GITHUB_WORKSPACE}/multissl/openssl/${OPENSSL_VER}/lib" >> $GITHUB_ENV
148156 - name : ' Restore OpenSSL build'
149157 id : cache-openssl
150158 uses : actions/cache@v2.1.3
@@ -153,12 +161,63 @@ jobs:
153161 key : ${{ runner.os }}-multissl-openssl-${{ env.OPENSSL_VER }}
154162 - name : Install OpenSSL
155163 if : steps.cache-openssl.outputs.cache-hit != 'true'
156- run : python3 Tools/ssl/multissltests.py --steps=library --base-directory $PWD/multissl --openssl $OPENSSL_VER --system Linux
164+ run : python3 Tools/ssl/multissltests.py --steps=library --base-directory $MULTISSL_DIR --openssl $OPENSSL_VER --system Linux
165+ - name : Add ccache to PATH
166+ run : |
167+ echo "PATH=/usr/lib/ccache:$PATH" >> $GITHUB_ENV
168+ - name : Configure ccache action
169+ uses : hendrikmuhs/ccache-action@v1
157170 - name : Configure CPython
158- run : ./configure --with-pydebug --with-openssl=$PWD/multissl/openssl/$OPENSSL_VER
171+ run : ./configure --with-pydebug --with-openssl=$OPENSSL_DIR
159172 - name : Build CPython
160173 run : make -j4
161174 - name : Display build info
162175 run : make pythoninfo
163176 - name : Tests
164177 run : xvfb-run make buildbottest TESTOPTS="-j4 -uall,-cpu"
178+
179+ build_ubuntu_ssltests :
180+ name : ' Ubuntu SSL tests with OpenSSL ${{ matrix.openssl_ver }}'
181+ runs-on : ubuntu-20.04
182+ needs : check_source
183+ if : needs.check_source.outputs.run_tests == 'true' && needs.check_source.outputs.run_ssl_tests == 'true'
184+ strategy :
185+ fail-fast : false
186+ matrix :
187+ openssl_ver : [1.0.2u, 1.1.0l, 1.1.1k, 3.0.0-alpha14]
188+ env :
189+ OPENSSL_VER : ${{ matrix.openssl_ver }}
190+ MULTISSL_DIR : ${{ github.workspace }}/multissl
191+ OPENSSL_DIR : ${{ github.workspace }}/multissl/openssl/${{ matrix.openssl_ver }}
192+ LD_LIBRARY_PATH : ${{ github.workspace }}/multissl/openssl/${{ matrix.openssl_ver }}/lib
193+ steps :
194+ - uses : actions/checkout@v2
195+ - name : Install Dependencies
196+ run : sudo ./.github/workflows/posix-deps-apt.sh
197+ - name : Configure OpenSSL env vars
198+ run : |
199+ echo "MULTISSL_DIR=${GITHUB_WORKSPACE}/multissl" >> $GITHUB_ENV
200+ echo "OPENSSL_DIR=${GITHUB_WORKSPACE}/multissl/openssl/${OPENSSL_VER}" >> $GITHUB_ENV
201+ echo "LD_LIBRARY_PATH=${GITHUB_WORKSPACE}/multissl/openssl/${OPENSSL_VER}/lib" >> $GITHUB_ENV
202+ - name : ' Restore OpenSSL build'
203+ id : cache-openssl
204+ uses : actions/cache@v2.1.4
205+ with :
206+ path : ./multissl/openssl/${{ env.OPENSSL_VER }}
207+ key : ${{ runner.os }}-multissl-openssl-${{ env.OPENSSL_VER }}
208+ - name : Install OpenSSL
209+ if : steps.cache-openssl.outputs.cache-hit != 'true'
210+ run : python3 Tools/ssl/multissltests.py --steps=library --base-directory $MULTISSL_DIR --openssl $OPENSSL_VER --system Linux
211+ - name : Add ccache to PATH
212+ run : |
213+ echo "PATH=/usr/lib/ccache:$PATH" >> $GITHUB_ENV
214+ - name : Configure ccache action
215+ uses : hendrikmuhs/ccache-action@v1
216+ - name : Configure CPython
217+ run : ./configure --with-pydebug --with-openssl=$OPENSSL_DIR
218+ - name : Build CPython
219+ run : make -j4
220+ - name : Display build info
221+ run : make pythoninfo
222+ - name : SSL tests
223+ run : ./python Lib/test/ssltests.py
0 commit comments