diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index aedda26..02dc71a 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -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 }} diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..c5bdeff --- /dev/null +++ b/LICENSE @@ -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. diff --git a/README.md b/README.md index 97baf9e..9c637b9 100644 --- a/README.md +++ b/README.md @@ -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 @@ -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