64 lines
1.6 KiB
YAML
64 lines
1.6 KiB
YAML
name: CI
|
|
|
|
on:
|
|
push:
|
|
branches: ['*']
|
|
pull_request:
|
|
branches: ['main']
|
|
|
|
jobs:
|
|
test:
|
|
runs-on: ubuntu-latest
|
|
container:
|
|
image: php:8.4-cli-alpine
|
|
|
|
services:
|
|
postgres:
|
|
image: postgres:17-alpine
|
|
env:
|
|
POSTGRES_DB: superseller_test
|
|
POSTGRES_USER: superseller
|
|
POSTGRES_PASSWORD: test
|
|
options: >-
|
|
--health-cmd pg_isready
|
|
--health-interval 5s
|
|
--health-timeout 5s
|
|
--health-retries 5
|
|
|
|
redis:
|
|
image: redis:7-alpine
|
|
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Install system deps
|
|
run: |
|
|
apk add --no-cache postgresql-dev icu-dev libzip-dev unzip git
|
|
docker-php-ext-install pdo_pgsql intl zip
|
|
|
|
- name: Install Composer
|
|
run: |
|
|
curl -sS https://getcomposer.org/installer | php
|
|
mv composer.phar /usr/local/bin/composer
|
|
|
|
- name: Install dependencies
|
|
run: composer install --no-interaction --prefer-dist
|
|
|
|
- name: PHP CS Fixer
|
|
run: ./vendor/bin/php-cs-fixer fix --dry-run --diff
|
|
|
|
- name: PHPStan
|
|
run: ./vendor/bin/phpstan analyse --no-progress
|
|
|
|
- name: Run migrations
|
|
env:
|
|
DATABASE_URL: postgresql://superseller:test@postgres:5432/superseller_test?serverVersion=17
|
|
APP_ENV: test
|
|
run: php bin/console doctrine:migrations:migrate --no-interaction
|
|
|
|
- name: Pest
|
|
env:
|
|
DATABASE_URL: postgresql://superseller:test@postgres:5432/superseller_test?serverVersion=17
|
|
APP_ENV: test
|
|
REDIS_URL: redis://redis:6379
|
|
run: ./vendor/bin/pest
|