Skip to content

Commit f437fdd

Browse files
committed
Extract v8 cache building to run less often to reduce computation costs
1 parent 352f598 commit f437fdd

File tree

1 file changed

+41
-17
lines changed

1 file changed

+41
-17
lines changed

.github/workflows/build-test.yml

Lines changed: 41 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -12,22 +12,17 @@ permissions:
1212
contents: read
1313

1414
jobs:
15-
self-built-v8:
15+
self-built-v8-cache-warmup:
1616
strategy:
1717
# set in accordance with number of v8-versions, so caching can kick in properly
1818
max-parallel: 2
1919

2020
matrix:
21-
operating-system:
21+
operating-system: # &self-built-v8-operating-systems
2222
- ubuntu-latest
2323
# - windows-latest
2424
- macos-latest
25-
php-versions:
26-
# - '8.1'
27-
- '8.2'
28-
- '8.3'
29-
- '8.4'
30-
v8-versions:
25+
v8-versions: # &self-built-v8-v8-versions
3126
- 10.9.194
3227
# - 11.9.172
3328
- 12.9.203
@@ -36,15 +31,6 @@ jobs:
3631
runs-on: ${{ matrix.operating-system }}
3732

3833
steps:
39-
- name: Checkout code
40-
uses: actions/checkout@v2
41-
42-
- name: Setup PHP
43-
uses: shivammathur/setup-php@v2
44-
with:
45-
php-version: ${{ matrix.php-versions }}
46-
coverage: none
47-
4834
- name: Restore cache v8 ${{ matrix.v8-versions }} build
4935
id: v8-build-cache
5036
uses: actions/cache/restore@v4
@@ -91,6 +77,44 @@ jobs:
9177
path: /opt/v8/self-built
9278
key: ${{ steps.v8-build-cache.outputs.cache-primary-key }}
9379

80+
self-built-v8:
81+
needs: self-built-v8-cache-warmup
82+
83+
strategy:
84+
matrix:
85+
operating-system: # *self-built-v8-operating-systems
86+
- ubuntu-latest
87+
# - windows-latest
88+
- macos-latest
89+
v8-versions: # *self-built-v8-v8-versions
90+
- 10.9.194
91+
# - 11.9.172
92+
- 12.9.203
93+
# - 13.1.104
94+
php-versions:
95+
# - '8.1'
96+
- '8.2'
97+
- '8.3'
98+
- '8.4'
99+
100+
runs-on: ${{ matrix.operating-system }}
101+
102+
steps:
103+
- name: Checkout code
104+
uses: actions/checkout@v2
105+
106+
- name: Setup PHP
107+
uses: shivammathur/setup-php@v2
108+
with:
109+
php-version: ${{ matrix.php-versions }}
110+
coverage: none
111+
112+
- name: Download cache v8 ${{ matrix.v8-versions }} build
113+
uses: actions/cache/restore@v4
114+
with:
115+
path: /opt/v8/self-built
116+
key: ${{ runner.os }}-${{ matrix.v8-versions }}-v8-build
117+
94118
- name: Build extension
95119
run: |
96120
phpize

0 commit comments

Comments
 (0)