64 خطوط
2.1 KiB
YAML
64 خطوط
2.1 KiB
YAML
name: quality
|
|
on:
|
|
push:
|
|
pull_request:
|
|
jobs:
|
|
backend:
|
|
runs-on: ubuntu-latest
|
|
services:
|
|
mysql:
|
|
image: mysql:8.4
|
|
env:
|
|
MYSQL_DATABASE: microlearn_test
|
|
MYSQL_ROOT_PASSWORD: ci-only-mysql-password
|
|
ports: ['3306:3306']
|
|
options: >-
|
|
--health-cmd="mysqladmin ping -h 127.0.0.1 -uroot -pci-only-mysql-password --silent"
|
|
--health-interval=10s
|
|
--health-timeout=5s
|
|
--health-retries=10
|
|
env:
|
|
DB_CONNECTION: mysql
|
|
DB_HOST: 127.0.0.1
|
|
DB_PORT: 3306
|
|
DB_DATABASE: microlearn_test
|
|
DB_USERNAME: root
|
|
DB_PASSWORD: ci-only-mysql-password
|
|
defaults: { run: { working-directory: backend } }
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: shivammathur/setup-php@v2
|
|
with: { php-version: '8.3', extensions: mbstring, intl, pdo_mysql, dom, zip }
|
|
- run: composer install --no-interaction --prefer-dist
|
|
- run: cp .env.example .env && php artisan key:generate
|
|
- run: php artisan migrate --force
|
|
- run: composer exec pint -- --test
|
|
- run: php artisan test --compact
|
|
- run: composer audit
|
|
frontend:
|
|
runs-on: ubuntu-latest
|
|
defaults: { run: { working-directory: frontend } }
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: actions/setup-node@v4
|
|
with: { node-version: 22, cache: npm, cache-dependency-path: frontend/package-lock.json }
|
|
- run: npm ci
|
|
- run: npm run lint
|
|
- run: npm run typecheck
|
|
- run: npm test
|
|
- run: npm run build
|
|
- run: npm audit --audit-level=high
|
|
production-images:
|
|
runs-on: ubuntu-latest
|
|
env:
|
|
MICROLEARN_ENV_FILE: infrastructure/production/.env.production.example
|
|
MYSQL_PASSWORD: ci-only-mysql-password
|
|
MYSQL_ROOT_PASSWORD: ci-only-mysql-root-password
|
|
REDIS_PASSWORD: ci-only-redis-password
|
|
MINIO_ROOT_USER: ci-only-minio
|
|
MINIO_ROOT_PASSWORD: ci-only-minio-password
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- run: docker compose -f docker-compose.production.yml config --quiet
|
|
- run: docker compose -f docker-compose.production.yml build app web
|