-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* add PHP 8.3 support (extension) * actions: update actions * chore: remove unused compose dependencies * fix: suppress clang ubsan * chore: fix: remove unused compose deps again * actions: skip UBSan in PHP 8.1 * chore 11.0.2-dev
- Loading branch information
Showing
10 changed files
with
208 additions
and
87 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,7 @@ | |
"build": { | ||
"args": { | ||
"IMAGE": "php", | ||
"TAG": "8.2-cli" | ||
"TAG": "8.3-cli" | ||
} | ||
}, | ||
"customizations": { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,73 +1,47 @@ | ||
name: CI | ||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
branches: | ||
- main | ||
schedule: | ||
- cron: '0 2 * * *' | ||
on: [push, pull_request] | ||
jobs: | ||
Library: | ||
runs-on: ubuntu-22.04 | ||
timeout-minutes: 60 | ||
strategy: | ||
matrix: | ||
version: ["7.4", "8.0", "8.1", "8.2", "8.3"] | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- name: Setup Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
- name: Build Container | ||
uses: docker/build-push-action@v6 | ||
with: | ||
build-args: | | ||
IMAGE=php | ||
TAG=${{ matrix.version }}-cli | ||
context: . | ||
file: ./build/library/Dockerfile | ||
load: true | ||
tags: "library-docker-${{ matrix.version }}" | ||
- name: Test Library | ||
run: docker run --rm -v"$(pwd):/workspace:cached" -i library-docker-${{ matrix.version }} | ||
Extension: | ||
CI: | ||
runs-on: ubuntu-22.04 | ||
timeout-minutes: 60 | ||
strategy: | ||
matrix: | ||
arch: ["amd64", "arm64v8", "s390x"] | ||
version: ["8.0", "8.1", "8.2"] | ||
version: ["8.1", "8.2", "8.3"] | ||
type: ["cli", "zts"] | ||
distro: ["bullseye", "alpine"] | ||
distro: ["bookworm", "alpine"] | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- name: Setup QEMU | ||
uses: docker/setup-qemu-action@v3 | ||
with: | ||
platforms: "arm64,s390x" | ||
- name: Setup Buildx | ||
- name: Setup buildx | ||
uses: docker/setup-buildx-action@v3 | ||
- name: Build Container | ||
uses: docker/build-push-action@v6 | ||
with: | ||
build-args: | | ||
IMAGE=${{ matrix.arch }}/php | ||
TAG=${{ matrix.version }}-${{ matrix.type }}-${{ matrix.distro }} | ||
PSKEL_SKIP_DEBUG=${{ matrix.arch != 'amd64' && '1' || '' }} | ||
context: . | ||
load: true | ||
tags: "pskel-${{ matrix.arch }}-${{ matrix.type }}-${{ matrix.distro }}" | ||
- name: Test Extension | ||
- name: Build container | ||
run: | | ||
docker run --env TEST_EXTENSION=1 --rm -i pskel-${{ matrix.arch }}-${{ matrix.type }}-${{ matrix.distro }} | ||
- name: Test Extension with Valgrind | ||
docker compose build --pull --no-cache --build-arg IMAGE=${{ matrix.arch }}/php --build-arg TAG=${{ matrix.version }}-${{ matrix.type }}-${{ matrix.distro }} --build-arg PSKEL_SKIP_DEBUG=${{ matrix.arch != 'amd64' && '1' || '' }} | ||
- name: Run tests | ||
run: | | ||
docker compose run --rm --entrypoint=/usr/bin/ci --env TEST_EXTENSION=1 dev | ||
- name: Test extension with PHP Debug Build | ||
if: matrix.arch == 'amd64' | ||
run: | | ||
docker compose run --rm --entrypoint=/usr/bin/ci --env TEST_EXTENSION_DEBUG=1 dev | ||
- name: Test extension with Valgrind | ||
if: matrix.arch == 'amd64' | ||
run: | | ||
docker run --env TEST_EXTENSION_VALGRIND=1 --rm -i pskel-${{ matrix.arch }}-${{ matrix.type }}-${{ matrix.distro }} | ||
- name: Test Extension with MSAN | ||
docker compose run --rm --entrypoint=/usr/bin/ci --env TEST_EXTENSION_VALGRIND=1 dev | ||
- name: Test extension with LLVM Sanitizer (MemorySanitizer) | ||
if: matrix.arch == 'amd64' && matrix.distro != 'alpine' | ||
run: | | ||
docker run --env TEST_EXTENSION_MSAN=1 --rm -i pskel-${{ matrix.arch }}-${{ matrix.type }}-${{ matrix.distro }} | ||
docker compose run --rm --entrypoint=/usr/bin/ci --env TEST_EXTENSION_MSAN=1 dev | ||
- name: Test extension with LLVM Sanitizer (AddressSanitizer) | ||
if: matrix.arch == 'amd64' && matrix.distro != 'alpine' | ||
run: | | ||
docker compose run --rm --entrypoint=/usr/bin/ci --env TEST_EXTENSION_ASAN=1 dev | ||
- name: Test extension with LLVM Sanitizer (UndefinedBehaviorSanitizer) | ||
if: matrix.arch == 'amd64' && matrix.distro != 'alpine' && matrix.version != '8.1' | ||
run: | | ||
docker compose run --rm --entrypoint=/usr/bin/ci --env TEST_EXTENSION_UBSAN=1 dev |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,103 @@ | ||
#!/bin/sh -ex | ||
#!/bin/sh -e | ||
|
||
case "${1}" in | ||
"") ;; | ||
"test") TEST_EXTENSION=1;; | ||
"debug") TEST_EXTENSION_DEBUG=1;; | ||
"valgrind") TEST_EXTENSION_VALGRIND=1;; | ||
"msan") TEST_EXTENSION_MSAN=1;; | ||
"asan") TEST_EXTENSION_ASAN=1;; | ||
"ubsan") TEST_EXTENSION_UBSAN=1;; | ||
*) printf "Pskel CI\nusage:\n\t\t%s\t\t: %s\n\t\t%s\t\t: %s\n\t\t%s\t: %s\n\t\t%s\t\t: %s\n\t\t%s\t\t: %s\n\t\t%s\t\t: %s\n" "test" "Test extension with pre-installed PHP binary. [bin: $(which "php")]" "debug" "Test extension with Debug Build (GCC) binary. [bin: $(which "debug-php")]" "valgrind" "Test extension with GCC binary with Valgrind. [bin: $(which "gcc-valgrind-php")]" "msan" "Test extension with Clang binary with MemorySanitizer. [bin: $(which "clang-msan-php")]" "asan" "Test extension with Clang binary with AddressSanitizer. [bin: $(which "clang-asan-php")]" "ubsan" "Test extension with Clang binary with UndefinedBehaviorSanitizer. [bin: $(which "clang-ubsan-php")]"; exit 0;; | ||
esac | ||
|
||
echo "[Pskel CI] BEGIN TEST" | ||
|
||
if test "${TEST_EXTENSION}" != ""; then | ||
cd "/ext" | ||
phpize | ||
./configure --with-php-config=$(which php-config) | ||
./configure --with-php-config="$(which php-config)" | ||
make clean | ||
make -j$(nproc) | ||
make -j"$(nproc)" | ||
TEST_PHP_ARGS="--show-diff -q" make test | ||
else | ||
echo "[Pskel CI] skip: TEST_EXTENSION is not set" | ||
fi | ||
|
||
if test "${TEST_EXTENSION_DEBUG}" != ""; then | ||
cd "/ext" | ||
debug-phpize | ||
./configure --with-php-config="$(which debug-php-config)" | ||
make clean | ||
make -j"$(nproc)" | ||
TEST_PHP_ARGS="--show-diff -q" make test | ||
else | ||
echo "[Pskel CI] skip: TEST_EXTENSION_DEBUG is not set" | ||
fi | ||
|
||
if test "${TEST_EXTENSION_VALGRIND}" != ""; then | ||
if type "gcc-debug-php" > /dev/null 2>&1; then | ||
if type "gcc-valgrind-php" > /dev/null 2>&1; then | ||
cd "/ext" | ||
gcc-debug-phpize | ||
./configure --with-php-config=$(which gcc-debug-php-config) | ||
gcc-valgrind-phpize | ||
./configure --with-php-config="$(which gcc-valgrind-php-config)" | ||
make clean | ||
make -j$(nproc) | ||
make -j"$(nproc)" | ||
TEST_PHP_ARGS="--show-diff -q -m" make test | ||
else | ||
echo "missing gcc-debug-php" | ||
echo "[Pskel CI] missing gcc-valgrind-php" | ||
exit 1 | ||
fi | ||
else | ||
echo "[Pskel CI] skip: TEST_EXTENSION_VALGRIND is not set" | ||
fi | ||
|
||
if test "${TEST_EXTENSION_MSAN}" != ""; then | ||
if type "clang-debug-php" > /dev/null 2>&1; then | ||
if type "clang-msan-php" > /dev/null 2>&1; then | ||
cd "/ext" | ||
clang-debug-phpize | ||
CC=clang CXX=clang++ CFLAGS="-fsanitize=memory -DZEND_TRACK_ARENA_ALLOC" LDFLAGS="-fsanitize=memory" ./configure --with-php-config=$(which clang-debug-php-config) | ||
clang-msan-phpize | ||
CC="clang" CXX="clang++" CFLAGS="-fsanitize=memory -DZEND_TRACK_ARENA_ALLOC" CPPFLAGS="-fsanitize=memory -DZEND_TRACK_ARENA_ALLOC ${CPPFLAGS}" LDFLAGS="-fsanitize=memory" ./configure --with-php-config="$(which clang-msan-php-config)" | ||
make clean | ||
make -j$(nproc) | ||
CFLAGS="-fsanitize=memory -DZEND_TRACK_ARENA_ALLOC ${CFLAGS}" CPPFLAGS="-fsanitize=memory -DZEND_TRACK_ARENA_ALLOC ${CPPFLAGS}" LDFLAGS="-fsanitize=memory" make -j"$(nproc)" | ||
TEST_PHP_ARGS="--show-diff -q --msan" make test | ||
else | ||
echo "missing clang-debug-php" | ||
echo "[Pskel CI] missing clang-msan-php" | ||
exit 1 | ||
fi | ||
else | ||
echo "[Pskel CI] skip: TEST_EXTENSION_MSAN is not set" | ||
fi | ||
|
||
if test "${TEST_EXTENSION_ASAN}" != ""; then | ||
if type "clang-asan-php" > /dev/null 2>&1; then | ||
cd "/ext" | ||
clang-asan-phpize | ||
CC="clang" CXX="clang++" CFLAGS="-fsanitize=address -DZEND_TRACK_ARENA_ALLOC" CPPFLAGS="-fsanitize=address -DZEND_TRACK_ARENA_ALLOC ${CPPFLAGS}" LDFLAGS="-fsanitize=address" ./configure --with-php-config="$(which clang-asan-php-config)" | ||
make clean | ||
CFLAGS="-fsanitize=address -DZEND_TRACK_ARENA_ALLOC ${CFLAGS}" CPPFLAGS="-fsanitize=address -DZEND_TRACK_ARENA_ALLOC ${CPPFLAGS}" LDFLAGS="-fsanitize=address" make -j"$(nproc)" | ||
TEST_PHP_ARGS="--show-diff -q --asan" make test | ||
else | ||
echo "[Pskel CI] missing clang-asan-php" | ||
exit 1 | ||
fi | ||
else | ||
echo "[Pskel CI] skip: TEST_EXTENSION_ASAN is not set" | ||
fi | ||
|
||
if test "${TEST_EXTENSION_UBSAN}" != ""; then | ||
if type "clang-ubsan-php" > /dev/null 2>&1; then | ||
cd "/ext" | ||
clang-ubsan-phpize | ||
CC="clang" CXX="clang++" CFLAGS="-fsanitize=undefined -DZEND_TRACK_ARENA_ALLOC" CPPFLAGS="-fsanitize=undefined -DZEND_TRACK_ARENA_ALLOC ${CPPFLAGS}" LDFLAGS="-fsanitize=undefined" ./configure --with-php-config="$(which clang-ubsan-php-config)" | ||
make clean | ||
CFLAGS="-fsanitize=undefined -DZEND_TRACK_ARENA_ALLOC ${CFLAGS}" CPPFLAGS="-fsanitize=undefined -DZEND_TRACK_ARENA_ALLOC ${CPPFLAGS}" LDFLAGS="-fsanitize=undefined" make -j"$(nproc)" | ||
TEST_PHP_ARGS="--show-diff -q" make test | ||
else | ||
echo "[Pskel CI] missing clang-ubsan-php" | ||
exit 1 | ||
fi | ||
else | ||
echo "[Pskel CI] skip: TEST_EXTENSION_UBSAN is not set" | ||
fi | ||
|
||
echo "[Pskel CI] END TEST" | ||
exit 0 |
Oops, something went wrong.