]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.12] gh-113858: GH Actions: Make ccache smaller (GH-113859, GH-113945) (GH-114082)
authorPetr Viktorin <encukou@gmail.com>
Tue, 16 Jan 2024 15:28:27 +0000 (16:28 +0100)
committerGitHub <noreply@github.com>
Tue, 16 Jan 2024 15:28:27 +0000 (16:28 +0100)
This backports 3 PRs:

- https://github.com/python/cpython/pull/113859

  Only save ccache on pushes

- https://github.com/python/cpython/pull/113945

  Cut down ccache size

  - Only save the ccache in the main reusable builds, not on builds that
    don't use special build options:
      - Generated files check
    - OpenSSL tests
    - Hypothesis tests
  - Halve the max cache size, to 200M

- https://github.com/python/cpython/pull/114113

  Fixup for the above

Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
.github/workflows/build.yml
.github/workflows/reusable-ubuntu.yml

index 545dd8c15dcf132d0b1a744e3d7c881006cb51db..6530a90541bd48b6fd89955fa00acdd4a546b1b7 100644 (file)
@@ -169,6 +169,8 @@ jobs:
         run: echo "PATH=/usr/lib/ccache:$PATH" >> $GITHUB_ENV
       - name: Configure ccache action
         uses: hendrikmuhs/ccache-action@v1.2
+        with:
+          save: false
       - name: Check Autoconf and aclocal versions
         run: |
           grep "Generated by GNU Autoconf 2.71" configure
@@ -283,6 +285,8 @@ jobs:
         echo "PATH=/usr/lib/ccache:$PATH" >> $GITHUB_ENV
     - name: Configure ccache action
       uses: hendrikmuhs/ccache-action@v1.2
+      with:
+        save: false
     - name: Configure CPython
       run: ./configure --config-cache --with-pydebug --with-openssl=$OPENSSL_DIR
     - name: Build CPython
@@ -326,6 +330,8 @@ jobs:
         echo "PATH=/usr/lib/ccache:$PATH" >> $GITHUB_ENV
     - name: Configure ccache action
       uses: hendrikmuhs/ccache-action@v1.2
+      with:
+        save: false
     - name: Setup directory envs for out-of-tree builds
       run: |
         echo "CPYTHON_RO_SRCDIR=$(realpath -m ${GITHUB_WORKSPACE}/../cpython-ro-srcdir)" >> $GITHUB_ENV
@@ -445,6 +451,9 @@ jobs:
         echo "PATH=/usr/lib/ccache:$PATH" >> $GITHUB_ENV
     - name: Configure ccache action
       uses: hendrikmuhs/ccache-action@v1.2
+      with:
+        save: ${{ github.event_name == 'push' }}
+        max-size: "200M"
     - name: Configure CPython
       run: ./configure --config-cache --with-address-sanitizer --without-pymalloc
     - name: Build CPython
index 56268c8bfd3419ee270fe1264e43667c008ca5d9..db4ca4d4667399158757179d25f62db85bd84164 100644 (file)
@@ -41,6 +41,9 @@ jobs:
         echo "PATH=/usr/lib/ccache:$PATH" >> $GITHUB_ENV
     - name: Configure ccache action
       uses: hendrikmuhs/ccache-action@v1.2
+      with:
+        save: ${{ github.event_name == 'push' }}
+        max-size: "200M"
     - name: Setup directory envs for out-of-tree builds
       run: |
         echo "CPYTHON_RO_SRCDIR=$(realpath -m ${GITHUB_WORKSPACE}/../cpython-ro-srcdir)" >> $GITHUB_ENV