Skip to content

Commit 506b3d1

Browse files
committed
.github/workflows/push.yml: enable ccache
This reduces the LINUX_X64_RELEASE_ZTS build time from 9-10 minutes to less than 3 minutes.
1 parent 4f36623 commit 506b3d1

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

.github/workflows/push.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@ on:
2020
- '**'
2121
permissions:
2222
contents: read
23+
env:
24+
CC: ccache gcc
25+
CXX: ccache g++
2326
jobs:
2427
LINUX_X64:
2528
strategy:
@@ -41,6 +44,13 @@ jobs:
4144
uses: ./.github/actions/setup-oracle
4245
- name: apt
4346
uses: ./.github/actions/apt-x64
47+
- name: ccache
48+
uses: hendrikmuhs/ccache-action@v1.2
49+
with:
50+
# This duplicates the "job.name" expression above because
51+
# GitHub has no way to query the job name (github.job is the
52+
# job id, not the job name)
53+
key: "LINUX_X64_${{ matrix.debug && 'DEBUG' || 'RELEASE' }}_${{ matrix.zts && 'ZTS' || 'NTS' }}-${{hashFiles('main/php_version.h')}}"
4454
- name: ./configure
4555
uses: ./.github/actions/configure-x64
4656
with:
@@ -89,6 +99,10 @@ jobs:
8999
uses: actions/checkout@v3
90100
- name: apt
91101
uses: ./.github/actions/apt-x32
102+
- name: ccache
103+
uses: hendrikmuhs/ccache-action@v1.2
104+
with:
105+
key: "${{github.job}}-${{hashFiles('main/php_version.h')}}"
92106
- name: ./configure
93107
uses: ./.github/actions/configure-x32
94108
with:
@@ -115,6 +129,10 @@ jobs:
115129
uses: actions/checkout@v3
116130
- name: brew
117131
uses: ./.github/actions/brew
132+
- name: ccache
133+
uses: hendrikmuhs/ccache-action@v1.2
134+
with:
135+
key: "${{github.job}}-${{hashFiles('main/php_version.h')}}"
118136
- name: ./configure
119137
uses: ./.github/actions/configure-macos
120138
with:

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -285,6 +285,7 @@ tmp-php.ini
285285
# ------------------------------------------------------------------------------
286286
/branch-commit-cache.json
287287
/junit.out.xml
288+
/.ccache/
288289

289290
# ------------------------------------------------------------------------------
290291
# Special cases to invert previous ignore patterns

0 commit comments

Comments
 (0)