feat: add Gitea Actions CI (CS Fixer, PHPStan, Pest + migrations)

This commit is contained in:
Simon Kuehn 2026-05-14 04:25:50 +00:00
parent f204233509
commit f4eb39b52a

64
.gitea/workflows/ci.yml Normal file
View file

@ -0,0 +1,64 @@
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