Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
02dc3a0
feature(app): Implement `RoadRunner` stack.
terabytesoftw Aug 30, 2025
35a88ff
chore: Remove Docker CI workflow file to streamline CI configuration.
terabytesoftw Aug 30, 2025
6e8b813
refactor: Update build configuration and remove unused environment fi…
terabytesoftw Aug 30, 2025
f0cda26
fix: Correct indentation in `build.yml` for codeception command execu…
terabytesoftw Aug 30, 2025
1515889
fix: Correct command syntax in `build.yml` for `rr serve` execution.
terabytesoftw Aug 30, 2025
fcd887b
fix: Correct command syntax in `build.yml` and add conditional loadin…
terabytesoftw Aug 30, 2025
abc1021
fix: Add `YII_C3` environment variable to server configuration in `.r…
terabytesoftw Aug 30, 2025
4612e54
fix: Remove `--coverage-xml` option from codecept run command in buil…
terabytesoftw Aug 30, 2025
f9ddfe9
fix: Remove coverage configuration from codeception.yml and update Ph…
terabytesoftw Aug 30, 2025
a6a45ba
fix: Update HTTP address configuration in `.rr.yaml` to allow binding…
terabytesoftw Aug 30, 2025
77ff4a5
fix: Refactor codeception command in build.yml to separate execution …
terabytesoftw Aug 31, 2025
61558da
fix: Replace `ArrayHelper::merge` with native `array_merge` in SiteCo…
terabytesoftw Aug 31, 2025
3439c4e
Apply fixes from StyleCI
StyleCIBot Aug 31, 2025
c8032de
fix: Add Codeception `C3` configuration to composer.json and include …
terabytesoftw Aug 31, 2025
d3a920d
fix: Update Codeception command in build.yml to include coverage gene…
terabytesoftw Aug 31, 2025
5a79179
fix: Enable coverage reporting in `codeception.yml` and include sourc…
terabytesoftw Aug 31, 2025
2db6c73
fix: Remove Codeception coverage configuration and related conditions…
terabytesoftw Aug 31, 2025
8e0af6b
fix: Remove coverage driver configuration from `build.yml`.
terabytesoftw Aug 31, 2025
e98721f
fix: Update `README.md` to include `RoadRunner` badge and remove unsu…
terabytesoftw Aug 31, 2025
a75352f
fix: Update `README.md` to change `RoadRunner` badge link and remove …
terabytesoftw Aug 31, 2025
de0fdbd
Merge branch 'road-runner' into fix-mini-43
terabytesoftw Aug 31, 2025
f408e17
Apply fixes from StyleCI
StyleCIBot Aug 31, 2025
a6fcad3
fix: Update badge links in `README.md` to reflect the 'road-runner' b…
terabytesoftw Aug 31, 2025
b3b9dfb
Merge branch 'fix-mini-43' of github-principal:yii2-extensions/app-ba…
terabytesoftw Aug 31, 2025
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
9 changes: 0 additions & 9 deletions .env

This file was deleted.

8 changes: 6 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ jobs:
AUTH_TOKEN: ${{ secrets.AUTH_TOKEN }}
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
with:
codeception-command: vendor/bin/codecept run --env php-builtin --coverage-xml
codeception-command: vendor/bin/codecept run
coverage-driver: none
coverage-file: runtime/output/coverage.xml
extensions: gd, intl, pcov
extensions: gd, intl, pcov, sockets
hook: |
vendor/bin/rr get-binary
./rr serve > /dev/null 2>&1 &
Comment on lines +31 to +33
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Wait for RoadRunner to be ready to avoid flaky tests.

Add a simple readiness check after starting the server.

       hook: |
         vendor/bin/rr get-binary
-        ./rr serve > /dev/null 2>&1 &
+        ./rr serve > /dev/null 2>&1 &
+        for i in {1..30}; do
+          curl -fsS http://127.0.0.1:8080/ >/dev/null && break
+          sleep 1
+        done
+        curl -fsS http://127.0.0.1:8080/ >/dev/null
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
hook: |
vendor/bin/rr get-binary
./rr serve > /dev/null 2>&1 &
hook: |
vendor/bin/rr get-binary
./rr serve > /dev/null 2>&1 &
for i in {1..30}; do
curl -fsS http://127.0.0.1:8080/ >/dev/null && break
sleep 1
done
curl -fsS http://127.0.0.1:8080/ >/dev/null
🤖 Prompt for AI Agents
In .github/workflows/build.yml around lines 31 to 33, the workflow starts
RoadRunner but does not wait for it to become ready which causes flaky tests;
after starting the server (./rr serve > /dev/null 2>&1 &) add a simple readiness
loop that polls the RoadRunner health or HTTP endpoint (e.g., curl -sSf
http://127.0.0.1:8080/health or the configured port) with a short sleep/retry
and a total timeout, exiting with failure if the server does not become ready in
time, so subsequent steps run only after RoadRunner is confirmed healthy.

42 changes: 42 additions & 0 deletions .rr.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
version: '3'
rpc:
listen: 'tcp://127.0.0.1:6001'
server:
command: 'php web/index.php'
relay: pipes
env:
YII_C3: true
YII_DEBUG: true
YII_ENV: dev
http:
address: :8080

headers:
response:
"Cache-Control": "no-cache"

middleware:
- static # serve files first
- gzip # compress dynamic output

static:
dir: web
forbid:
- .php
- .htaccess
pool:
num_workers: 1
supervisor:
max_worker_memory: 100
jobs:
pool:
num_workers: 2
max_worker_memory: 100
consume: { }
kv:
local:
driver: memory
config:
interval: 60
metrics:
address: '127.0.0.1:2112'
34 changes: 20 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
</p>

<p align="center">
<a href="https://github.com/roadrunner-server/roadrunner" target="_blank">
<img src="https://img.shields.io/badge/roadrunner-%23FF6B35.svg?style=for-the-badge&label=stack&logo=data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgMCAyNCAyNCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZD0iTTEyIDJMMjIgMTJMMTIgMjJMMiAxMkwxMiAyWiIgZmlsbD0iI0ZGNkIzNSIvPgo8cGF0aCBkPSJNMTIgNkwxOCAxMkwxMiAxOEw2IDEyTDEyIDZaIiBmaWxsPSIjRkZGRkZGIi8+CjxwYXRoIGQ9Ik0xMiA5TDE1IDEyTDEyIDE1TDkgMTJMMTIgOVoiIGZpbGw9IiNGRjZCMzUiLz4KPC9zdmc+&logoColor=white" alt="roadrunner-badge">
</a>
<a href="https://www.php.net/releases/8.1/en.php" target="_blank">
<img src="https://img.shields.io/badge/%3E%3D8.1-777BB4.svg?style=for-the-badge&logo=php&logoColor=white" alt="PHP version">
</a>
Expand All @@ -15,11 +18,11 @@
<a href="https://github.com/yiisoft/yii2/tree/22.0" target="_blank">
<img src="https://img.shields.io/badge/22.0.x-0073AA.svg?style=for-the-badge&logo=yii&logoColor=white" alt="Yii 22.0.x">
</a>
<a href="https://github.com/yii2-extensions/app-basic/actions/workflows/build.yml" target="_blank">
<img src="https://img.shields.io/github/actions/workflow/status/yii2-extensions/app-basic/build.yml?branch=main&style=for-the-badge&label=PHPUnit" alt="PHPUnit">
<a href="https://github.com/yii2-extensions/app-basic/actions/workflows/build.yml?query=branch%3Aroad-runner" target="_blank">
<img src="https://img.shields.io/github/actions/workflow/status/yii2-extensions/app-basic/build.yml?branch=road-runner&style=for-the-badge&label=PHPUnit" alt="PHPUnit">
</a>
<a href="https://github.com/yii2-extensions/app-basic/actions/workflows/static.yml" target="_blank">
<img src="https://img.shields.io/github/actions/workflow/status/yii2-extensions/app-basic/static.yml?branch=main&style=for-the-badge&label=PHPStan" alt="PHPStan">
<a href="https://github.com/yii2-extensions/app-basic/actions/workflows/static.yml?query=branch%3Aroad-runner" target="_blank">
<img src="https://img.shields.io/github/actions/workflow/status/yii2-extensions/app-basic/static.yml?branch=road-runner&style=for-the-badge&label=PHPStan" alt="PHPStan">
</a>
</p>

Expand Down Expand Up @@ -65,18 +68,22 @@ The Yii2 Web Application Basic template provides a complete foundation for build
**Quick start**

```bash
composer create-project --prefer-dist yii2-extensions/app-basic app-basic:^0.1
composer create-project --prefer-dist --stability=dev yii2-extensions/app-basic:dev-road-runner app-basic
cd app-basic
```

**Start development server**

Download and install [RoadRunner](https://docs.roadrunner.dev/docs/general/install) first.

```bash
# Using built-in PHP server
php -S localhost:8080 -t web
./vendor/bin/rr get-binary
```

# Or using Yii console command
./yii serve
Run the server in daemon mode.

```bash
./rr serve -d
```

### Basic usage
Expand Down Expand Up @@ -137,11 +144,10 @@ final class SiteController extends Controller
```
## Quality code

