Skip to content

Commit 3ec9f2b

Browse files
committed
Nightly
1 parent 421d6f0 commit 3ec9f2b

File tree

4 files changed

+79
-63
lines changed

4 files changed

+79
-63
lines changed

.github/actions/test-alpine/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ runs:
1717
sapi/cli/php run-tests.php -P -q ${{ inputs.runTestsParameters }} \
1818
-d opcache.jit=${{ inputs.jitType }} \
1919
-d opcache.jit_buffer_size=64M \
20-
-j$(($(nproc) - 1)) \
20+
-j$(nproc) \
2121
-g FAIL,BORK,LEAK,XLEAK \
2222
--no-progress \
2323
--show-diff \

.github/nightly_matrix.php

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,26 @@ function get_macos_matrix_include(array $branches) {
121121
return $jobs;
122122
}
123123

124+
function get_alpine_matrix_include(array $branches) {
125+
$jobs = [];
126+
foreach ($branches as $branch) {
127+
if ([$branch['version']['major'], $branch['version']['minor']] < [8, 4]) {
128+
continue;
129+
}
130+
$jobs[] = [
131+
'name' => '_ASAN_UBSAN',
132+
'branch' => $branch,
133+
'debug' => true,
134+
'zts' => true,
135+
'asan' => true,
136+
'test_jit' => true,
137+
'configuration_parameters' => "CFLAGS='-fsanitize=undefined,address -fno-sanitize=function -DZEND_TRACK_ARENA_ALLOC' LDFLAGS='-fsanitize=undefined,address -fno-sanitize=function' CC=clang-17 CXX=clang++-17",
138+
'run_tests_parameters' => '--asan -x',
139+
];
140+
}
141+
return $jobs;
142+
}
143+
124144
function get_current_version(): array {
125145
$file = dirname(__DIR__) . '/main/php_version.h';
126146
$content = file_get_contents($file);
@@ -145,10 +165,12 @@ function get_current_version(): array {
145165
$matrix_include = get_matrix_include($branches);
146166
$windows_matrix_include = get_windows_matrix_include($branches);
147167
$macos_matrix_include = get_macos_matrix_include($branches);
168+
$alpine_matrix_include = get_alpine_matrix_include($branches);
148169

149170
$f = fopen(getenv('GITHUB_OUTPUT'), 'a');
150171
fwrite($f, 'branches=' . json_encode($branches, JSON_UNESCAPED_SLASHES) . "\n");
151172
fwrite($f, 'matrix-include=' . json_encode($matrix_include, JSON_UNESCAPED_SLASHES) . "\n");
152173
fwrite($f, 'windows-matrix-include=' . json_encode($windows_matrix_include, JSON_UNESCAPED_SLASHES) . "\n");
153174
fwrite($f, 'macos-matrix-include=' . json_encode($macos_matrix_include, JSON_UNESCAPED_SLASHES) . "\n");
175+
fwrite($f, 'alpine-matrix-include=' . json_encode($alpine_matrix_include, JSON_UNESCAPED_SLASHES) . "\n");
154176
fclose($f);

.github/workflows/nightly.yml

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ jobs:
1515
matrix-include: ${{ steps.set-matrix.outputs.matrix-include }}
1616
windows-matrix-include: ${{ steps.set-matrix.outputs.windows-matrix-include }}
1717
macos-matrix-include: ${{ steps.set-matrix.outputs.macos-matrix-include }}
18+
alpine-matrix-include: ${{ steps.set-matrix.outputs.alpine-matrix-include }}
1819
steps:
1920
- uses: actions/checkout@v4
2021
with:
@@ -39,6 +40,61 @@ jobs:
3940
uses: ./.github/actions/notify-slack
4041
with:
4142
token: ${{ secrets.ACTION_MONITORING_SLACK }}
43+
ALPINE:
44+
needs: GENERATE_MATRIX
45+
if: ${{ needs.GENERATE_MATRIX.outputs.branches != '[]' }}
46+
strategy:
47+
fail-fast: false
48+
matrix:
49+
include: ${{ fromJson(needs.GENERATE_MATRIX.outputs.alpine-matrix-include) }}
50+
name: "${{ matrix.branch.name }}_ALPINE_X64${{ matrix.name }}_${{ matrix.debug && 'DEBUG' || 'RELEASE' }}_${{ matrix.zts && 'ZTS' || 'NTS' }}"
51+
runs-on: ubuntu-22.04
52+
container:
53+
image: 'alpine:3.20.1'
54+
steps:
55+
- name: git checkout
56+
uses: actions/checkout@v4
57+
with:
58+
ref: ${{ matrix.branch.ref }}
59+
- name: apk
60+
uses: ./.github/actions/apk
61+
- name: LLVM 17 (ASAN-only)
62+
if: ${{ matrix.asan }}
63+
# libclang_rt.asan-x86_64.a is provided by compiler-rt, and only for clang17:
64+
# https://pkgs.alpinelinux.org/contents?file=libclang_rt.asan-x86_64.a&path=&name=&branch=v3.20
65+
run: |
66+
apk add clang17 compiler-rt
67+
- name: System info
68+
run: |
69+
echo "::group::Show host CPU info"
70+
lscpu
71+
echo "::endgroup::"
72+
echo "::group::Show installed package versions"
73+
apk list
74+
echo "::endgroup::"
75+
- name: ./configure
76+
uses: ./.github/actions/configure-alpine
77+
with:
78+
configurationParameters: >-
79+
${{ matrix.configuration_parameters }}
80+
--${{ matrix.debug && 'enable' || 'disable' }}-debug
81+
--${{ matrix.zts && 'enable' || 'disable' }}-zts
82+
skipSlow: ${{ matrix.asan }}
83+
- name: make
84+
run: make -j$(/usr/bin/nproc) >/dev/null
85+
- name: make install
86+
uses: ./.github/actions/install-alpine
87+
- name: Test Tracing JIT
88+
if: matrix.test_jit
89+
uses: ./.github/actions/test-alpine
90+
with:
91+
jitType: tracing
92+
runTestsParameters: >-
93+
${{ matrix.run_tests_parameters }}
94+
-d zend_extension=opcache.so
95+
-d opcache.enable_cli=1
96+
${{ matrix.asan && '--asan -x' || '' }}
97+
4298
LINUX_X64:
4399
needs: GENERATE_MATRIX
44100
if: ${{ needs.GENERATE_MATRIX.outputs.branches != '[]' }}

.github/workflows/push.yml

Lines changed: 0 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -191,68 +191,6 @@ jobs:
191191
runTestsParameters: >-
192192
-d zend_extension=opcache.so
193193
-d opcache.enable_cli=1
194-
ALPINE:
195-
if: github.repository == 'php/php-src' || github.event_name == 'pull_request'
196-
strategy:
197-
fail-fast: false
198-
matrix:
199-
include:
200-
- debug: true
201-
zts: true
202-
asan: true
203-
name: "ALPINE_${{ matrix.debug && 'DEBUG' || 'RELEASE' }}_${{ matrix.zts && 'ZTS' || 'NTS' }}${{ matrix.asan && '_ASAN' || '' }}"
204-
runs-on: ubuntu-22.04
205-
container:
206-
image: 'alpine:3.20.1'
207-
steps:
208-
- name: git checkout
209-
uses: actions/checkout@v4
210-
- name: apk
211-
uses: ./.github/actions/apk
212-
- name: LLVM 17 (ASAN-only)
213-
if: ${{ matrix.asan }}
214-
# libclang_rt.asan-x86_64.a is provided by compiler-rt, and only for clang17:
215-
# https://pkgs.alpinelinux.org/contents?file=libclang_rt.asan-x86_64.a&path=&name=&branch=v3.20
216-
run: |
217-
apk add clang17 compiler-rt
218-
- name: System info
219-
run: |
220-
echo "::group::Show host CPU info"
221-
lscpu
222-
echo "::endgroup::"
223-
echo "::group::Show installed package versions"
224-
apk list
225-
echo "::endgroup::"
226-
- name: ccache
227-
uses: hendrikmuhs/ccache-action@v1.2
228-
with:
229-
# This duplicates the "job.name" expression above because
230-
# GitHub has no way to query the job name (github.job is the
231-
# job id, not the job name)
232-
key: "ALPINE_${{ matrix.debug && 'DEBUG' || 'RELEASE' }}_${{ matrix.zts && 'ZTS' || 'NTS' }}${{ matrix.asan && '_ASAN' || '' }}-${{hashFiles('main/php_version.h')}}"
233-
append-timestamp: false
234-
save: ${{ github.event_name != 'pull_request' }}
235-
- name: ./configure
236-
uses: ./.github/actions/configure-alpine
237-
with:
238-
# -Wno-error=stringop-overread: main/getopt.c: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114622
239-
configurationParameters: >-
240-
--${{ matrix.debug && 'enable' || 'disable' }}-debug
241-
--${{ matrix.zts && 'enable' || 'disable' }}-zts
242-
${{ matrix.asan && 'CFLAGS="-fsanitize=undefined,address -fno-sanitize=function -DZEND_TRACK_ARENA_ALLOC" LDFLAGS="-fsanitize=undefined,address -fno-sanitize=function" CC=clang-17 CXX=clang++-17' || 'CFLAGS="-Wno-error=stringop-overread"' }}
243-
skipSlow: ${{ matrix.asan }}
244-
- name: make
245-
run: make -j$(/usr/bin/nproc) >/dev/null
246-
- name: make install
247-
uses: ./.github/actions/install-alpine
248-
- name: Test Tracing JIT
249-
uses: ./.github/actions/test-alpine
250-
with:
251-
jitType: tracing
252-
runTestsParameters: >-
253-
-d zend_extension=opcache.so
254-
-d opcache.enable_cli=1
255-
${{ matrix.asan && '--asan -x' || '' }}
256194
MACOS_DEBUG_NTS:
257195
if: github.repository == 'php/php-src' || github.event_name == 'pull_request'
258196
strategy:

0 commit comments

Comments
 (0)