-
-
Notifications
You must be signed in to change notification settings - Fork 10
105 lines (95 loc) · 3.73 KB
/
tests.yml
File metadata and controls
105 lines (95 loc) · 3.73 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
name: Tests
on:
push:
branches:
- main
pull_request:
jobs:
get-windows-extension-matrix:
runs-on: ubuntu-latest
name: "Generate Windows Build Matrix"
outputs:
matrix: ${{ steps.extension-matrix.outputs.matrix }}
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Get The Windows Extension Matrix
id: extension-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:
needs: get-windows-extension-matrix
runs-on: ${{ matrix.os }}
name: "Windows PHP ${{ matrix.php-version }} ${{ matrix.ts == 'ts' && 'ZTS' || 'NTS' }}"
strategy:
fail-fast: false
matrix: ${{fromJson(needs.get-windows-extension-matrix.outputs.matrix)}}
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Build & run tests
uses: php/php-windows-builder/extension@v1
with:
php-version: ${{ matrix.php-version }}
arch: x64
ts: ${{ matrix.ts }}
args: --enable-php-debugger
test-runner: run-xdebug-tests.php
linux:
runs-on: ubuntu-latest
name: "PHP ${{ matrix.php }} ${{ matrix.zts && 'ZTS' || 'NTS' }} ${{ matrix.opcache && '(opcache)' || '' }}"
strategy:
fail-fast: false
matrix:
php: ['8.2', '8.3', '8.4', '8.5']
zts: [false, true]
opcache: [false, true]
exclude:
- php: '8.5'
opcache: true
steps:
- uses: actions/checkout@v6
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: "${{ matrix.php }}"
coverage: none
ini-values: "session.save_path=/tmp"
extensions: xmlreader
env:
phpts: ${{ matrix.zts && 'ts' || 'nts' }}
- name: Compile
run: |
phpize
./configure --enable-php-debugger-dev
make -j$(nproc)
- name: Find PHP
run: |
TEST_PHP_EXECUTABLE=$(make findphp)
echo "Found PHP in: $TEST_PHP_EXECUTABLE"
echo "TEST_PHP_EXECUTABLE=$TEST_PHP_EXECUTABLE" >> $GITHUB_ENV
- name: Define PHP arguments
run: |
TEST_PHP_ARGS="-n -d session.save_path=/tmp"
if [[ "${{ matrix.opcache }}" == "true" ]]; then
TEST_PHP_ARGS="$TEST_PHP_ARGS -d zend_extension=opcache.so -d opcache.enable=1 -d opcache.enable_cli=1"
fi
TEST_PHP_ARGS="$TEST_PHP_ARGS -d zend_extension=$PWD/modules/php_debugger.so"
echo "Test PHP arguments: $TEST_PHP_ARGS"
echo "TEST_PHP_ARGS=$TEST_PHP_ARGS" >> $GITHUB_ENV
- name: Run tests
run: |
$TEST_PHP_EXECUTABLE $TEST_PHP_ARGS -v
$TEST_PHP_EXECUTABLE -n run-xdebug-tests.php -j$(nproc) -q -x --show-diff
- name: Show errors
if: failure()
run: |
for f in tests/**/*.diff; do
if [ -f "$f" ]; then
echo "=== $f ==="
cat "$f"
echo
fi
done