Skip to content

Setup database for tests #16

Setup database for tests

Setup database for tests #16

Workflow file for this run

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 --no-ansi
- name: Initialize database
shell: bash
run: |
docker compose -f compose.yaml -f compose.tests.yaml exec app bin/console messenger:setup-transports
docker compose -f compose.yaml -f compose.tests.yaml exec app bin/console doctrine:migration:migrate -n
docker compose -f compose.yaml -f compose.tests.yaml exec app bin/console doctrine:schema:validate -v
- name: PHP-CS-Fixer
shell: bash
run: |
docker compose -f compose.yaml -f compose.tests.yaml exec app tools/php-cs-fixer.phar fix --no-ansi --dry-run --diff
- name: PHPStan
shell: bash
run: |
docker compose -f compose.yaml -f compose.tests.yaml exec app vendor/bin/phpstan --no-ansi analyze --configuration phpstan.test.neon
- name: Rector
shell: bash
run: |
docker compose -f compose.yaml -f compose.tests.yaml exec app vendor/bin/rector --no-ansi --dry-run
- name: Tests
shell: bash
run: |
docker compose -f compose.yaml -f compose.tests.yaml exec app tools/phpunit.phar
- name: Stop stack
if: always()
shell: bash
run: |
docker compose -f compose.yaml -f compose.tests.yaml down