Skip to content

Commit d8aa6e4

Browse files
Add macos-14 to the push and nightly workflows (#13299)
* Add macos-14 to the push workflow * Remove hardcoded brew path in configure-macos action * Include architecture in macos job name * Add os to ccache-action in macos job * Add libsodium in brew action Since we build with the configuration option --with-sodium, adding libsodium to make sure it is installed * Add fail-fast to macos matrix * Add macos-14 to the nightly workflow * Fix adding bison to PATH in workflows * Fix architecture * Use version to compare in nightly_matrix.php * Make sure test-macos artifacts have unique name * Update .github/nightly_matrix.php Co-authored-by: Ilija Tovilo <[email protected]> --------- Co-authored-by: Ilija Tovilo <[email protected]>
1 parent cea64f7 commit d8aa6e4

File tree

6 files changed

+71
-32
lines changed

6 files changed

+71
-32
lines changed

.github/actions/brew/action.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ runs:
3131
tidy-html5 \
3232
libxml2 \
3333
libjpeg \
34+
libsodium \
3435
libxslt \
3536
postgresql
3637
brew link icu4c gettext --force

.github/actions/configure-macos/action.yml

Lines changed: 18 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -9,24 +9,25 @@ runs:
99
- shell: bash
1010
run: |
1111
set -x
12-
export PATH="/usr/local/opt/bison/bin:$PATH"
13-
export PKG_CONFIG_PATH="$PKG_CONFIG_PATH:/usr/local/opt/[email protected]/lib/pkgconfig"
14-
export PKG_CONFIG_PATH="$PKG_CONFIG_PATH:/usr/local/opt/curl/lib/pkgconfig"
15-
export PKG_CONFIG_PATH="$PKG_CONFIG_PATH:/usr/local/opt/krb5/lib/pkgconfig"
16-
export PKG_CONFIG_PATH="$PKG_CONFIG_PATH:/usr/local/opt/libffi/lib/pkgconfig"
17-
export PKG_CONFIG_PATH="$PKG_CONFIG_PATH:/usr/local/opt/libxml2/lib/pkgconfig"
18-
export PKG_CONFIG_PATH="$PKG_CONFIG_PATH:/usr/local/opt/libxslt/lib/pkgconfig"
19-
export PKG_CONFIG_PATH="$PKG_CONFIG_PATH:/usr/local/opt/zlib/lib/pkgconfig"
20-
export PKG_CONFIG_PATH="$PKG_CONFIG_PATH:/usr/local/opt/icu4c/lib/pkgconfig"
12+
BREW_OPT="$(brew --prefix)"/opt
13+
export PATH="$BREW_OPT/bison/bin:$PATH"
14+
export PKG_CONFIG_PATH="$PKG_CONFIG_PATH:$BREW_OPT/[email protected]/lib/pkgconfig"
15+
export PKG_CONFIG_PATH="$PKG_CONFIG_PATH:$BREW_OPT/curl/lib/pkgconfig"
16+
export PKG_CONFIG_PATH="$PKG_CONFIG_PATH:$BREW_OPT/krb5/lib/pkgconfig"
17+
export PKG_CONFIG_PATH="$PKG_CONFIG_PATH:$BREW_OPT/libffi/lib/pkgconfig"
18+
export PKG_CONFIG_PATH="$PKG_CONFIG_PATH:$BREW_OPT/libxml2/lib/pkgconfig"
19+
export PKG_CONFIG_PATH="$PKG_CONFIG_PATH:$BREW_OPT/libxslt/lib/pkgconfig"
20+
export PKG_CONFIG_PATH="$PKG_CONFIG_PATH:$BREW_OPT/zlib/lib/pkgconfig"
21+
export PKG_CONFIG_PATH="$PKG_CONFIG_PATH:$BREW_OPT/icu4c/lib/pkgconfig"
2122
./buildconf --force
2223
./configure \
2324
--enable-option-checking=fatal \
2425
--prefix=/usr/local \
2526
--enable-fpm \
2627
--with-pdo-mysql=mysqlnd \
2728
--with-mysqli=mysqlnd \
28-
--with-pgsql=/usr/local/opt/libpq \
29-
--with-pdo-pgsql=/usr/local/opt/libpq \
29+
--with-pgsql="$BREW_OPT"/libpq \
30+
--with-pdo-pgsql="$BREW_OPT"/libpq \
3031
--with-pdo-sqlite \
3132
--without-pear \
3233
--enable-gd \
@@ -39,21 +40,21 @@ runs:
3940
--enable-soap \
4041
--enable-xmlreader \
4142
--with-xsl \
42-
--with-tidy=/usr/local/opt/tidy-html5 \
43+
--with-tidy="$BREW_OPT"/tidy-html5 \
4344
--with-libxml \
4445
--enable-sysvsem \
4546
--enable-sysvshm \
4647
--enable-shmop \
4748
--enable-pcntl \
48-
--with-readline=/usr/local/opt/readline \
49+
--with-readline="$BREW_OPT"/readline \
4950
--enable-mbstring \
5051
--with-curl \
51-
--with-gettext=/usr/local/opt/gettext \
52+
--with-gettext="$BREW_OPT"/gettext \
5253
--enable-sockets \
53-
--with-bz2=/usr/local/opt/bzip2 \
54+
--with-bz2="$BREW_OPT"/bzip2 \
5455
--with-openssl \
55-
--with-gmp=/usr/local/opt/gmp \
56-
--with-iconv=/usr/local/opt/libiconv \
56+
--with-gmp="$BREW_OPT"/gmp \
57+
--with-iconv="$BREW_OPT"/libiconv \
5758
--enable-bcmath \
5859
--enable-calendar \
5960
--enable-ftp \

.github/actions/verify-generated-files/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ runs:
55
- shell: bash
66
run: |
77
set -x
8-
[[ "$OSTYPE" == "darwin"* ]] && export PATH="/usr/local/opt/bison/bin:$PATH"
8+
[[ "$OSTYPE" == "darwin"* ]] && export PATH="$(brew --prefix)/opt/bison/bin:$PATH"
99
scripts/dev/credits
1010
scripts/dev/genfiles
1111
Zend/zend_vm_gen.php

.github/nightly_matrix.php

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,33 @@ function get_windows_matrix_include(array $branches) {
9191
return $jobs;
9292
}
9393

94+
function get_macos_matrix_include(array $branches) {
95+
$jobs = [];
96+
foreach ($branches as $branch) {
97+
foreach([true, false] as $debug) {
98+
foreach([true, false] as $zts) {
99+
$jobs[] = [
100+
'branch' => $branch,
101+
'debug' => $debug,
102+
'zts' => $zts,
103+
'os' => $branch === 'master' ? '13' : '12',
104+
'arch' => 'X64',
105+
];
106+
if ($branch['version']['minor'] >= 4 || $branch['version']['major'] >= 9) {
107+
$jobs[] = [
108+
'branch' => $branch,
109+
'debug' => $debug,
110+
'zts' => $zts,
111+
'os' => '14',
112+
'arch' => 'ARM64',
113+
];
114+
}
115+
}
116+
}
117+
}
118+
return $jobs;
119+
}
120+
94121
function get_current_version(): array {
95122
$file = dirname(__DIR__) . '/main/php_version.h';
96123
$content = file_get_contents($file);
@@ -114,9 +141,11 @@ function get_current_version(): array {
114141
: [['name' => strtoupper($branch), 'ref' => $branch, 'version' => get_current_version()]];
115142
$matrix_include = get_matrix_include($branches);
116143
$windows_matrix_include = get_windows_matrix_include($branches);
144+
$macos_matrix_include = get_macos_matrix_include($branches);
117145

118146
$f = fopen(getenv('GITHUB_OUTPUT'), 'a');
119147
fwrite($f, 'branches=' . json_encode($branches, JSON_UNESCAPED_SLASHES) . "\n");
120148
fwrite($f, 'matrix-include=' . json_encode($matrix_include, JSON_UNESCAPED_SLASHES) . "\n");
121149
fwrite($f, 'windows-matrix-include=' . json_encode($windows_matrix_include, JSON_UNESCAPED_SLASHES) . "\n");
150+
fwrite($f, 'macos-matrix-include=' . json_encode($macos_matrix_include, JSON_UNESCAPED_SLASHES) . "\n");
122151
fclose($f);

.github/workflows/nightly.yml

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ jobs:
1414
branches: ${{ steps.set-matrix.outputs.branches }}
1515
matrix-include: ${{ steps.set-matrix.outputs.matrix-include }}
1616
windows-matrix-include: ${{ steps.set-matrix.outputs.windows-matrix-include }}
17+
macos-matrix-include: ${{ steps.set-matrix.outputs.macos-matrix-include }}
1718
steps:
1819
- uses: actions/checkout@v4
1920
with:
@@ -230,11 +231,9 @@ jobs:
230231
strategy:
231232
fail-fast: false
232233
matrix:
233-
branch: ${{ fromJson(needs.GENERATE_MATRIX.outputs.branches) }}
234-
debug: [true, false]
235-
zts: [true, false]
236-
name: "${{ matrix.branch.name }}_MACOS_${{ matrix.debug && 'DEBUG' || 'RELEASE' }}_${{ matrix.zts && 'ZTS' || 'NTS' }}"
237-
runs-on: macos-${{ matrix.branch.version.minor >= 4 && '13' || '12' }}
234+
include: ${{ fromJson(needs.GENERATE_MATRIX.outputs.macos-matrix-include) }}
235+
name: "${{ matrix.branch.name }}_MACOS_${{ matrix.arch }}_${{ matrix.debug && 'DEBUG' || 'RELEASE' }}_${{ matrix.zts && 'ZTS' || 'NTS' }}"
236+
runs-on: macos-${{ matrix.os }}
238237
steps:
239238
- name: git checkout
240239
uses: actions/checkout@v4
@@ -250,33 +249,33 @@ jobs:
250249
--${{ matrix.zts && 'enable' || 'disable' }}-zts
251250
- name: make
252251
run: |-
253-
export PATH="/usr/local/opt/bison/bin:$PATH"
252+
export PATH="$(brew --prefix)/opt/bison/bin:$PATH"
254253
make -j$(sysctl -n hw.logicalcpu) >/dev/null
255254
- name: make install
256255
run: sudo make install
257256
- name: Test
258257
uses: ./.github/actions/test-macos
259258
with:
260-
testArtifacts: ${{ matrix.branch.name }}_${{ matrix.debug && 'DEBUG' || 'RELEASE' }}_${{ matrix.zts && 'ZTS' || 'NTS' }}
259+
testArtifacts: ${{ matrix.branch.name }}_${{ matrix.arch }}_${{ matrix.debug && 'DEBUG' || 'RELEASE' }}_${{ matrix.zts && 'ZTS' || 'NTS' }}
261260
- name: Test Tracing JIT
262261
uses: ./.github/actions/test-macos
263262
with:
264-
testArtifacts: ${{ matrix.branch.name }}_${{ matrix.debug && 'DEBUG' || 'RELEASE' }}_${{ matrix.zts && 'ZTS' || 'NTS' }} Tracing JIT
263+
testArtifacts: ${{ matrix.branch.name }}_${{ matrix.arch }}_${{ matrix.debug && 'DEBUG' || 'RELEASE' }}_${{ matrix.zts && 'ZTS' || 'NTS' }} Tracing JIT
265264
jitType: tracing
266265
runTestsParameters: >-
267266
-d zend_extension=opcache.so
268267
-d opcache.enable_cli=1
269268
- name: Test OpCache
270269
uses: ./.github/actions/test-macos
271270
with:
272-
testArtifacts: ${{ matrix.branch.name }}_${{ matrix.debug && 'DEBUG' || 'RELEASE' }}_${{ matrix.zts && 'ZTS' || 'NTS' }} OpCache
271+
testArtifacts: ${{ matrix.branch.name }}_${{ matrix.arch }}_${{ matrix.debug && 'DEBUG' || 'RELEASE' }}_${{ matrix.zts && 'ZTS' || 'NTS' }} OpCache
273272
runTestsParameters: >-
274273
-d zend_extension=opcache.so
275274
-d opcache.enable_cli=1
276275
- name: Test Function JIT
277276
uses: ./.github/actions/test-macos
278277
with:
279-
testArtifacts: ${{ matrix.branch.name }}_${{ matrix.debug && 'DEBUG' || 'RELEASE' }}_${{ matrix.zts && 'ZTS' || 'NTS' }} Function JIT
278+
testArtifacts: ${{ matrix.branch.name }}_${{ matrix.arch }}_${{ matrix.debug && 'DEBUG' || 'RELEASE' }}_${{ matrix.zts && 'ZTS' || 'NTS' }} Function JIT
280279
jitType: function
281280
runTestsParameters: >-
282281
-d zend_extension=opcache.so

.github/workflows/push.yml

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,16 @@ jobs:
148148
if: ${{ !matrix.asan }}
149149
uses: ./.github/actions/verify-generated-files
150150
MACOS_DEBUG_NTS:
151-
runs-on: macos-13
151+
strategy:
152+
fail-fast: false
153+
matrix:
154+
include:
155+
- os: 13
156+
arch: X64
157+
- os: 14
158+
arch: ARM64
159+
name: MACOS_${{ matrix.arch }}_DEBUG_NTS
160+
runs-on: macos-${{ matrix.os }}
152161
steps:
153162
- name: git checkout
154163
uses: actions/checkout@v4
@@ -157,22 +166,22 @@ jobs:
157166
- name: ccache
158167
uses: hendrikmuhs/[email protected]
159168
with:
160-
key: "${{github.job}}-${{hashFiles('main/php_version.h')}}"
169+
key: "${{github.job}}-${{matrix.os}}-${{hashFiles('main/php_version.h')}}"
161170
append-timestamp: false
162171
- name: ./configure
163172
uses: ./.github/actions/configure-macos
164173
with:
165174
configurationParameters: --enable-debug --disable-zts
166175
- name: make
167176
run: |-
168-
export PATH="/usr/local/opt/bison/bin:$PATH"
177+
export PATH="$(brew --prefix)/opt/bison/bin:$PATH"
169178
make -j$(sysctl -n hw.logicalcpu) >/dev/null
170179
- name: make install
171180
run: sudo make install
172181
- name: Test Tracing JIT
173182
uses: ./.github/actions/test-macos
174183
with:
175-
testArtifacts: ${{ matrix.debug && 'DEBUG' || 'RELEASE' }}_${{ matrix.zts && 'ZTS' || 'NTS' }} Tracing JIT
184+
testArtifacts: ${{ matrix.arch }}_${{ matrix.debug && 'DEBUG' || 'RELEASE' }}_${{ matrix.zts && 'ZTS' || 'NTS' }} Tracing JIT
176185
jitType: tracing
177186
runTestsParameters: >-
178187
-d zend_extension=opcache.so

0 commit comments

Comments
 (0)