From ffbe6b97c29da48a3e8185ba120ce7108467459d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Peter=20J=C3=B8rgensen?= Date: Mon, 23 Nov 2026 21:19:05 +0100 Subject: [PATCH] ci: smoke-test the committed PHAR on every run Packagist installs builds/quickpay, but CI only tested the source. The test job now checks, on each PHP version, that the committed PHAR is the newest release in the CHANGELOG, starts outside the project with an empty home folder, lists its commands, runs `about`, and fails cleanly rather than crashing when no merchant is set up. Co-Authored-By: Claude Opus 5.5 --- .github/workflows/quality.yml | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/.github/workflows/quality.yml b/.github/workflows/quality.yml index b29bd7d..e3fca34 100644 --- a/.github/workflows/quality.yml +++ b/.github/workflows/quality.yml @@ -55,6 +55,27 @@ jobs: tools: composer:2.10.2 - run: composer install --no-interaction --no-progress --prefer-dist - run: composer test + # Packagist installs the committed PHAR, so check that it is the newest + # release and still starts on this PHP version, outside the project. + - name: Smoke-test the committed PHAR + run: | + phar="$GITHUB_WORKSPACE/builds/quickpay" + released="$(grep -m1 -oE '^## \[[0-9]+\.[0-9]+\.[0-9]+\]' CHANGELOG.md | tr -d '#[] ')" + test "$(php "$phar" --version)" = "Quickpay $released" + export HOME="$RUNNER_TEMP/home" + mkdir -p "$HOME" + cd "$RUNNER_TEMP" + php "$phar" list --raw > commands.txt + grep -q '^about ' commands.txt + php "$phar" about > /dev/null + if output="$(php "$phar" payments:list --no-interaction 2>&1)"; then + echo "payments:list should fail without a merchant." + exit 1 + fi + if grep -qiE 'fatal|uncaught|stack trace' <<< "$output"; then + echo "$output" + exit 1 + fi coverage: runs-on: ubuntu-latest