-
Notifications
You must be signed in to change notification settings - Fork 0
111 lines (109 loc) · 3.75 KB
/
Copy pathtest-linux.yml
File metadata and controls
111 lines (109 loc) · 3.75 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
name: Linux Test
on:
push:
branches: ["dev"]
paths:
- "src/**"
- "build/**"
- "examples/**"
- "tools/**"
- "scripts/build-windows.sh"
- "scripts/test-windows.sh"
- "build.zig"
- "build.zig.zon"
- ".github/workflows/test-linux.yml"
pull_request:
branches: ["dev"]
paths:
- "src/**"
- "build/**"
- "examples/**"
- "tools/**"
- "scripts/build-windows.sh"
- "scripts/test-windows.sh"
- "build.zig"
- "build.zig.zon"
- ".github/workflows/test-linux.yml"
workflow_dispatch:
jobs:
test:
name: test (${{ matrix.php }}, ${{ matrix.arch }}, ${{ matrix.phpts }}, ${{ matrix.debug && 'debug' || 'release' }})
runs-on: ${{ matrix.os }}
env:
XWIN_VERSION: "0.10.0"
VS_VERSION: ${{ (matrix.php == '8.2' || matrix.php == '8.3') && 'vs16' || 'vs17' }}
strategy:
matrix:
php: ["8.2", "8.3", "8.4", "8.5"]
arch: [x86_64, aarch64]
phpts: [nts, ts]
# On Linux, the debug symbols are added as debug info files in the /usr/lib/debug/.build-id directory.
# Debug testing is not performed here.
# debug: [true, false]
debug: [false]
include:
- arch: x86_64
os: ubuntu-latest
- arch: aarch64
os: ubuntu-24.04-arm
steps:
- name: Checkout
uses: actions/checkout@v5
- uses: mlugg/setup-zig@v2
- name: Setup PHP (${{ matrix.phpts }}, ${{ matrix.debug && 'debug' || 'release' }})
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
tools: php-config
env:
phpts: ${{ matrix.phpts }}
debug: ${{ matrix.debug }}
- name: Verify PHP Installation
run: |
php -v
- name: Run unit tests
run: |
PHP_INCLUDE_DIR=$(php-config --include-dir)
zig build test -Dphp-include-dir="$PHP_INCLUDE_DIR"
- name: Run example tests
run: |
PHP_INCLUDE_DIR=$(php-config --include-dir)
zig build test-examples -Dphp-include-dir="$PHP_INCLUDE_DIR"
- name: Run example tests (ReleaseSafe)
if: ${{ matrix.debug == false }}
run: |
PHP_INCLUDE_DIR=$(php-config --include-dir)
zig build test-examples -Dphp-include-dir="$PHP_INCLUDE_DIR" -Doptimize=ReleaseSafe
- name: Run example tests (ReleaseFast)
if: ${{ matrix.debug == false }}
run: |
PHP_INCLUDE_DIR=$(php-config --include-dir)
zig build test-examples -Dphp-include-dir="$PHP_INCLUDE_DIR" -Doptimize=ReleaseFast
- name: Run example tests (ReleaseSmall)
if: ${{ matrix.debug == false }}
run: |
PHP_INCLUDE_DIR=$(php-config --include-dir)
zig build test-examples -Dphp-include-dir="$PHP_INCLUDE_DIR" -Doptimize=ReleaseSmall
- name: Run skeleton tests (phpize)
working-directory: examples/skeleton
env:
NO_INTERACTION: "1"
REPORT_EXIT_STATUS: "1"
run: |
phpize
./configure --enable-skeleton --with-php-config="$(command -v php-config)"
make
make test TESTS=tests
- name: Cache xwin downloads
uses: actions/cache@v4
with:
path: ~/.cache/xwin/${{ env.XWIN_VERSION }}/${{ env.VS_VERSION }}/x86_64
key: xwin-${{ env.XWIN_VERSION }}-${{ env.VS_VERSION }}-windows-x86_64
- name: Cross-compile for Windows
run: |
php_version=$(php -r 'echo PHP_VERSION;')
php_thread_safety=$(php -r 'echo PHP_ZTS ? "--zts" : "--nts";')
scripts/test-windows.sh \
--php-version "$php_version" \
"$php_thread_safety" \
--xwin-cache-dir "$HOME/.cache/xwin"