Skip to content

Commit

Permalink
Add build cache for compiling v8
Browse files Browse the repository at this point in the history
  • Loading branch information
JoshuaBehrens committed Sep 28, 2024
1 parent 1284952 commit 29e788a
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions .github/workflows/build-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,20 @@ jobs:
php-version: ${{ matrix.php-versions }}
coverage: none

- name: Restore cache v8 ${{ matrix.v8-versions }} build
id: v8-build-cache
uses: actions/cache/restore@v4
with:
path: /opt/v8/self-built
key: ${{ runner.os }}-${{ matrix.v8-versions }}-v8-build

- name: Setup Google depot tools
# only needed, when v8 needs to be built
if: steps.v8-build-cache.outputs.cache-hit != 'true'
uses: newkdev/[email protected]

- name: Build v8 ${{ matrix.v8-versions }}
if: steps.v8-build-cache.outputs.cache-hit != 'true'
run: |
# Store extra tools somewhere undisturbing
cd "$(mktemp -d)"
Expand All @@ -66,6 +76,13 @@ jobs:
# Go back to origin
cd "${GITHUB_WORKSPACE}"
- name: Save v8 ${{ matrix.v8-versions }} build cache
if: steps.v8-build-cache.outputs.cache-hit != 'true'
uses: actions/cache/save@v4
with:
path: /opt/v8/self-built
key: ${{ steps.v8-build-cache.outputs.cache-primary-key }}

- name: Build extension
run: |
phpize
Expand Down

0 comments on commit 29e788a

Please sign in to comment.