Skip to content

Commit 29e788a

Browse files
committed
Add build cache for compiling v8
1 parent 1284952 commit 29e788a

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

.github/workflows/build-test.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,20 @@ jobs:
3737
php-version: ${{ matrix.php-versions }}
3838
coverage: none
3939

40+
- name: Restore cache v8 ${{ matrix.v8-versions }} build
41+
id: v8-build-cache
42+
uses: actions/cache/restore@v4
43+
with:
44+
path: /opt/v8/self-built
45+
key: ${{ runner.os }}-${{ matrix.v8-versions }}-v8-build
46+
4047
- name: Setup Google depot tools
48+
# only needed, when v8 needs to be built
49+
if: steps.v8-build-cache.outputs.cache-hit != 'true'
4150
uses: newkdev/setup-depot-tools@v1.0.1
4251

4352
- name: Build v8 ${{ matrix.v8-versions }}
53+
if: steps.v8-build-cache.outputs.cache-hit != 'true'
4454
run: |
4555
# Store extra tools somewhere undisturbing
4656
cd "$(mktemp -d)"
@@ -66,6 +76,13 @@ jobs:
6676
# Go back to origin
6777
cd "${GITHUB_WORKSPACE}"
6878
79+
- name: Save v8 ${{ matrix.v8-versions }} build cache
80+
if: steps.v8-build-cache.outputs.cache-hit != 'true'
81+
uses: actions/cache/save@v4
82+
with:
83+
path: /opt/v8/self-built
84+
key: ${{ steps.v8-build-cache.outputs.cache-primary-key }}
85+
6986
- name: Build extension
7087
run: |
7188
phpize

0 commit comments

Comments
 (0)