Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,21 @@ jobs:
export TEST_PHP_EXECUTABLE="$(command -v php)"
RUN_TESTS="$(find /usr/lib/php -name run-tests.php | head -n1)"
echo "Using runner: ${RUN_TESTS}"
php "${RUN_TESTS}" -q --show-diff --show-slow 1000 --set-timeout 120 tests
if [ -z "${RUN_TESTS}" ]; then
echo "run-tests.php not found under /usr/lib/php" >&2
exit 1
fi
# run-tests.php writes run-test-info.php next to itself, but the system
# build dir is not writable by the runner user. Copy it to a writable
# temp dir so it can generate its helper files.
cp "${RUN_TESTS}" "${RUNNER_TEMP:-/tmp}/run-tests.php"
php "${RUNNER_TEMP:-/tmp}/run-tests.php" -q --show-diff --show-slow 1000 --set-timeout 120 tests
- name: Custom runner smoke check
env:
CUSTOM_PHPT_RUNNER: 1
# Make phpt_runner.php load the extension in the child PHP process,
# otherwise every test is reported as SKIPPED.
PHPT_ADD_EXTENSION: 1
run: |
for f in tests/*.phpt; do php -d extension=blake3 .github/phpt_runner.php "$f" || exit 1; done

8 changes: 5 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
workflow_dispatch:
inputs:
version:
description: 'Version as year.month.day-subversion (e.g. 2026.9.13-1)'
description: 'Version as year.month.day.subversion (e.g. 2026.9.13.1)'
required: true
type: string

Expand Down Expand Up @@ -44,8 +44,10 @@ jobs:
set -euo pipefail
# Accept the version with or without the leading "v"
VERSION="${VERSION_INPUT#v}"
if ! [[ "${VERSION}" =~ ^[0-9]{4}\.[0-9]{1,2}\.[0-9]{1,2}-[0-9]+$ ]]; then
echo "Invalid version '${VERSION}'. Expected year.month.day-subversion, e.g. 2026.9.13-1" >&2
# Must be a Composer-valid version: four dot-separated numeric parts,
# e.g. 2026.9.13.1 (a dash suffix like 2026.9.13-1 is NOT valid).
if ! [[ "${VERSION}" =~ ^[0-9]{4}\.[0-9]{1,2}\.[0-9]{1,2}\.[0-9]+$ ]]; then
echo "Invalid version '${VERSION}'. Expected year.month.day.subversion, e.g. 2026.9.13.1" >&2
exit 1
fi
echo "version=${VERSION}" >> "$GITHUB_OUTPUT"
Expand Down
2 changes: 1 addition & 1 deletion tests/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ RUN printf '%s\n' \
' exec php "${RUN_TESTS}" -q --show-diff --show-slow 1000 --set-timeout 120 tests' \
'else' \
' echo "run-tests.php not found, using custom runner"' \
' for f in tests/*.phpt; do PHPT_ADD_EXTENSION= php .github/phpt_runner.php "$f" || exit 1; done' \
' for f in tests/*.phpt; do PHPT_ADD_EXTENSION=1 php .github/phpt_runner.php "$f" || exit 1; done' \
'fi' \
> /usr/local/bin/run-phpt && chmod +x /usr/local/bin/run-phpt

Expand Down
Loading