forked from symfony/php-ext-deepclone
-
Notifications
You must be signed in to change notification settings - Fork 0
232 lines (202 loc) · 6.92 KB
/
test.yml
File metadata and controls
232 lines (202 loc) · 6.92 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
name: CI
on:
push:
branches: [main]
tags: ['v*.*.*']
pull_request:
permissions:
contents: read
jobs:
linux:
name: "Linux ${{ matrix.php }} ${{ matrix.zts && 'ZTS' || 'NTS' }}"
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
php: ['8.2', '8.3', '8.4']
zts: [false]
include:
- php: '8.4'
zts: true
# 8.5 tracks the development branch (nightly); failures here are
# informational and must not block the matrix.
- php: '8.5'
zts: false
experimental: true
continue-on-error: ${{ matrix.experimental == true }}
steps:
- uses: actions/checkout@v6
- name: Setup PHP ${{ matrix.php }}
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: mongodb, tidy
coverage: none
tools: none
env:
phpts: ${{ matrix.zts && 'zts' || 'nts' }}
- name: phpize
run: phpize
- name: configure
run: ./configure --enable-deepclone CFLAGS="-Wall -Wextra -Werror -Wno-unused-parameter -Wno-sign-compare"
- name: make
run: make -j$(nproc)
- name: make test
run: |
export NO_INTERACTION=1
export REPORT_EXIT_STATUS=1
export TEST_PHP_JUNIT=junit.xml
make test TESTS="-q --show-diff tests/"
- name: Show failing test diffs
if: failure()
run: |
for f in tests/*.diff tests/*.out tests/*.log; do
[ -e "$f" ] || continue
echo "::group::$f"
cat "$f"
echo "::endgroup::"
done
asan:
name: "Linux 8.4 NTS + ASAN/UBSAN"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Setup PHP 8.4 with ASAN
uses: shivammathur/setup-php@v2
with:
php-version: '8.4'
extensions: mongodb, tidy
coverage: none
tools: none
- name: phpize
run: phpize
- name: configure with sanitizers
run: |
export CFLAGS="-fsanitize=address,undefined -fno-omit-frame-pointer -g -O1 -Wall -Wextra -Werror -Wno-unused-parameter -Wno-sign-compare"
export LDFLAGS="-fsanitize=address,undefined"
./configure --enable-deepclone
- name: make
run: make -j$(nproc)
- name: make test
env:
ASAN_OPTIONS: "detect_leaks=0:abort_on_error=1:halt_on_error=1"
UBSAN_OPTIONS: "print_stacktrace=1:halt_on_error=1"
USE_ZEND_ALLOC: "0"
NO_INTERACTION: "1"
REPORT_EXIT_STATUS: "1"
run: make test TESTS="-q --show-diff tests/"
- name: Show failing test diffs
if: failure()
run: |
for f in tests/*.diff tests/*.out tests/*.log; do
[ -e "$f" ] || continue
echo "::group::$f"
cat "$f"
echo "::endgroup::"
done
linux32:
# Native 32-bit Linux build. We can't use a `container:` block here
# because GitHub injects the x86_64 Node runtime into it and a pure
# i386 image can't execute it ("exec /__e/node24/bin/node: no such
# file or directory"). Instead, do checkout on the x86_64 host and
# spawn the i386 container manually for the build/test step. i386
# binaries run natively on x86_64 hosts — no qemu involved. Debian
# Bookworm still ships PHP 8.2 on i386, which is enough to validate
# the source compiles and runs correctly when sizeof(zend_long) == 4.
name: "Linux i386 PHP 8.2"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Build and test inside i386/debian:bookworm
run: |
docker run --rm --platform linux/386 -v "$PWD:/work" -w /work \
-e NO_INTERACTION=1 -e REPORT_EXIT_STATUS=1 \
i386/debian:bookworm sh -eu -c '
apt-get update
apt-get install -y --no-install-recommends \
build-essential autoconf pkg-config ca-certificates \
php-cli php-dev
phpize
./configure --enable-deepclone \
CFLAGS="-Wall -Wextra -Werror -Wno-unused-parameter -Wno-sign-compare"
make -j"$(nproc)"
make test TESTS="-q --show-diff tests/"
'
- name: Show failing test diffs
if: failure()
run: |
for f in tests/*.diff tests/*.out tests/*.log; do
[ -e "$f" ] || continue
echo "::group::$f"
cat "$f"
echo "::endgroup::"
done
macos:
name: "macOS ${{ matrix.php }}"
runs-on: macos-latest
strategy:
fail-fast: false
matrix:
php: ['8.3', '8.4']
steps:
- uses: actions/checkout@v6
- name: Setup PHP ${{ matrix.php }}
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: mongodb, tidy
coverage: none
tools: none
- name: build & test
run: |
phpize
./configure --enable-deepclone
make -j$(sysctl -n hw.ncpu)
NO_INTERACTION=1 REPORT_EXIT_STATUS=1 make test TESTS="-q tests/"
windows-matrix:
# Generate a Windows build matrix (PHP version × arch × ts × VS toolset)
# via the official php/php-windows-builder action — the same recipe used
# by ext/xdebug, ext/apcu, ext/uopz and other PECL extensions.
name: "Windows build matrix"
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.matrix.outputs.matrix }}
steps:
- uses: actions/checkout@v6
- id: matrix
uses: php/php-windows-builder/extension-matrix@v1
with:
php-version-list: '8.2, 8.3, 8.4, 8.5'
arch-list: 'x64'
windows:
name: "Windows ${{ matrix.php-version }} ${{ matrix.arch }} ${{ matrix.ts }}"
needs: windows-matrix
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix: ${{ fromJson(needs.windows-matrix.outputs.matrix) }}
steps:
- uses: actions/checkout@v6
- name: Build the extension
uses: php/php-windows-builder/extension@v1
with:
php-version: ${{ matrix.php-version }}
arch: ${{ matrix.arch }}
ts: ${{ matrix.ts }}
args: --enable-deepclone
release:
# On tag pushes, collect every Windows build artifact uploaded by the
# `windows` matrix above and attach the resulting DLLs to the GitHub
# release. PIE will then download the matching prebuilt DLL on Windows
# instead of asking the user to compile from source.
name: "Publish Windows DLLs to release"
needs: windows
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: php/php-windows-builder/release@v1
with:
release: ${{ github.ref }}
token: ${{ secrets.GITHUB_TOKEN }}