Skip to content

Commit b3a4d4c

Browse files
committed
Alpine CI
1 parent e011df0 commit b3a4d4c

File tree

5 files changed

+248
-0
lines changed

5 files changed

+248
-0
lines changed

.github/actions/apk/action.yml

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
name: apk
2+
runs:
3+
using: composite
4+
steps:
5+
- shell: sh
6+
run: |
7+
set -x
8+
9+
apk update -q
10+
apk add \
11+
util-linux \
12+
bash \
13+
sudo \
14+
build-base \
15+
autoconf \
16+
unzip \
17+
bison \
18+
re2c \
19+
pkgconf \
20+
mysql-client \
21+
aspell-dev \
22+
hunspell-dev \
23+
hunspell-en \
24+
bzip2-dev \
25+
curl-dev \
26+
freetype-dev \
27+
gettext-dev \
28+
gnu-libiconv-dev \
29+
gmp-dev \
30+
icu-dev \
31+
jpeg-dev \
32+
libffi-dev \
33+
libpng-dev \
34+
libsodium-dev \
35+
libwebp-dev \
36+
libxml2-dev \
37+
libxpm-dev \
38+
libxslt-dev \
39+
libzip-dev \
40+
oniguruma-dev \
41+
openssl-dev \
42+
readline-dev \
43+
sqlite-dev \
44+
tidyhtml-dev \
45+
krb5-dev \
46+
gdbm-dev \
47+
lmdb-dev \
48+
argon2-dev \
49+
enchant2-dev \
50+
freetds-dev \
51+
imap-dev \
52+
net-snmp-dev \
53+
openldap-dev \
54+
unixodbc-dev \
55+
postgresql14-dev \
56+
tzdata \
57+
musl-locales \
58+
musl-locales-lang
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
name: ./configure
2+
inputs:
3+
configurationParameters:
4+
default: ''
5+
required: false
6+
runs:
7+
using: composite
8+
steps:
9+
- shell: bash
10+
run: |
11+
set -x
12+
./buildconf --force
13+
./configure \
14+
--enable-option-checking=fatal \
15+
--prefix=/usr \
16+
--enable-phpdbg \
17+
--enable-fpm \
18+
--with-pdo-mysql=mysqlnd \
19+
--with-mysqli=mysqlnd \
20+
${{ inputs.skipSlow == 'false' && '--with-pgsql' || '' }} \
21+
${{ inputs.skipSlow == 'false' && '--with-pdo-pgsql' || '' }} \
22+
${{ inputs.skipSlow == 'false' && '--with-pdo-sqlite' || '' }} \
23+
--enable-intl \
24+
--without-pear \
25+
--enable-gd \
26+
--with-jpeg \
27+
--with-webp \
28+
--with-freetype \
29+
--with-xpm \
30+
--enable-exif \
31+
--with-zip \
32+
--with-zlib \
33+
--enable-soap \
34+
--enable-xmlreader \
35+
--with-xsl \
36+
${{ inputs.skipSlow == 'false' && '--with-tidy' || '' }} \
37+
--enable-sysvsem \
38+
--enable-sysvshm \
39+
--enable-shmop \
40+
--enable-pcntl \
41+
--with-readline \
42+
--enable-mbstring \
43+
--with-iconv=/usr \
44+
--with-curl \
45+
--with-gettext \
46+
--enable-sockets \
47+
--with-bz2 \
48+
--with-openssl \
49+
--with-gmp \
50+
--enable-bcmath \
51+
--enable-calendar \
52+
--enable-ftp \
53+
${{ inputs.skipSlow == 'false' && '--with-enchant=/usr' || '' }} \
54+
--enable-sysvmsg \
55+
--with-ffi \
56+
--enable-zend-test \
57+
${{ inputs.skipSlow == 'false' && '--enable-dl-test=shared' || '' }} \
58+
${{ inputs.skipSlow == 'false' && '--with-ldap' || '' }} \
59+
${{ inputs.skipSlow == 'false' && '--with-ldap-sasl' || '' }} \
60+
--with-password-argon2 \
61+
--with-mhash \
62+
--with-sodium \
63+
--enable-dba \
64+
--with-cdb \
65+
--enable-flatfile \
66+
--enable-inifile \
67+
--with-lmdb \
68+
--with-gdbm \
69+
${{ inputs.skipSlow == 'false' && '--with-snmp' || '' }} \
70+
${{ inputs.skipSlow == 'false' && '--with-unixODBC' || '' }} \
71+
${{ inputs.skipSlow == 'false' && '--with-pdo-odbc=unixODBC,/usr' || '' }} \
72+
--with-config-file-path=/etc \
73+
--with-config-file-scan-dir=/etc/php.d \
74+
${{ inputs.skipSlow == 'false' && '--with-pdo-dblib' || '' }} \
75+
--enable-werror \
76+
${{ inputs.configurationParameters }}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
name: Install
2+
runs:
3+
using: composite
4+
steps:
5+
- shell: bash
6+
run: |
7+
set -x
8+
sudo make install
9+
sudo mkdir -p /etc/php.d
10+
sudo chmod 777 /etc/php.d
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Test
2+
inputs:
3+
testArtifacts:
4+
default: null
5+
required: false
6+
runTestsParameters:
7+
default: ''
8+
required: false
9+
jitType:
10+
default: 'disable'
11+
required: false
12+
runs:
13+
using: composite
14+
steps:
15+
- shell: bash
16+
run: |
17+
set -x
18+
export TEST_PHP_JUNIT=junit.out.xml
19+
export STACK_LIMIT_DEFAULTS_CHECK=1
20+
sapi/cli/php run-tests.php -P -q ${{ inputs.runTestsParameters }} \
21+
-d opcache.jit=${{ inputs.jitType }} \
22+
-d opcache.protect_memory=1 \
23+
-d opcache.jit_buffer_size=64M \
24+
-j$(($(nproc) - 1)) \
25+
-g FAIL,BORK,LEAK,XLEAK \
26+
--no-progress \
27+
--offline \
28+
--show-diff \
29+
--show-slow 1000 \
30+
--set-timeout 120
31+
- uses: actions/upload-artifact@v4
32+
if: always() && inputs.testArtifacts != null
33+
with:
34+
name: ${{ github.job }}_${{ inputs.testArtifacts }}
35+
path: ${{ github.workspace }}/junit.out.xml
36+
retention-days: 5

