diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2f50938..4696541 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 57ad10f..7b16d88 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -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 @@ -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" diff --git a/tests/Dockerfile b/tests/Dockerfile index f51ddb5..2f7eef5 100644 --- a/tests/Dockerfile +++ b/tests/Dockerfile @@ -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