Use Test environment for tests #13
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Tests | |
on: | |
push: | |
branches: [ "main" ] | |
pull_request: | |
branches: [ "main" ] | |
permissions: | |
contents: read | |
jobs: | |
tests: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Start stack | |
shell: bash | |
run: | | |
docker compose -f compose.yaml -f compose.tests.yaml pull --include-deps | |
docker compose -f compose.yaml -f compose.tests.yaml build | |
docker compose -f compose.yaml -f compose.tests.yaml up -d | |
- name: Install vendors | |
shell: bash | |
run: | | |
docker compose -f compose.yaml -f compose.tests.yaml exec app composer install --no-ansi --no-interaction --no-progress --prefer-dist | |
- name: Install tools | |
shell: bash | |
run: | | |
docker compose -f compose.yaml -f compose.tests.yaml exec app composer phive:install --no-interaction --no-progress --ansi | |
- name: PHP-CS-Fixer | |
shell: bash | |
run: | | |
docker compose -f compose.yaml -f compose.tests.yaml exec app composer cs:check | |
- name: PHPStan | |
shell: bash | |
run: | | |
docker compose -f compose.yaml -f compose.tests.yaml exec app composer phpstan:check | |
- name: Rector | |
shell: bash | |
run: | | |
docker compose -f compose.yaml -f compose.tests.yaml exec app composer rector:check | |
- name: Tests | |
shell: bash | |
run: | | |
docker compose -f compose.yaml -f compose.tests.yaml exec app composer phpunit:check | |
- name: Stop stack | |
if: always() | |
shell: bash | |
run: | | |
docker compose -f compose.yaml -f compose.tests.yaml down |