88 push :
99 branches :
1010 - ' main'
11+ - ' 3.12'
1112 - ' 3.11'
1213 - ' 3.10'
1314 - ' 3.9'
1617 pull_request :
1718 branches :
1819 - ' main'
20+ - ' 3.12'
1921 - ' 3.11'
2022 - ' 3.10'
2123 - ' 3.9'
8183 if : needs.check_source.outputs.run_tests == 'true'
8284 steps :
8385 - uses : actions/checkout@v3
86+ - name : Restore config.cache
87+ uses : actions/cache@v3
88+ with :
89+ path : config.cache
90+ key : ${{ github.job }}-${{ runner.os }}-${{ hashFiles('configure', 'configure.ac', '.github/workflows/build.yml') }}
8491 - uses : actions/setup-python@v3
8592 - name : Install Dependencies
8693 run : sudo ./.github/workflows/posix-deps-apt.sh
97104 - name : Configure CPython
98105 run : |
99106 # Build Python with the libpython dynamic library
100- ./configure --with-pydebug --enable-shared
107+ ./configure --config-cache -- with-pydebug --enable-shared
101108 - name : Regenerate autoconf files with container image
102109 run : make regen-configure
103110 - name : Build CPython
@@ -178,6 +185,11 @@ jobs:
178185 PYTHONSTRICTEXTENSIONBUILD : 1
179186 steps :
180187 - uses : actions/checkout@v3
188+ - name : Restore config.cache
189+ uses : actions/cache@v3
190+ with :
191+ path : config.cache
192+ key : ${{ github.job }}-${{ runner.os }}-${{ hashFiles('configure', 'configure.ac', '.github/workflows/build.yml') }}
181193 - name : Install Homebrew dependencies
182194 run : brew install pkg-config openssl@1.1 xz gdbm tcl-tk
183195 - name : Configure CPython
@@ -186,6 +198,7 @@ jobs:
186198 LDFLAGS="-L$(brew --prefix gdbm)/lib -I$(brew --prefix xz)/lib" \
187199 PKG_CONFIG_PATH="$(brew --prefix tcl-tk)/lib/pkgconfig" \
188200 ./configure \
201+ --config-cache \
189202 --with-pydebug \
190203 --prefix=/opt/python-dev \
191204 --with-openssl="$(brew --prefix openssl@1.1)"
@@ -238,9 +251,18 @@ jobs:
238251 run : mkdir -p $CPYTHON_RO_SRCDIR $CPYTHON_BUILDDIR
239252 - name : Bind mount sources read-only
240253 run : sudo mount --bind -o ro $GITHUB_WORKSPACE $CPYTHON_RO_SRCDIR
254+ - name : Restore config.cache
255+ uses : actions/cache@v3
256+ with :
257+ path : ${{ env.CPYTHON_BUILDDIR }}/config.cache
258+ key : ${{ github.job }}-${{ runner.os }}-${{ hashFiles('configure', 'configure.ac', '.github/workflows/build.yml') }}
241259 - name : Configure CPython out-of-tree
242260 working-directory : ${{ env.CPYTHON_BUILDDIR }}
243- run : ../cpython-ro-srcdir/configure --with-pydebug --with-openssl=$OPENSSL_DIR
261+ run : |
262+ ../cpython-ro-srcdir/configure \
263+ --config-cache \
264+ --with-pydebug \
265+ --with-openssl=$OPENSSL_DIR
244266 - name : Build CPython out-of-tree
245267 working-directory : ${{ env.CPYTHON_BUILDDIR }}
246268 run : make -j4
@@ -271,6 +293,11 @@ jobs:
271293 LD_LIBRARY_PATH : ${{ github.workspace }}/multissl/openssl/${{ matrix.openssl_ver }}/lib
272294 steps :
273295 - uses : actions/checkout@v3
296+ - name : Restore config.cache
297+ uses : actions/cache@v3
298+ with :
299+ path : config.cache
300+ key : ${{ github.job }}-${{ runner.os }}-${{ hashFiles('configure', 'configure.ac', '.github/workflows/build.yml') }}
274301 - name : Register gcc problem matcher
275302 run : echo "::add-matcher::.github/problem-matchers/gcc.json"
276303 - name : Install Dependencies
@@ -295,7 +322,7 @@ jobs:
295322 - name : Configure ccache action
296323 uses : hendrikmuhs/ccache-action@v1.2
297324 - name : Configure CPython
298- run : ./configure --with-pydebug --with-openssl=$OPENSSL_DIR
325+ run : ./configure --config-cache -- with-pydebug --with-openssl=$OPENSSL_DIR
299326 - name : Build CPython
300327 run : make -j4
301328 - name : Display build info
@@ -304,7 +331,7 @@ jobs:
304331 run : ./python Lib/test/ssltests.py
305332
306333 test_hypothesis :
307- name : " Hypothesis Tests on Ubuntu"
334+ name : " Hypothesis tests on Ubuntu"
308335 runs-on : ubuntu-20.04
309336 timeout-minutes : 60
310337 needs : check_source
@@ -345,9 +372,18 @@ jobs:
345372 run : mkdir -p $CPYTHON_RO_SRCDIR $CPYTHON_BUILDDIR
346373 - name : Bind mount sources read-only
347374 run : sudo mount --bind -o ro $GITHUB_WORKSPACE $CPYTHON_RO_SRCDIR
375+ - name : Restore config.cache
376+ uses : actions/cache@v3
377+ with :
378+ path : ${{ env.CPYTHON_BUILDDIR }}/config.cache
379+ key : ${{ github.job }}-${{ runner.os }}-${{ hashFiles('configure', 'configure.ac', '.github/workflows/build.yml') }}
348380 - name : Configure CPython out-of-tree
349381 working-directory : ${{ env.CPYTHON_BUILDDIR }}
350- run : ../cpython-ro-srcdir/configure --with-pydebug --with-openssl=$OPENSSL_DIR
382+ run : |
383+ ../cpython-ro-srcdir/configure \
384+ --config-cache \
385+ --with-pydebug \
386+ --with-openssl=$OPENSSL_DIR
351387 - name : Build CPython out-of-tree
352388 working-directory : ${{ env.CPYTHON_BUILDDIR }}
353389 run : make -j4
@@ -368,6 +404,14 @@ jobs:
368404 echo "HYPOVENV=${VENV_LOC}" >> $GITHUB_ENV
369405 echo "VENV_PYTHON=${VENV_PYTHON}" >> $GITHUB_ENV
370406 ./python -m venv $VENV_LOC && $VENV_PYTHON -m pip install -U hypothesis
407+ - name : ' Restore Hypothesis database'
408+ id : cache-hypothesis-database
409+ uses : actions/cache@v3
410+ with :
411+ path : ./hypothesis
412+ key : hypothesis-database-${{ github.head_ref || github.run_id }}
413+ restore-keys : |
414+ - hypothesis-database-
371415 - name : " Run tests"
372416 working-directory : ${{ env.CPYTHON_BUILDDIR }}
373417 run : |
@@ -388,6 +432,11 @@ jobs:
388432 -x test_subprocess \
389433 -x test_signal \
390434 -x test_sysconfig
435+ - uses : actions/upload-artifact@v3
436+ if : always()
437+ with :
438+ name : hypothesis-example-db
439+ path : .hypothesis/examples/
391440
392441
393442 build_asan :
@@ -402,6 +451,11 @@ jobs:
402451 ASAN_OPTIONS : detect_leaks=0:allocator_may_return_null=1:handle_segv=0
403452 steps :
404453 - uses : actions/checkout@v3
454+ - name : Restore config.cache
455+ uses : actions/cache@v3
456+ with :
457+ path : config.cache
458+ key : ${{ github.job }}-${{ runner.os }}-${{ hashFiles('configure', 'configure.ac', '.github/workflows/build.yml') }}
405459 - name : Register gcc problem matcher
406460 run : echo "::add-matcher::.github/problem-matchers/gcc.json"
407461 - name : Install Dependencies
@@ -430,7 +484,7 @@ jobs:
430484 - name : Configure ccache action
431485 uses : hendrikmuhs/ccache-action@v1.2
432486 - name : Configure CPython
433- run : ./configure --with-address-sanitizer --without-pymalloc
487+ run : ./configure --config-cache -- with-address-sanitizer --without-pymalloc
434488 - name : Build CPython
435489 run : make -j4
436490 - name : Display build info
0 commit comments