mirror of
https://github.com/python/cpython.git
synced 2025-09-26 18:29:57 +00:00
[3.12] CI: Cache config.cache across runs to speed up build (GH-104800) (#104967)
This commit is contained in:
parent
8ca29573a8
commit
97509ca2bc
1 changed files with 45 additions and 6 deletions
51
.github/workflows/build.yml
vendored
51
.github/workflows/build.yml
vendored
|
@ -113,6 +113,11 @@ jobs:
|
||||||
if: needs.check_source.outputs.run_tests == 'true'
|
if: needs.check_source.outputs.run_tests == 'true'
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
|
- name: Restore config.cache
|
||||||
|
uses: actions/cache@v3
|
||||||
|
with:
|
||||||
|
path: config.cache
|
||||||
|
key: ${{ github.job }}-${{ runner.os }}-${{ hashFiles('configure', 'configure.ac', '.github/workflows/build.yml') }}
|
||||||
- uses: actions/setup-python@v3
|
- uses: actions/setup-python@v3
|
||||||
- name: Install Dependencies
|
- name: Install Dependencies
|
||||||
run: sudo ./.github/workflows/posix-deps-apt.sh
|
run: sudo ./.github/workflows/posix-deps-apt.sh
|
||||||
|
@ -129,7 +134,7 @@ jobs:
|
||||||
- name: Configure CPython
|
- name: Configure CPython
|
||||||
run: |
|
run: |
|
||||||
# Build Python with the libpython dynamic library
|
# Build Python with the libpython dynamic library
|
||||||
./configure --with-pydebug --enable-shared
|
./configure --config-cache --with-pydebug --enable-shared
|
||||||
- name: Regenerate autoconf files with container image
|
- name: Regenerate autoconf files with container image
|
||||||
run: make regen-configure
|
run: make regen-configure
|
||||||
- name: Build CPython
|
- name: Build CPython
|
||||||
|
@ -210,6 +215,11 @@ jobs:
|
||||||
PYTHONSTRICTEXTENSIONBUILD: 1
|
PYTHONSTRICTEXTENSIONBUILD: 1
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
|
- name: Restore config.cache
|
||||||
|
uses: actions/cache@v3
|
||||||
|
with:
|
||||||
|
path: config.cache
|
||||||
|
key: ${{ github.job }}-${{ runner.os }}-${{ hashFiles('configure', 'configure.ac', '.github/workflows/build.yml') }}
|
||||||
- name: Install Homebrew dependencies
|
- name: Install Homebrew dependencies
|
||||||
run: brew install pkg-config openssl@1.1 xz gdbm tcl-tk
|
run: brew install pkg-config openssl@1.1 xz gdbm tcl-tk
|
||||||
- name: Configure CPython
|
- name: Configure CPython
|
||||||
|
@ -218,6 +228,7 @@ jobs:
|
||||||
LDFLAGS="-L$(brew --prefix gdbm)/lib -I$(brew --prefix xz)/lib" \
|
LDFLAGS="-L$(brew --prefix gdbm)/lib -I$(brew --prefix xz)/lib" \
|
||||||
PKG_CONFIG_PATH="$(brew --prefix tcl-tk)/lib/pkgconfig" \
|
PKG_CONFIG_PATH="$(brew --prefix tcl-tk)/lib/pkgconfig" \
|
||||||
./configure \
|
./configure \
|
||||||
|
--config-cache \
|
||||||
--with-pydebug \
|
--with-pydebug \
|
||||||
--prefix=/opt/python-dev \
|
--prefix=/opt/python-dev \
|
||||||
--with-openssl="$(brew --prefix openssl@1.1)"
|
--with-openssl="$(brew --prefix openssl@1.1)"
|
||||||
|
@ -270,9 +281,18 @@ jobs:
|
||||||
run: mkdir -p $CPYTHON_RO_SRCDIR $CPYTHON_BUILDDIR
|
run: mkdir -p $CPYTHON_RO_SRCDIR $CPYTHON_BUILDDIR
|
||||||
- name: Bind mount sources read-only
|
- name: Bind mount sources read-only
|
||||||
run: sudo mount --bind -o ro $GITHUB_WORKSPACE $CPYTHON_RO_SRCDIR
|
run: sudo mount --bind -o ro $GITHUB_WORKSPACE $CPYTHON_RO_SRCDIR
|
||||||
|
- name: Restore config.cache
|
||||||
|
uses: actions/cache@v3
|
||||||
|
with:
|
||||||
|
path: ${{ env.CPYTHON_BUILDDIR }}/config.cache
|
||||||
|
key: ${{ github.job }}-${{ runner.os }}-${{ hashFiles('configure', 'configure.ac', '.github/workflows/build.yml') }}
|
||||||
- name: Configure CPython out-of-tree
|
- name: Configure CPython out-of-tree
|
||||||
working-directory: ${{ env.CPYTHON_BUILDDIR }}
|
working-directory: ${{ env.CPYTHON_BUILDDIR }}
|
||||||
run: ../cpython-ro-srcdir/configure --with-pydebug --with-openssl=$OPENSSL_DIR
|
run: |
|
||||||
|
../cpython-ro-srcdir/configure \
|
||||||
|
--config-cache \
|
||||||
|
--with-pydebug \
|
||||||
|
--with-openssl=$OPENSSL_DIR
|
||||||
- name: Build CPython out-of-tree
|
- name: Build CPython out-of-tree
|
||||||
working-directory: ${{ env.CPYTHON_BUILDDIR }}
|
working-directory: ${{ env.CPYTHON_BUILDDIR }}
|
||||||
run: make -j4
|
run: make -j4
|
||||||
|
@ -303,6 +323,11 @@ jobs:
|
||||||
LD_LIBRARY_PATH: ${{ github.workspace }}/multissl/openssl/${{ matrix.openssl_ver }}/lib
|
LD_LIBRARY_PATH: ${{ github.workspace }}/multissl/openssl/${{ matrix.openssl_ver }}/lib
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
|
- name: Restore config.cache
|
||||||
|
uses: actions/cache@v3
|
||||||
|
with:
|
||||||
|
path: config.cache
|
||||||
|
key: ${{ github.job }}-${{ runner.os }}-${{ hashFiles('configure', 'configure.ac', '.github/workflows/build.yml') }}
|
||||||
- name: Register gcc problem matcher
|
- name: Register gcc problem matcher
|
||||||
run: echo "::add-matcher::.github/problem-matchers/gcc.json"
|
run: echo "::add-matcher::.github/problem-matchers/gcc.json"
|
||||||
- name: Install Dependencies
|
- name: Install Dependencies
|
||||||
|
@ -327,7 +352,7 @@ jobs:
|
||||||
- name: Configure ccache action
|
- name: Configure ccache action
|
||||||
uses: hendrikmuhs/ccache-action@v1.2
|
uses: hendrikmuhs/ccache-action@v1.2
|
||||||
- name: Configure CPython
|
- name: Configure CPython
|
||||||
run: ./configure --with-pydebug --with-openssl=$OPENSSL_DIR
|
run: ./configure --config-cache --with-pydebug --with-openssl=$OPENSSL_DIR
|
||||||
- name: Build CPython
|
- name: Build CPython
|
||||||
run: make -j4
|
run: make -j4
|
||||||
- name: Display build info
|
- name: Display build info
|
||||||
|
@ -336,7 +361,7 @@ jobs:
|
||||||
run: ./python Lib/test/ssltests.py
|
run: ./python Lib/test/ssltests.py
|
||||||
|
|
||||||
test_hypothesis:
|
test_hypothesis:
|
||||||
name: "Hypothesis Tests on Ubuntu"
|
name: "Hypothesis tests on Ubuntu"
|
||||||
runs-on: ubuntu-20.04
|
runs-on: ubuntu-20.04
|
||||||
timeout-minutes: 60
|
timeout-minutes: 60
|
||||||
needs: check_source
|
needs: check_source
|
||||||
|
@ -377,9 +402,18 @@ jobs:
|
||||||
run: mkdir -p $CPYTHON_RO_SRCDIR $CPYTHON_BUILDDIR
|
run: mkdir -p $CPYTHON_RO_SRCDIR $CPYTHON_BUILDDIR
|
||||||
- name: Bind mount sources read-only
|
- name: Bind mount sources read-only
|
||||||
run: sudo mount --bind -o ro $GITHUB_WORKSPACE $CPYTHON_RO_SRCDIR
|
run: sudo mount --bind -o ro $GITHUB_WORKSPACE $CPYTHON_RO_SRCDIR
|
||||||
|
- name: Restore config.cache
|
||||||
|
uses: actions/cache@v3
|
||||||
|
with:
|
||||||
|
path: ${{ env.CPYTHON_BUILDDIR }}/config.cache
|
||||||
|
key: ${{ github.job }}-${{ runner.os }}-${{ hashFiles('configure', 'configure.ac', '.github/workflows/build.yml') }}
|
||||||
- name: Configure CPython out-of-tree
|
- name: Configure CPython out-of-tree
|
||||||
working-directory: ${{ env.CPYTHON_BUILDDIR }}
|
working-directory: ${{ env.CPYTHON_BUILDDIR }}
|
||||||
run: ../cpython-ro-srcdir/configure --with-pydebug --with-openssl=$OPENSSL_DIR
|
run: |
|
||||||
|
../cpython-ro-srcdir/configure \
|
||||||
|
--config-cache \
|
||||||
|
--with-pydebug \
|
||||||
|
--with-openssl=$OPENSSL_DIR
|
||||||
- name: Build CPython out-of-tree
|
- name: Build CPython out-of-tree
|
||||||
working-directory: ${{ env.CPYTHON_BUILDDIR }}
|
working-directory: ${{ env.CPYTHON_BUILDDIR }}
|
||||||
run: make -j4
|
run: make -j4
|
||||||
|
@ -447,6 +481,11 @@ jobs:
|
||||||
ASAN_OPTIONS: detect_leaks=0:allocator_may_return_null=1:handle_segv=0
|
ASAN_OPTIONS: detect_leaks=0:allocator_may_return_null=1:handle_segv=0
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
|
- name: Restore config.cache
|
||||||
|
uses: actions/cache@v3
|
||||||
|
with:
|
||||||
|
path: config.cache
|
||||||
|
key: ${{ github.job }}-${{ runner.os }}-${{ hashFiles('configure', 'configure.ac', '.github/workflows/build.yml') }}
|
||||||
- name: Register gcc problem matcher
|
- name: Register gcc problem matcher
|
||||||
run: echo "::add-matcher::.github/problem-matchers/gcc.json"
|
run: echo "::add-matcher::.github/problem-matchers/gcc.json"
|
||||||
- name: Install Dependencies
|
- name: Install Dependencies
|
||||||
|
@ -475,7 +514,7 @@ jobs:
|
||||||
- name: Configure ccache action
|
- name: Configure ccache action
|
||||||
uses: hendrikmuhs/ccache-action@v1.2
|
uses: hendrikmuhs/ccache-action@v1.2
|
||||||
- name: Configure CPython
|
- name: Configure CPython
|
||||||
run: ./configure --with-address-sanitizer --without-pymalloc
|
run: ./configure --config-cache --with-address-sanitizer --without-pymalloc
|
||||||
- name: Build CPython
|
- name: Build CPython
|
||||||
run: make -j4
|
run: make -j4
|
||||||
- name: Display build info
|
- name: Display build info
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue