Skip to content

Commit f7e6784

Browse files
MaxKellermanniluuu1994
authored andcommitted
.github/workflows/push.yml: enable ccache
This reduces the LINUX_X64_RELEASE_ZTS build time from 9-10 minutes to less than 3 minutes. Closes GH-10395
1 parent d17175c commit f7e6784

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
@@ -17,6 +17,9 @@ on:
1717
pull_request:
1818
branches:
1919
- '**'
20+
env:
21+
CC: ccache gcc
22+
CXX: ccache g++
2023
jobs:
2124
LINUX_X64:
2225
strategy:
@@ -38,6 +41,13 @@ jobs:
3841
uses: ./.github/actions/setup-oracle
3942
- name: apt
4043
uses: ./.github/actions/apt-x64
44+
- name: ccache
45+
uses: hendrikmuhs/ccache-action@v1.2
46+
with:
47+
# This duplicates the "job.name" expression above because
48+
# GitHub has no way to query the job name (github.job is the
49+
# job id, not the job name)
50+
key: "LINUX_X64_${{ matrix.debug && 'DEBUG' || 'RELEASE' }}_${{ matrix.zts && 'ZTS' || 'NTS' }}-${{hashFiles('main/php_version.h')}}"
4151
- name: ./configure
4252
uses: ./.github/actions/configure-x64
4353
with:
@@ -83,6 +93,10 @@ jobs:
8393
uses: actions/checkout@v3
8494
- name: apt
8595
uses: ./.github/actions/apt-x32
96+
- name: ccache
97+
uses: hendrikmuhs/ccache-action@v1.2
98+
with:
99+
key: "${{github.job}}-${{hashFiles('main/php_version.h')}}"
86100
- name: ./configure
87101
uses: ./.github/actions/configure-x32
88102
with:
@@ -109,6 +123,10 @@ jobs:
109123
uses: actions/checkout@v3
110124
- name: brew
111125
uses: ./.github/actions/brew
126+
- name: ccache
127+
uses: hendrikmuhs/ccache-action@v1.2
128+
with:
129+
key: "${{github.job}}-${{hashFiles('main/php_version.h')}}"
112130
- name: ./configure
113131
uses: ./.github/actions/configure-macos
114132
with:

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -281,6 +281,7 @@ tmp-php.ini
281281
# GitHub actions cache
282282
# ------------------------------------------------------------------------------
283283
/branch-commit-cache.json
284+
/.ccache/
284285

285286
# ------------------------------------------------------------------------------
286287
# Special cases to invert previous ignore patterns

0 commit comments

Comments
 (0)