Skip to content

Commit 59e1108

Browse files
committed
Explore using sccache instead of ccache in CI.
1 parent b83be9c commit 59e1108

File tree

2 files changed

+20
-14
lines changed

2 files changed

+20
-14
lines changed

.github/workflows/build.yml

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -92,13 +92,23 @@ jobs:
9292
timeout-minutes: 60
9393
needs: check_source
9494
if: needs.check_source.outputs.run_tests == 'true'
95+
env:
96+
SCCACHE_GHA_ENABLED: "true"
9597
steps:
9698
- uses: actions/checkout@v4
9799
- uses: actions/setup-python@v5
98100
with:
99101
python-version: '3.x'
100102
- name: Runner image version
101103
run: echo "IMAGE_VERSION=${ImageVersion}" >> "$GITHUB_ENV"
104+
- name: Run sccache-cache
105+
uses: mozilla-actions/[email protected]
106+
with:
107+
version: "v0.8.2"
108+
- name: Configure CC and CXX environment variables
109+
run: |
110+
echo "CC=sccache gcc" >> "$GITHUB_ENV"
111+
echo "CXX=sccache gcc" >> "$GITHUB_ENV"
102112
- name: Restore config.cache
103113
uses: actions/cache@v4
104114
with:
@@ -107,12 +117,6 @@ jobs:
107117
key: ${{ github.job }}-${{ runner.os }}-${{ env.IMAGE_VERSION }}-${{ needs.check_source.outputs.config_hash }}-${{ env.pythonLocation }}
108118
- name: Install Dependencies
109119
run: sudo ./.github/workflows/posix-deps-apt.sh
110-
- name: Add ccache to PATH
111-
run: echo "PATH=/usr/lib/ccache:$PATH" >> "$GITHUB_ENV"
112-
- name: Configure ccache action
113-
uses: hendrikmuhs/[email protected]
114-
with:
115-
save: false
116120
- name: Configure CPython
117121
run: |
118122
# Build Python with the libpython dynamic library

.github/workflows/reusable-ubuntu.yml

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,20 @@ jobs:
2626
OPENSSL_VER: 3.0.15
2727
PYTHONSTRICTEXTENSIONBUILD: 1
2828
TERM: linux
29+
SCCACHE_GHA_ENABLED: "true"
2930
steps:
3031
- uses: actions/checkout@v4
3132
- name: Register gcc problem matcher
3233
run: echo "::add-matcher::.github/problem-matchers/gcc.json"
34+
- name: Run sccache-cache on push
35+
if: github.event_name == 'push'
36+
uses: mozilla-actions/[email protected]
37+
with:
38+
version: "v0.8.2"
39+
- name: Configure CC and CXX environment variables
40+
run: |
41+
echo "CC=sccache gcc" >> "$GITHUB_ENV"
42+
echo "CXX=sccache gcc" >> "$GITHUB_ENV"
3343
- name: Install dependencies
3444
run: sudo ./.github/workflows/posix-deps-apt.sh
3545
- name: Configure OpenSSL env vars
@@ -46,14 +56,6 @@ jobs:
4656
- name: Install OpenSSL
4757
if: steps.cache-openssl.outputs.cache-hit != 'true'
4858
run: python3 Tools/ssl/multissltests.py --steps=library --base-directory "$MULTISSL_DIR" --openssl "$OPENSSL_VER" --system Linux
49-
- name: Add ccache to PATH
50-
run: |
51-
echo "PATH=/usr/lib/ccache:$PATH" >> "$GITHUB_ENV"
52-
- name: Configure ccache action
53-
uses: hendrikmuhs/[email protected]
54-
with:
55-
save: ${{ github.event_name == 'push' }}
56-
max-size: "200M"
5759
- name: Setup directory envs for out-of-tree builds
5860
run: |
5961
echo "CPYTHON_RO_SRCDIR=$(realpath -m "${GITHUB_WORKSPACE}"/../cpython-ro-srcdir)" >> "$GITHUB_ENV"

0 commit comments

Comments
 (0)