[![Latest Stable Version](https://img.shields.io/packagist/v/yii2-extensions/app-basic.svg?style=for-the-badge&logo=packagist&logoColor=white&label=Stable)](https://packagist.org/packages/yii2-extensions/app-basic)
[![Total Downloads](https://img.shields.io/packagist/dt/yii2-extensions/app-basic.svg?style=for-the-badge&logo=packagist&logoColor=white&label=Downloads)](https://packagist.org/packages/yii2-extensions/app-basic)
[![Codecov](https://img.shields.io/codecov/c/github/yii2-extensions/app-basic.svg?branch=main&style=for-the-badge&logo=codecov&logoColor=white&label=Coverage)](https://codecov.io/github/yii2-extensions/app-basic)
[![PHPStan Level Max](https://img.shields.io/badge/PHPStan-Level%20Max-4F5D95.svg?style=for-the-badge&logo=php&logoColor=white)](https://github.com/yii2-extensions/app-basic/actions/workflows/static.yml)
[![StyleCI](https://img.shields.io/badge/StyleCI-Passed-44CC11.svg?style=for-the-badge&logo=styleci&logoColor=white)](https://github.styleci.io/repos/165419144?branch=main)
[![Latest Stable Version](https://img.shields.io/packagist/v/yii2-extensions/app-basic.svg?branch=road-runner&style=for-the-badge&logo=packagist&logoColor=white&label=Stable)](https://packagist.org/packages/yii2-extensions/app-basic#dev-road-runner)
[![Codecov](https://img.shields.io/codecov/c/github/yii2-extensions/app-basic.svg?branch=road-runner&style=for-the-badge&logo=codecov&logoColor=white&label=Coverage)](https://app.codecov.io/github/yii2-extensions/app-basic/tree/road-runner)
[![PHPStan Level Max](https://img.shields.io/badge/PHPStan-Level%20Max-4F5D95.svg?style=for-the-badge&logo=php&logoColor=white)](https://github.com/yii2-extensions/app-basic/actions/workflows/static.yml?query=branch%3Aroad-runner)
[![StyleCI](https://img.shields.io/badge/StyleCI-Passed-44CC11.svg?branch=road-runner&style=for-the-badge&logo=styleci&logoColor=white)](https://github.styleci.io/repos/165419144?branch=road-runner)

## Documentation

Expand Down
5 changes: 0 additions & 5 deletions codeception.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ paths:
output: runtime/output
data: tests/Support/data
support: tests/Support
envs: tests/_envs
actor_suffix: Tester
settings:
memory_limit: 1024M
Expand All @@ -18,7 +17,3 @@ modules:
extensions:
enabled:
- Codeception\Extension\RunFailed
coverage:
enabled: true
include:
- src/*
17 changes: 9 additions & 8 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,23 @@
"yii2-extensions",
"application",
"basic",
"web"
"road-runner",
"web",
"worker"
],
"minimum-stability": "dev",
"license": "BSD-3-Clause",
"require": {
"php": ">=8.1",
"httpsoft/http-message": "^1.0",
"php-forge/foxy": "^0.1",
"ui-awesome/html-svg":"^0.2",
"vlucas/phpdotenv": "^5.6",
"yiisoft/yii2": "^2.0.53|^22",
"yiisoft/yii2-bootstrap5": "^2.0.50|^22",
"yiisoft/yii2-symfonymailer": "^4.0|^22"
"yiisoft/yii2-symfonymailer": "^4.0|^22",
"yii2-extensions/road-runner": "^0.1.0@dev"
},
"require-dev": {
"codeception/c3": "^2.8",
"codeception/codeception": "^5.0.0",
"codeception/lib-innerbrowser": "^4.0",
"codeception/module-asserts": "^3.0",
Expand All @@ -36,7 +38,7 @@
"symfony/process": "^6.3",
"symplify/easy-coding-standard": "^12.3",
"yii2-extensions/phpstan": "^0.3.0",
"yiisoft/yii2-debug": "^2.1.27|^22",
"yii2-extensions/worker-debug": "^0.1",
"yiisoft/yii2-gii": "^2.2.7|^22"
},
"autoload": {
Expand All @@ -63,11 +65,10 @@
},
"config": {
"allow-plugins": {
"codeception/c3": true,
"yiisoft/yii2-composer": true,
"composer/installers": true,
"php-forge/foxy": true,
"phpstan/extension-installer": true
"phpstan/extension-installer": true,
"yiisoft/yii2-composer": true
}
},
"scripts": {
Expand Down
Loading