Skip to content
Merged
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
24 changes: 24 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,24 @@ jobs:
build:
runs-on: ubuntu-latest

services:
postgres:
image: postgres:16-alpine
env:
POSTGRES_DB: chess_api_test
POSTGRES_USER: app
POSTGRES_PASSWORD: ${{ secrets.DB_PASSWORD }}
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432

env:
DATABASE_URL: postgresql://app:${{ secrets.DB_PASSWORD }}@127.0.0.1:5432/chess_api?serverVersion=16&charset=utf8

steps:
- uses: actions/checkout@v4

Expand All @@ -28,5 +46,11 @@ jobs:
- name: Run PHPStan
run: vendor/bin/phpstan analyse

- name: Create test database
run: php bin/console doctrine:database:create --env=test --no-interaction --if-not-exists

- name: Run database migrations
run: php bin/console doctrine:migrations:migrate --no-interaction --env=test

- name: Run PHPUnit
run: vendor/bin/phpunit
Loading