.github/workflows/push.yml

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,74 @@ jobs:
148148
- name: Verify generated files are up to date
149149
if: ${{ !matrix.asan }}
150150
uses: ./.github/actions/verify-generated-files
151+
ALPINE:
152+
if: github.repository_owner == 'php' || github.event_name == 'pull_request'
153+
strategy:
154+
fail-fast: false
155+
matrix:
156+
include:
157+
- debug: false
158+
zts: false
159+
asan: false
160+
- debug: true
161+
zts: true
162+
asan: true
163+
name: "ALPINE_${{ matrix.debug && 'DEBUG' || 'RELEASE' }}_${{ matrix.zts && 'ZTS' || 'NTS' }}${{ matrix.asan && '_ASAN' || '' }}"
164+
runs-on: ubuntu-22.04
165+
container:
166+
image: 'alpine:3.19.1'
167+
steps:
168+
- name: git checkout
169+
uses: actions/checkout@v4
170+
- name: apk
171+
uses: ./.github/actions/apk
172+
- name: LLVM 16 (ASAN-only)
173+
if: ${{ matrix.asan }}
174+
run: |
175+
apk add llvm16
176+
- name: System info
177+
run: |
178+
echo "::group::Show host CPU info"
179+
lscpu
180+
echo "::endgroup::"
181+
echo "::group::Show installed package versions"
182+
apk list
183+
echo "::endgroup::"
184+
- name: ccache
185+
uses: hendrikmuhs/[email protected]
186+
with:
187+
# This duplicates the "job.name" expression above because
188+
# GitHub has no way to query the job name (github.job is the
189+
# job id, not the job name)
190+
key: "ALPINE_${{ matrix.debug && 'DEBUG' || 'RELEASE' }}_${{ matrix.zts && 'ZTS' || 'NTS' }}${{ matrix.asan && '_ASAN' || '' }}-${{hashFiles('main/php_version.h')}}"
191+
append-timestamp: false
192+
- name: ./configure
193+
uses: ./.github/actions/configure-alpine
194+
with:
195+
# -Wno-error=address: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114609
196+
configurationParameters: >-
197+
--${{ matrix.debug && 'enable' || 'disable' }}-debug
198+
--${{ matrix.zts && 'enable' || 'disable' }}-zts
199+
${{ matrix.asan && 'CFLAGS="-fsanitize=undefined,address -DZEND_TRACK_ARENA_ALLOC" LDFLAGS="-fsanitize=undefined,address" CC=clang-16 CXX=clang++-16' || 'CFLAGS="-Wno-error=address"' }}
200+
skipSlow: ${{ matrix.asan }}
201+
- name: make
202+
run: make -j$(/usr/bin/nproc) >/dev/null
203+
- name: make install
204+
uses: ./.github/actions/install-alpine
205+
- name: Test
206+
if: matrix.asan == false
207+
uses: ./.github/actions/test-alpine
208+
with:
209+
testArtifacts: ${{ matrix.debug && 'DEBUG' || 'RELEASE' }}_${{ matrix.zts && 'ZTS' || 'NTS' }}
210+
- name: Test Tracing JIT
211+
uses: ./.github/actions/test-alpine
212+
with:
213+
testArtifacts: ${{ matrix.debug && 'DEBUG' || 'RELEASE' }}_${{ matrix.zts && 'ZTS' || 'NTS' }}${{ matrix.asan && '_ASAN' || '' }}_Tracing JIT
214+
jitType: tracing
215+
runTestsParameters: >-
216+
-d zend_extension=opcache.so
217+
-d opcache.enable_cli=1
218+
${{ matrix.asan && '--asan -x' || '' }}
151219
MACOS_DEBUG_NTS:
152220
if: github.repository_owner == 'php' || github.event_name == 'pull_request'
153221
strategy:

0 commit comments

Comments
 (0)