1010permissions :
1111 contents : read
1212
13+ env :
14+ FRANKENPHP_VERSION : v1.11.2
15+ ROADRUNNER_VERSION : v2025.1.7
16+
1317# Cancel in progress workflows on pull_requests.
1418# https://docs.github.com/en/actions/using-jobs/using-concurrency#example-using-a-fallback-value
1519concurrency :
7175 - name : Remove unused dependencies
7276 run : composer remove vimeo/psalm phpstan/phpstan friendsofphp/php-cs-fixer --dev --no-interaction --no-update
7377
78+ - name : Remove RoadRunner dependencies on unsupported PHP versions
79+ if : ${{ matrix.os == 'windows-latest' || matrix.php.version == '7.2' || matrix.php.version == '7.3' || matrix.php.version == '7.4' || matrix.php.version == '8.0' }}
80+ run : composer remove spiral/roadrunner-http spiral/roadrunner-worker --dev --no-interaction --no-update
81+
7482 - name : Set phpunit/phpunit version constraint
7583 run : composer require phpunit/phpunit:'${{ matrix.php.phpunit }}' --dev --no-interaction --no-update
7684
@@ -96,3 +104,138 @@ jobs:
96104 - name : Check benchmarks
97105 run : vendor/bin/phpbench run --revs=1 --iterations=1
98106 if : ${{ matrix.dependencies == 'highest' && matrix.php.version == '8.4' }}
107+
108+ runtime-tests-frankenphp :
109+ name : Runtime tests (FrankenPHP)
110+ runs-on : ubuntu-latest
111+
112+ steps :
113+ - name : Checkout
114+ uses : actions/checkout@v6
115+ with :
116+ fetch-depth : 2
117+
118+ - name : Setup PHP
119+ uses : shivammathur/setup-php@v2
120+ with :
121+ php-version : ' 8.4'
122+ coverage : none
123+
124+ - name : Determine Composer cache directory
125+ id : composer-cache
126+ run : echo "directory=$(composer config cache-dir)" >> "$GITHUB_OUTPUT"
127+ shell : bash
128+
129+ - name : Cache Composer dependencies
130+ uses : actions/cache@v5
131+ with :
132+ path : ${{ steps.composer-cache.outputs.directory }}
133+ key : ${{ runner.os }}-runtime-frankenphp-composer-${{ hashFiles('**/composer.lock') }}
134+ restore-keys : ${{ runner.os }}-runtime-frankenphp-composer-
135+
136+ - name : Install dependencies
137+ run : composer install --no-progress --no-interaction --prefer-dist
138+
139+ - name : Install FrankenPHP
140+ env :
141+ GH_TOKEN : ${{ github.token }}
142+ run : |
143+ set -euo pipefail
144+
145+ case "$(uname -m)" in
146+ x86_64) asset="frankenphp-linux-x86_64" ;;
147+ aarch64|arm64) asset="frankenphp-linux-aarch64" ;;
148+ *) echo "Unsupported architecture: $(uname -m)"; exit 1 ;;
149+ esac
150+
151+ digest="$(gh api "repos/php/frankenphp/releases/tags/${FRANKENPHP_VERSION}" --jq ".assets[] | select(.name == \"${asset}\") | .digest")"
152+
153+ if [ -z "${digest}" ]; then
154+ echo "Unable to resolve digest for ${asset} (${FRANKENPHP_VERSION})."
155+ exit 1
156+ fi
157+
158+ gh release download "${FRANKENPHP_VERSION}" \
159+ --repo php/frankenphp \
160+ --pattern "${asset}" \
161+ --output "${asset}"
162+
163+ echo "${digest#sha256:} ${asset}" | sha256sum --check --
164+ mkdir -p "${RUNNER_TEMP}/bin"
165+ install -m 0755 "${asset}" "${RUNNER_TEMP}/bin/frankenphp"
166+ echo "${RUNNER_TEMP}/bin" >> "${GITHUB_PATH}"
167+ "${RUNNER_TEMP}/bin/frankenphp" version
168+ shell : bash
169+
170+ - name : Run PHPUnit tests (excluding PHPT)
171+ run : vendor/bin/phpunit tests --test-suffix Test.php --verbose
172+
173+ runtime-tests-roadrunner :
174+ name : Runtime tests (RoadRunner)
175+ runs-on : ubuntu-latest
176+
177+ steps :
178+ - name : Checkout
179+ uses : actions/checkout@v6
180+ with :
181+ fetch-depth : 2
182+
183+ - name : Setup PHP
184+ uses : shivammathur/setup-php@v2
185+ with :
186+ php-version : ' 8.4'
187+ coverage : none
188+
189+ - name : Determine Composer cache directory
190+ id : composer-cache
191+ run : echo "directory=$(composer config cache-dir)" >> "$GITHUB_OUTPUT"
192+ shell : bash
193+
194+ - name : Cache Composer dependencies
195+ uses : actions/cache@v5
196+ with :
197+ path : ${{ steps.composer-cache.outputs.directory }}
198+ key : ${{ runner.os }}-runtime-roadrunner-composer-${{ hashFiles('**/composer.lock') }}
199+ restore-keys : ${{ runner.os }}-runtime-roadrunner-composer-
200+
201+ - name : Install dependencies
202+ run : composer install --no-progress --no-interaction --prefer-dist
203+
204+ - name : Install RoadRunner
205+ env :
206+ GH_TOKEN : ${{ github.token }}
207+ run : |
208+ set -euo pipefail
209+
210+ case "$(uname -m)" in
211+ x86_64) arch="amd64" ;;
212+ aarch64|arm64) arch="arm64" ;;
213+ *) echo "Unsupported architecture: $(uname -m)"; exit 1 ;;
214+ esac
215+
216+ version_no_prefix="${ROADRUNNER_VERSION#v}"
217+ asset="roadrunner-${version_no_prefix}-linux-${arch}.tar.gz"
218+
219+ digest="$(gh api "repos/roadrunner-server/roadrunner/releases/tags/${ROADRUNNER_VERSION}" --jq ".assets[] | select(.name == \"${asset}\") | .digest")"
220+
221+ if [ -z "${digest}" ]; then
222+ echo "Unable to resolve digest for ${asset} (${ROADRUNNER_VERSION})."
223+ exit 1
224+ fi
225+
226+ gh release download "${ROADRUNNER_VERSION}" \
227+ --repo roadrunner-server/roadrunner \
228+ --pattern "${asset}" \
229+ --output "${asset}"
230+
231+ echo "${digest#sha256:} ${asset}" | sha256sum --check --
232+ tar -xzf "${asset}" --strip-components=1 "${asset%.tar.gz}/rr"
233+ mkdir -p "${RUNNER_TEMP}/bin"
234+ install -m 0755 rr "${RUNNER_TEMP}/bin/rr"
235+ echo "${RUNNER_TEMP}/bin" >> "${GITHUB_PATH}"
236+ "${RUNNER_TEMP}/bin/rr" --version
237+ shell : bash
238+
239+ - name : Run PHPUnit tests (excluding PHPT)
240+ run : vendor/bin/phpunit tests --test-suffix Test.php --verbose
241+
0 commit comments