From 29e788aa1f6bebe3d2dce2386cfb6c931bd25f06 Mon Sep 17 00:00:00 2001 From: Joshua Behrens Date: Sat, 28 Sep 2024 04:22:51 +0200 Subject: [PATCH] Add build cache for compiling v8 --- .github/workflows/build-test.yml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/.github/workflows/build-test.yml b/.github/workflows/build-test.yml index 067d562..1902c69 100644 --- a/.github/workflows/build-test.yml +++ b/.github/workflows/build-test.yml @@ -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/setup-depot-tools@v1.0.1 - name: Build v8 ${{ matrix.v8-versions }} + if: steps.v8-build-cache.outputs.cache-hit != 'true' run: | # Store extra tools somewhere undisturbing cd "$(mktemp -d)" @@ -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