1
1
name : Tests
2
2
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".
6
3
on :
4
+ workflow_dispatch :
7
5
push :
8
6
branches :
9
- - master
10
- - 3.9
11
- - 3.8
12
- - 3.7
7
+ - ' main'
8
+ - ' 3.*'
13
9
pull_request :
14
10
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
19
23
20
24
jobs :
21
25
check_source :
22
26
name : ' Check for source changes'
23
27
runs-on : ubuntu-latest
28
+ timeout-minutes : 10
24
29
outputs :
25
30
run_tests : ${{ steps.check.outputs.run_tests }}
26
31
run_ssl_tests : ${{ steps.check.outputs.run_ssl_tests }}
30
35
id : check
31
36
run : |
32
37
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
35
40
else
36
41
git fetch origin $GITHUB_BASE_REF --depth=1
37
42
# git diff "origin/$GITHUB_BASE_REF..." (3 dots) may be more
@@ -47,19 +52,21 @@ jobs:
47
52
# into the PR branch anyway.
48
53
#
49
54
# 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
52
57
fi
53
58
54
59
check_abi :
55
60
name : ' Check if the ABI has changed'
56
- runs-on : ubuntu-20 .04
61
+ runs-on : ubuntu-22 .04 # 24.04 causes spurious errors
57
62
needs : check_source
58
63
if : needs.check_source.outputs.run_tests == 'true'
59
64
steps :
60
65
- 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
63
70
run : |
64
71
sudo ./.github/workflows/posix-deps-apt.sh
65
72
sudo apt-get install -yq abigail-tools
@@ -75,16 +82,21 @@ jobs:
75
82
76
83
check_generated_files :
77
84
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
79
89
needs : check_source
80
90
if : needs.check_source.outputs.run_tests == 'true'
81
91
steps :
82
92
- 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
85
97
run : sudo ./.github/workflows/posix-deps-apt.sh
86
98
- 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"
88
100
- name : Configure ccache action
89
101
uses : hendrikmuhs/ccache-action@v1
90
102
- name : Check Autoconf version 2.69 and aclocal 1.16.3
@@ -183,21 +195,21 @@ jobs:
183
195
184
196
build_ubuntu :
185
197
name : ' Ubuntu'
186
- runs-on : ubuntu-20 .04
198
+ runs-on : ubuntu-24 .04
187
199
needs : check_source
188
200
if : needs.check_source.outputs.run_tests == 'true'
189
201
env :
190
202
OPENSSL_VER : 3.0.11
191
203
PYTHONSTRICTEXTENSIONBUILD : 1
192
204
steps :
193
205
- uses : actions/checkout@v4
194
- - name : Install Dependencies
206
+ - name : Install dependencies
195
207
run : sudo ./.github/workflows/posix-deps-apt.sh
196
208
- name : Configure OpenSSL env vars
197
209
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"
201
213
- name : ' Restore OpenSSL build'
202
214
id : cache-openssl
203
215
uses : actions/cache@v4
@@ -209,7 +221,7 @@ jobs:
209
221
run : python3 Tools/ssl/multissltests.py --steps=library --base-directory $MULTISSL_DIR --openssl $OPENSSL_VER --system Linux
210
222
- name : Add ccache to PATH
211
223
run : |
212
- echo "PATH=/usr/lib/ccache:$PATH" >> $GITHUB_ENV
224
+ echo "PATH=/usr/lib/ccache:$PATH" >> " $GITHUB_ENV"
213
225
- name : Configure ccache action
214
226
uses : hendrikmuhs/ccache-action@v1
215
227
- name : Configure CPython
@@ -223,7 +235,8 @@ jobs:
223
235
224
236
build_ubuntu_ssltests :
225
237
name : ' Ubuntu SSL tests with OpenSSL'
226
- runs-on : ubuntu-20.04
238
+ runs-on : ubuntu-24.04
239
+ timeout-minutes : 60
227
240
needs : check_source
228
241
if : needs.check_source.outputs.run_tests == 'true' && needs.check_source.outputs.run_ssl_tests == 'true'
229
242
strategy :
@@ -237,13 +250,15 @@ jobs:
237
250
LD_LIBRARY_PATH : ${{ github.workspace }}/multissl/openssl/${{ matrix.openssl_ver }}/lib
238
251
steps :
239
252
- uses : actions/checkout@v4
240
- - name : Install Dependencies
253
+ with :
254
+ persist-credentials : false
255
+ - name : Install dependencies
241
256
run : sudo ./.github/workflows/posix-deps-apt.sh
242
257
- name : Configure OpenSSL env vars
243
258
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"
247
262
- name : ' Restore OpenSSL build'
248
263
id : cache-openssl
249
264
uses : actions/cache@v4
@@ -255,7 +270,7 @@ jobs:
255
270
run : python3 Tools/ssl/multissltests.py --steps=library --base-directory $MULTISSL_DIR --openssl $OPENSSL_VER --system Linux
256
271
- name : Add ccache to PATH
257
272
run : |
258
- echo "PATH=/usr/lib/ccache:$PATH" >> $GITHUB_ENV
273
+ echo "PATH=/usr/lib/ccache:$PATH" >> " $GITHUB_ENV"
259
274
- name : Configure ccache action
260
275
uses :
hendrikmuhs/[email protected]
261
276
- name : Configure CPython
0 commit comments