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
3 changes: 1 addition & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,7 @@ jobs:
body: |
## Changes in this Release

Merged from `${{ github.event.pull_request.head.ref }}` to `${{ github.event.pull_request.base.ref }}`
via PR #${{ github.event.pull_request.number }}
Merged from `${{ github.event.pull_request.head.ref }}` to `${{ github.event.pull_request.base.ref }}` via PR #${{ github.event.pull_request.number }}

**Pull Request:** ${{ github.event.pull_request.title }}

Expand Down
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2025 Dmitry Strelets (sni10)

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
36 changes: 4 additions & 32 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -265,22 +265,22 @@ docker compose --env-file .env.test exec php vendor/bin/phpunit --coverage-html=

Запустить один файл тестов:
```bash
docker compose exec php vendor/bin/phpunit tests/Feature/TaskTest.php
docker compose --env-file .env.test exec php vendor/bin/phpunit tests/Feature/TaskTest.php
```

Запустить конкретный тестовый метод:
```bash
docker compose exec php vendor/bin/phpunit --filter=testStoreTask
docker compose --env-file .env.test exec php vendor/bin/phpunit --filter=testStoreTask
```

Запустить только Unit-тесты:
```bash
docker compose exec php vendor/bin/phpunit tests/Unit/
docker compose --env-file .env.test exec php vendor/bin/phpunit tests/Unit/
```

Запустить только Feature-тесты:
```bash
docker compose exec php vendor/bin/phpunit tests/Feature/
docker compose --env-file .env.test exec php vendor/bin/phpunit tests/Feature/
```

### CI/CD testing
Expand All @@ -294,34 +294,6 @@ docker compose exec php vendor/bin/phpunit tests/Feature/

Полную конфигурацию CI/CD смотрите в `.github/workflows/tests.yml`.

#### APP_KEY in CI (GitHub Actions)
- В CI не вызывайте `php artisan key:generate` — это требует записи в `.env` и логи, что часто приводит к `Permission denied` внутри контейнера.
- Вместо этого прокиньте ключ приложения через секреты GitHub: создайте секрет `APP_KEY` со значением из `php artisan key:generate --show` (формат `base64:...`).
- Файлы `docker-compose.yml` и `docker/config-envs/test/docker-compose.override.yml` уже ожидают переменную окружения `APP_KEY` и передают её в сервис `php`.

Пример шагов в workflow:

```yaml
- name: Build & up containers
env:
APP_KEY: ${{ secrets.APP_KEY }}
run: |
docker compose -f docker-compose.yml -f docker/config-envs/test/docker-compose.override.yml build
docker compose -f docker-compose.yml -f docker/config-envs/test/docker-compose.override.yml up -d

- name: Migrate test schema
env:
APP_KEY: ${{ secrets.APP_KEY }}
run: |
docker compose exec -T php php artisan migrate:fresh --env=test

- name: Run tests
env:
APP_KEY: ${{ secrets.APP_KEY }}
run: |
docker compose exec -T php vendor/bin/phpunit --coverage-text --colors=always --testdox
```

---
#### Sample test output

Expand Down