@@ -28,7 +28,7 @@ permissions:
2828 contents : read
2929
3030concurrency :
31- group : ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
31+ group : ${{ github.workflow }}-${{ github.head_ref || github.run_id }}-reusable
3232 cancel-in-progress : true
3333
3434jobs :
3737 runs-on : ubuntu-latest
3838 timeout-minutes : 10
3939 outputs :
40+ run-docs : ${{ steps.docs-changes.outputs.run-docs || false }}
4041 run_tests : ${{ steps.check.outputs.run_tests }}
4142 run_hypothesis : ${{ steps.check.outputs.run_hypothesis }}
43+ config_hash : ${{ steps.config_hash.outputs.hash }}
4244 steps :
4345 - uses : actions/checkout@v3
4446 - name : Check for source changes
7476 echo "Run hypothesis tests"
7577 echo "run_hypothesis=true" >> $GITHUB_OUTPUT
7678 fi
79+ - name : Compute hash for config cache key
80+ id : config_hash
81+ run : |
82+ echo "hash=${{ hashFiles('configure', 'configure.ac', '.github/workflows/build.yml') }}" >> $GITHUB_OUTPUT
83+ - name : Get a list of the changed documentation-related files
84+ if : github.event_name == 'pull_request'
85+ id : changed-docs-files
86+ 87+ with :
88+ filter : |
89+ Doc/**
90+ # Temporarily skip paths with spaces
91+ # (i.e. "C API", "Core and Builtins")
92+ # to avoid "Error: One of your files includes a space".
93+ # Pending https://github.com/python/core-workflow/issues/186
94+ # Misc/**
95+ Misc/NEWS.d/next/Build/**
96+ Misc/NEWS.d/next/Documentation/**
97+ Misc/NEWS.d/next/IDLE/**
98+ Misc/NEWS.d/next/Library/**
99+ Misc/NEWS.d/next/Security/**
100+ Misc/NEWS.d/next/Tests/**
101+ Misc/NEWS.d/next/Tools-Demos/**
102+ Misc/NEWS.d/next/Windows/**
103+ Misc/NEWS.d/next/macOS/**
104+ .github/workflows/reusable-docs.yml
105+ - name : Check for docs changes
106+ if : >-
107+ github.event_name == 'pull_request'
108+ && steps.changed-docs-files.outputs.added_modified_renamed != ''
109+ id : docs-changes
110+ run : |
111+ echo "run-docs=true" >> "${GITHUB_OUTPUT}"
112+
113+ check-docs :
114+ name : Docs
115+ needs : check_source
116+ if : fromJSON(needs.check_source.outputs.run-docs)
117+ uses : ./.github/workflows/reusable-docs.yml
77118
78119 check_generated_files :
79120 name : ' Check if generated files are up to date'
@@ -83,23 +124,28 @@ jobs:
83124 if : needs.check_source.outputs.run_tests == 'true'
84125 steps :
85126 - uses : actions/checkout@v3
127+ - name : Restore config.cache
128+ uses : actions/cache@v3
129+ with :
130+ path : config.cache
131+ key : ${{ github.job }}-${{ runner.os }}-${{ needs.check_source.outputs.config_hash }}
86132 - uses : actions/setup-python@v3
87133 - name : Install Dependencies
88134 run : sudo ./.github/workflows/posix-deps-apt.sh
89135 - name : Add ccache to PATH
90136 run : echo "PATH=/usr/lib/ccache:$PATH" >> $GITHUB_ENV
91137 - name : Configure ccache action
92138 uses :
hendrikmuhs/[email protected] 93- - name : Check Autoconf version 2.69 and aclocal 1.16.3
139+ - name : Check Autoconf and aclocal versions
94140 run : |
95- grep "Generated by GNU Autoconf 2.69 " configure
96- grep "aclocal 1.16.3 " aclocal.m4
141+ grep "Generated by GNU Autoconf 2.71 " configure
142+ grep "aclocal 1.16.4 " aclocal.m4
97143 grep -q "runstatedir" configure
98144 grep -q "PKG_PROG_PKG_CONFIG" aclocal.m4
99145 - name : Configure CPython
100146 run : |
101147 # Build Python with the libpython dynamic library
102- ./configure --with-pydebug --enable-shared
148+ ./configure --config-cache -- with-pydebug --enable-shared
103149 - name : Regenerate autoconf files with container image
104150 run : make regen-configure
105151 - name : Build CPython
@@ -180,14 +226,19 @@ jobs:
180226 PYTHONSTRICTEXTENSIONBUILD : 1
181227 steps :
182228 - uses : actions/checkout@v3
229+ - name : Restore config.cache
230+ uses : actions/cache@v3
231+ with :
232+ path : config.cache
233+ key : ${{ github.job }}-${{ runner.os }}-${{ needs.check_source.outputs.config_hash }}
183234 - name : Install Homebrew dependencies
184235 run :
brew install pkg-config [email protected] xz gdbm tcl-tk 185236 - name : Configure CPython
186237 run : |
187- CFLAGS="-I$(brew --prefix gdbm)/include -I$(brew --prefix xz)/include" \
188- LDFLAGS="-L$(brew --prefix gdbm)/lib -I$(brew --prefix xz)/lib" \
189- PKG_CONFIG_PATH="$(brew --prefix tcl-tk)/lib/pkgconfig" \
238+ GDBM_CFLAGS="-I$(brew --prefix gdbm)/include" \
239+ GDBM_LIBS="-L$(brew --prefix gdbm)/lib -lgdbm" \
190240 ./configure \
241+ --config-cache \
191242 --with-pydebug \
192243 --prefix=/opt/python-dev \
193244 --with-openssl="$(brew --prefix [email protected] )" @@ -205,7 +256,7 @@ jobs:
205256 needs : check_source
206257 if : needs.check_source.outputs.run_tests == 'true'
207258 env :
208- OPENSSL_VER : 1.1.1t
259+ OPENSSL_VER : 1.1.1u
209260 PYTHONSTRICTEXTENSIONBUILD : 1
210261 steps :
211262 - uses : actions/checkout@v3
@@ -240,9 +291,18 @@ jobs:
240291 run : mkdir -p $CPYTHON_RO_SRCDIR $CPYTHON_BUILDDIR
241292 - name : Bind mount sources read-only
242293 run : sudo mount --bind -o ro $GITHUB_WORKSPACE $CPYTHON_RO_SRCDIR
294+ - name : Restore config.cache
295+ uses : actions/cache@v3
296+ with :
297+ path : ${{ env.CPYTHON_BUILDDIR }}/config.cache
298+ key : ${{ github.job }}-${{ runner.os }}-${{ needs.check_source.outputs.config_hash }}
243299 - name : Configure CPython out-of-tree
244300 working-directory : ${{ env.CPYTHON_BUILDDIR }}
245- run : ../cpython-ro-srcdir/configure --with-pydebug --with-openssl=$OPENSSL_DIR
301+ run : |
302+ ../cpython-ro-srcdir/configure \
303+ --config-cache \
304+ --with-pydebug \
305+ --with-openssl=$OPENSSL_DIR
246306 - name : Build CPython out-of-tree
247307 working-directory : ${{ env.CPYTHON_BUILDDIR }}
248308 run : make -j4
@@ -265,14 +325,19 @@ jobs:
265325 strategy :
266326 fail-fast : false
267327 matrix :
268- openssl_ver : [1.1.1t , 3.0.8 , 3.1.0-beta1 ]
328+ openssl_ver : [1.1.1u , 3.0.9 , 3.1.1 ]
269329 env :
270330 OPENSSL_VER : ${{ matrix.openssl_ver }}
271331 MULTISSL_DIR : ${{ github.workspace }}/multissl
272332 OPENSSL_DIR : ${{ github.workspace }}/multissl/openssl/${{ matrix.openssl_ver }}
273333 LD_LIBRARY_PATH : ${{ github.workspace }}/multissl/openssl/${{ matrix.openssl_ver }}/lib
274334 steps :
275335 - uses : actions/checkout@v3
336+ - name : Restore config.cache
337+ uses : actions/cache@v3
338+ with :
339+ path : config.cache
340+ key : ${{ github.job }}-${{ runner.os }}-${{ needs.check_source.outputs.config_hash }}
276341 - name : Register gcc problem matcher
277342 run : echo "::add-matcher::.github/problem-matchers/gcc.json"
278343 - name : Install Dependencies
@@ -297,7 +362,7 @@ jobs:
297362 - name : Configure ccache action
298363 uses :
hendrikmuhs/[email protected] 299364 - name : Configure CPython
300- run : ./configure --with-pydebug --with-openssl=$OPENSSL_DIR
365+ run : ./configure --config-cache -- with-pydebug --with-openssl=$OPENSSL_DIR
301366 - name : Build CPython
302367 run : make -j4
303368 - name : Display build info
@@ -306,13 +371,13 @@ jobs:
306371 run : ./python Lib/test/ssltests.py
307372
308373 test_hypothesis :
309- name : " Hypothesis Tests on Ubuntu"
374+ name : " Hypothesis tests on Ubuntu"
310375 runs-on : ubuntu-20.04
311376 timeout-minutes : 60
312377 needs : check_source
313378 if : needs.check_source.outputs.run_tests == 'true' && needs.check_source.outputs.run_hypothesis == 'true'
314379 env :
315- OPENSSL_VER : 1.1.1t
380+ OPENSSL_VER : 1.1.1u
316381 PYTHONSTRICTEXTENSIONBUILD : 1
317382 steps :
318383 - uses : actions/checkout@v3
@@ -347,9 +412,18 @@ jobs:
347412 run : mkdir -p $CPYTHON_RO_SRCDIR $CPYTHON_BUILDDIR
348413 - name : Bind mount sources read-only
349414 run : sudo mount --bind -o ro $GITHUB_WORKSPACE $CPYTHON_RO_SRCDIR
415+ - name : Restore config.cache
416+ uses : actions/cache@v3
417+ with :
418+ path : ${{ env.CPYTHON_BUILDDIR }}/config.cache
419+ key : ${{ github.job }}-${{ runner.os }}-${{ needs.check_source.outputs.config_hash }}
350420 - name : Configure CPython out-of-tree
351421 working-directory : ${{ env.CPYTHON_BUILDDIR }}
352- run : ../cpython-ro-srcdir/configure --with-pydebug --with-openssl=$OPENSSL_DIR
422+ run : |
423+ ../cpython-ro-srcdir/configure \
424+ --config-cache \
425+ --with-pydebug \
426+ --with-openssl=$OPENSSL_DIR
353427 - name : Build CPython out-of-tree
354428 working-directory : ${{ env.CPYTHON_BUILDDIR }}
355429 run : make -j4
@@ -412,11 +486,16 @@ jobs:
412486 needs : check_source
413487 if : needs.check_source.outputs.run_tests == 'true'
414488 env :
415- OPENSSL_VER : 1.1.1t
489+ OPENSSL_VER : 1.1.1u
416490 PYTHONSTRICTEXTENSIONBUILD : 1
417491 ASAN_OPTIONS : detect_leaks=0:allocator_may_return_null=1:handle_segv=0
418492 steps :
419493 - uses : actions/checkout@v3
494+ - name : Restore config.cache
495+ uses : actions/cache@v3
496+ with :
497+ path : config.cache
498+ key : ${{ github.job }}-${{ runner.os }}-${{ needs.check_source.outputs.config_hash }}
420499 - name : Register gcc problem matcher
421500 run : echo "::add-matcher::.github/problem-matchers/gcc.json"
422501 - name : Install Dependencies
@@ -445,7 +524,7 @@ jobs:
445524 - name : Configure ccache action
446525 uses :
hendrikmuhs/[email protected] 447526 - name : Configure CPython
448- run : ./configure --with-address-sanitizer --without-pymalloc
527+ run : ./configure --config-cache -- with-address-sanitizer --without-pymalloc
449528 - name : Build CPython
450529 run : make -j4
451530 - name : Display build info
0 commit comments