Skip to content

Commit 9da4e87

Browse files
rudi-augmentclaude
andcommitted
ci: run PHPT tests in Docker with debian/alpine matrix
Add Dockerfile.debian and Dockerfile.alpine for running PHPT tests across PHP 8.2-8.5, both platforms, ts/nts, and opcache on/off. PHPUnit and Windows jobs remain unchanged. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent b903142 commit 9da4e87

3 files changed

Lines changed: 70 additions & 25 deletions

File tree

.github/workflows/main.yml

Lines changed: 22 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -9,38 +9,35 @@ on:
99

1010
jobs:
1111
phpt:
12-
name: PHPT - PHP ${{ matrix.php }} ${{ matrix.phpts }} OPcache=${{ matrix.opcache }}
12+
name: PHPT - PHP ${{ matrix.php }} ${{ matrix.ts }} ${{ matrix.platform }} opcache=${{ matrix.opcache }}
1313
runs-on: ubuntu-latest
1414
strategy:
1515
fail-fast: false
1616
matrix:
17-
php:
18-
- "8.2"
19-
- "8.3"
20-
- "8.4"
21-
- "8.5"
22-
phpts: ["ts", "nts"]
23-
opcache: [1, 0]
24-
17+
php: ['8.2', '8.3', '8.4', '8.5']
18+
platform: [debian, alpine]
19+
ts: [nts, ts]
20+
opcache: [0, 1]
21+
include:
22+
- { platform: debian, dockerfile: Dockerfile.debian }
23+
- { platform: alpine, dockerfile: Dockerfile.alpine }
24+
- { ts: nts, variant: cli }
25+
- { ts: ts, variant: zts }
26+
- { php: '8.5', tag: '8.5-rc' }
2527
steps:
2628
- uses: actions/checkout@v4
2729

28-
- name: Setup PHP
29-
uses: shivammathur/setup-php@v2
30-
with:
31-
php-version: ${{ matrix.php }}
32-
ini-values: opcache.enable_cli=${{ matrix.opcache }}
33-
env:
34-
phpts: ${{ matrix.phpts }}
35-
36-
- name: Build extension
37-
run: |
38-
phpize
39-
./configure --with-php-config=/usr/bin/php-config
40-
make -j$(nproc)
41-
42-
- name: Run PHPT tests
43-
run: make test TESTS=tests/ NO_INTERACTION=1
30+
- name: Build
31+
run: >
32+
docker build
33+
-f ${{ matrix.dockerfile }}
34+
--build-arg PHP_VERSION=${{ matrix.tag || matrix.php }}
35+
--build-arg PHP_VARIANT=${{ matrix.variant }}
36+
--build-arg OPCACHE=${{ matrix.opcache }}
37+
-t ext-ds .
38+
39+
- name: Test
40+
run: docker run --rm ext-ds
4441

4542
phpunit:
4643
name: PHPUnit - PHP ${{ matrix.php }}

Dockerfile.alpine

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
ARG PHP_VERSION=8.4
2+
ARG PHP_VARIANT=cli
3+
FROM php:${PHP_VERSION}-${PHP_VARIANT}-alpine
4+
5+
RUN apk add --no-cache \
6+
gcc \
7+
make \
8+
autoconf \
9+
libc-dev
10+
11+
WORKDIR /ext-ds
12+
13+
COPY . .
14+
15+
RUN phpize --clean > /dev/null 2>&1 || true \
16+
&& phpize \
17+
&& ./configure \
18+
&& make -j$(nproc) \
19+
&& make install
20+
21+
ARG OPCACHE=0
22+
ENV PHP_OPCACHE=${OPCACHE}
23+
24+
CMD php -d opcache.enable_cli=${PHP_OPCACHE} run-tests.php \
25+
-d extension=ds.so \
26+
-n -q --show-diff \
27+
tests/

Dockerfile.debian

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
ARG PHP_VERSION=8.4
2+
ARG PHP_VARIANT=cli
3+
FROM php:${PHP_VERSION}-${PHP_VARIANT}
4+
5+
WORKDIR /ext-ds
6+
7+
COPY . .
8+
9+
RUN phpize --clean > /dev/null 2>&1 || true \
10+
&& phpize \
11+
&& ./configure \
12+
&& make -j$(nproc) \
13+
&& make install
14+
15+
ARG OPCACHE=0
16+
ENV PHP_OPCACHE=${OPCACHE}
17+
18+
CMD php -d opcache.enable_cli=${PHP_OPCACHE} run-tests.php \
19+
-d extension=ds.so \
20+
-n -q --show-diff \
21+
tests/

0 commit comments

Comments
 (0)