11name : Tests
22
3- # bpo-40548: "paths-ignore" is not used to skip documentation-only PRs, because
4- # it prevents to mark a job as mandatory. A PR cannot be merged if a job is
5- # mandatory but not scheduled because of "paths-ignore".
63on :
4+ workflow_dispatch :
75 push :
86 branches :
9- - master
10- - 3.9
11- - 3.8
12- - 3.7
7+ - ' main'
8+ - ' 3.*'
139 pull_request :
1410 branches :
15- - master
16- - 3.9
17- - 3.8
18- - 3.7
11+ - ' main'
12+ - ' 3.*'
13+
14+ permissions :
15+ contents : read
16+
17+ concurrency :
18+ group : ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
19+ cancel-in-progress : true
20+
21+ env :
22+ FORCE_COLOR : 1
1923
2024jobs :
2125 check_source :
2226 name : ' Check for source changes'
2327 runs-on : ubuntu-latest
28+ timeout-minutes : 10
2429 outputs :
2530 run_tests : ${{ steps.check.outputs.run_tests }}
2631 run_ssl_tests : ${{ steps.check.outputs.run_ssl_tests }}
3035 id : check
3136 run : |
3237 if [ -z "$GITHUB_BASE_REF" ]; then
33- echo '::set-output name= run_tests:: true'
34- echo '::set-output name= run_ssl_tests:: true'
38+ echo " run_tests= true" >> $GITHUB_OUTPUT
39+ echo " run_ssl_tests= true" >> $GITHUB_OUTPUT
3540 else
3641 git fetch origin $GITHUB_BASE_REF --depth=1
3742 # git diff "origin/$GITHUB_BASE_REF..." (3 dots) may be more
@@ -47,19 +52,21 @@ jobs:
4752 # into the PR branch anyway.
4853 #
4954 # https://github.com/python/core-workflow/issues/373
50- git diff --name-only origin/$GITHUB_BASE_REF.. | grep -qvE '(\.rst$|^Doc|^Misc)' && echo '::set-output name= run_tests:: true' || true
51- git diff --name-only origin/$GITHUB_BASE_REF.. | grep -qE '(ssl|hashlib|hmac|^.github)' && echo '::set-output name= run_ssl_tests:: true' || true
55+ git diff --name-only origin/$GITHUB_BASE_REF.. | grep -qvE '(\.rst$|^Doc|^Misc)' && echo " run_tests= true" >> $GITHUB_OUTPUT || true
56+ git diff --name-only origin/$GITHUB_BASE_REF.. | grep -qE '(ssl|hashlib|hmac|^.github)' && echo " run_ssl_tests= true" >> $GITHUB_OUTPUT || true
5257 fi
5358
5459 check_abi :
5560 name : ' Check if the ABI has changed'
56- runs-on : ubuntu-20 .04
61+ runs-on : ubuntu-22 .04 # 24.04 causes spurious errors
5762 needs : check_source
5863 if : needs.check_source.outputs.run_tests == 'true'
5964 steps :
6065 - uses : actions/checkout@v4
61- - uses : actions/setup-python@v4
62- - name : Install Dependencies
66+ with :
67+ persist-credentials : false
68+ - uses : actions/setup-python@v5
69+ - name : Install dependencies
6370 run : |
6471 sudo ./.github/workflows/posix-deps-apt.sh
6572 sudo apt-get install -yq abigail-tools
@@ -75,16 +82,21 @@ jobs:
7582
7683 check_generated_files :
7784 name : ' Check if generated files are up to date'
78- runs-on : ubuntu-latest
85+ # Don't use ubuntu-latest but a specific version to make the job
86+ # reproducible: to get the same tools versions (autoconf, aclocal, ...)
87+ runs-on : ubuntu-22.04
88+ timeout-minutes : 60
7989 needs : check_source
8090 if : needs.check_source.outputs.run_tests == 'true'
8191 steps :
8292 - uses : actions/checkout@v4
83- - uses : actions/setup-python@v4
84- - name : Install Dependencies
93+ with :
94+ persist-credentials : false
95+ - uses : actions/setup-python@v5
96+ - name : Install dependencies
8597 run : sudo ./.github/workflows/posix-deps-apt.sh
8698 - name : Add ccache to PATH
87- run : echo "PATH=/usr/lib/ccache:$PATH" >> $GITHUB_ENV
99+ run : echo "PATH=/usr/lib/ccache:$PATH" >> " $GITHUB_ENV"
88100 - name : Configure ccache action
89101 uses : hendrikmuhs/ccache-action@v1
90102 - name : Check Autoconf version 2.69 and aclocal 1.16.3
@@ -183,21 +195,21 @@ jobs:
183195
184196 build_ubuntu :
185197 name : ' Ubuntu'
186- runs-on : ubuntu-20 .04
198+ runs-on : ubuntu-24 .04
187199 needs : check_source
188200 if : needs.check_source.outputs.run_tests == 'true'
189201 env :
190202 OPENSSL_VER : 3.0.11
191203 PYTHONSTRICTEXTENSIONBUILD : 1
192204 steps :
193205 - uses : actions/checkout@v4
194- - name : Install Dependencies
206+ - name : Install dependencies
195207 run : sudo ./.github/workflows/posix-deps-apt.sh
196208 - name : Configure OpenSSL env vars
197209 run : |
198- echo "MULTISSL_DIR=${GITHUB_WORKSPACE}/multissl" >> $GITHUB_ENV
199- echo "OPENSSL_DIR=${GITHUB_WORKSPACE}/multissl/openssl/${OPENSSL_VER}" >> $GITHUB_ENV
200- echo "LD_LIBRARY_PATH=${GITHUB_WORKSPACE}/multissl/openssl/${OPENSSL_VER}/lib" >> $GITHUB_ENV
210+ echo "MULTISSL_DIR=${GITHUB_WORKSPACE}/multissl" >> " $GITHUB_ENV"
211+ echo "OPENSSL_DIR=${GITHUB_WORKSPACE}/multissl/openssl/${OPENSSL_VER}" >> " $GITHUB_ENV"
212+ echo "LD_LIBRARY_PATH=${GITHUB_WORKSPACE}/multissl/openssl/${OPENSSL_VER}/lib" >> " $GITHUB_ENV"
201213 - name : ' Restore OpenSSL build'
202214 id : cache-openssl
203215 uses : actions/cache@v4
@@ -209,7 +221,7 @@ jobs:
209221 run : python3 Tools/ssl/multissltests.py --steps=library --base-directory $MULTISSL_DIR --openssl $OPENSSL_VER --system Linux
210222 - name : Add ccache to PATH
211223 run : |
212- echo "PATH=/usr/lib/ccache:$PATH" >> $GITHUB_ENV
224+ echo "PATH=/usr/lib/ccache:$PATH" >> " $GITHUB_ENV"
213225 - name : Configure ccache action
214226 uses : hendrikmuhs/ccache-action@v1
215227 - name : Configure CPython
@@ -223,7 +235,8 @@ jobs:
223235
224236 build_ubuntu_ssltests :
225237 name : ' Ubuntu SSL tests with OpenSSL'
226- runs-on : ubuntu-20.04
238+ runs-on : ubuntu-24.04
239+ timeout-minutes : 60
227240 needs : check_source
228241 if : needs.check_source.outputs.run_tests == 'true' && needs.check_source.outputs.run_ssl_tests == 'true'
229242 strategy :
@@ -237,13 +250,15 @@ jobs:
237250 LD_LIBRARY_PATH : ${{ github.workspace }}/multissl/openssl/${{ matrix.openssl_ver }}/lib
238251 steps :
239252 - uses : actions/checkout@v4
240- - name : Install Dependencies
253+ with :
254+ persist-credentials : false
255+ - name : Install dependencies
241256 run : sudo ./.github/workflows/posix-deps-apt.sh
242257 - name : Configure OpenSSL env vars
243258 run : |
244- echo "MULTISSL_DIR=${GITHUB_WORKSPACE}/multissl" >> $GITHUB_ENV
245- echo "OPENSSL_DIR=${GITHUB_WORKSPACE}/multissl/openssl/${OPENSSL_VER}" >> $GITHUB_ENV
246- echo "LD_LIBRARY_PATH=${GITHUB_WORKSPACE}/multissl/openssl/${OPENSSL_VER}/lib" >> $GITHUB_ENV
259+ echo "MULTISSL_DIR=${GITHUB_WORKSPACE}/multissl" >> " $GITHUB_ENV"
260+ echo "OPENSSL_DIR=${GITHUB_WORKSPACE}/multissl/openssl/${OPENSSL_VER}" >> " $GITHUB_ENV"
261+ echo "LD_LIBRARY_PATH=${GITHUB_WORKSPACE}/multissl/openssl/${OPENSSL_VER}/lib" >> " $GITHUB_ENV"
247262 - name : ' Restore OpenSSL build'
248263 id : cache-openssl
249264 uses : actions/cache@v4
@@ -255,7 +270,7 @@ jobs:
255270 run : python3 Tools/ssl/multissltests.py --steps=library --base-directory $MULTISSL_DIR --openssl $OPENSSL_VER --system Linux
256271 - name : Add ccache to PATH
257272 run : |
258- echo "PATH=/usr/lib/ccache:$PATH" >> $GITHUB_ENV
273+ echo "PATH=/usr/lib/ccache:$PATH" >> " $GITHUB_ENV"
259274 - name : Configure ccache action
260275 uses :
hendrikmuhs/[email protected] 261276 - name : Configure CPython
0 commit comments