Skip to content

Commit

Permalink
Extract v8 cache building to run less often to reduce computation costs
Browse files Browse the repository at this point in the history
  • Loading branch information
JoshuaBehrens committed Oct 24, 2024
1 parent 84cc0b0 commit 4e7aabc
Showing 1 changed file with 41 additions and 17 deletions.
58 changes: 41 additions & 17 deletions .github/workflows/build-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,14 @@ permissions:
contents: read

jobs:
self-built-v8:
self-built-v8-cache-warmup:
strategy:
matrix:
operating-system:
operating-system: # &self-built-v8-operating-systems
- ubuntu-latest
# - windows-latest
- macos-latest
php-versions:
# - '8.1'
- '8.2'
- '8.3'
- '8.4'
v8-versions:
v8-versions: # &self-built-v8-v8-versions
- 10.9.194
# - 11.9.172
- 12.9.203
Expand All @@ -33,15 +28,6 @@ jobs:
runs-on: ${{ matrix.operating-system }}

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
coverage: none

- name: Restore cache v8 ${{ matrix.v8-versions }} build
id: v8-build-cache
uses: actions/cache/restore@v4
Expand Down Expand Up @@ -88,6 +74,44 @@ jobs:
path: /opt/v8/self-built
key: ${{ steps.v8-build-cache.outputs.cache-primary-key }}

self-built-v8:
needs: self-built-v8-cache-warmup

strategy:
matrix:
operating-system: # *self-built-v8-operating-systems
- ubuntu-latest
# - windows-latest
- macos-latest
v8-versions: # *self-built-v8-v8-versions
- 10.9.194
# - 11.9.172
- 12.9.203
# - 13.1.104
php-versions:
# - '8.1'
- '8.2'
- '8.3'
- '8.4'

runs-on: ${{ matrix.operating-system }}

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
coverage: none

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

- name: Build extension
run: |
phpize
Expand Down

0 comments on commit 4e7aabc

Please sign in to comment.