Skip to content

Commit 58c43d5

Browse files
committed
perf: aded circle ci compile caching
1 parent 3dcc018 commit 58c43d5

1 file changed

Lines changed: 20 additions & 3 deletions

File tree

.circleci/config.yml

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,10 @@ jobs:
2424
PDO_MYSQL_TEST_PASS: ''
2525
PDO_MYSQL_TEST_USER: root
2626
PDO_PGSQL_TEST_DSN: 'pgsql:host=127.0.0.1 port=5432 dbname=test user=postgres password=postgres'
27+
CCACHE_BASEDIR: /home/circleci/project
28+
CCACHE_COMPILERCHECK: content
29+
CCACHE_DIR: /home/circleci/.cache/ccache
30+
CCACHE_MAXSIZE: 500M
2731
steps:
2832
- checkout
2933
- run:
@@ -78,12 +82,18 @@ jobs:
7882
libqdbm-dev \
7983
libjpeg-dev \
8084
libpng-dev \
81-
libfreetype-dev
85+
libfreetype-dev \
86+
ccache
87+
- restore_cache:
88+
keys:
89+
- ccache-v1-arm-gcc-{{ checksum "main/php_version.h" }}-{{ .Branch }}-{{ .Revision }}
90+
- ccache-v1-arm-gcc-{{ checksum "main/php_version.h" }}-{{ .Branch }}-
91+
- ccache-v1-arm-gcc-{{ checksum "main/php_version.h" }}-master-
8292
- run:
8393
name: ./configure
8494
command: |
8595
./buildconf -f
86-
./configure \
96+
CC="ccache gcc" CXX="ccache g++" ./configure \
8797
--enable-debug \
8898
--enable-zts \
8999
--enable-option-checking=fatal \
@@ -153,7 +163,14 @@ jobs:
153163
- run:
154164
name: make
155165
no_output_timeout: 30m
156-
command: make -j2 > /dev/null
166+
command: |
167+
ccache --zero-stats
168+
make -j2 > /dev/null
169+
ccache --show-stats
170+
- save_cache:
171+
key: ccache-v1-arm-gcc-{{ checksum "main/php_version.h" }}-{{ .Branch }}-{{ .Revision }}
172+
paths:
173+
- /home/circleci/.cache/ccache
157174
- run:
158175
name: make install
159176
command: |

0 commit comments

Comments
 (0)