Skip to content

Commit

Permalink
🤖 TEST: Update quality assurance workflow with Docker and enhanced steps
Browse files Browse the repository at this point in the history
  • Loading branch information
yoanbernabeu committed Dec 21, 2024
1 parent bebab04 commit f0addea
Showing 1 changed file with 54 additions and 26 deletions.
80 changes: 54 additions & 26 deletions .github/workflows/quality.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,53 +3,81 @@ name: Quality Assurance
on:
push:
pull_request:
branches: [ "main" ]

jobs:
static-code-analysis:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@master

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.3'
extensions: pdo_sqlite
coverage: xdebug

- name: Copy .env.test
run: php -r "file_exists('.env.test.local') || copy('.env.test', '.env.test.local');"

- name: Install Dependencies
run: composer install -q --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist

- name: Create Database
- name: Create Database Directory
run: |
mkdir -p var/
mkdir -p var
touch var/test.db
chmod -R 777 var
- name: Copy .env.test
run: cp .env.test .env.test.local

- name: PHP CS Fixer
run: vendor/bin/php-cs-fixer fix ./src --rules=@Symfony --verbose --dry-run
uses: docker://jakzal/phpqa:php8.3
with:
args: php-cs-fixer fix ./src --rules=@Symfony --verbose --dry-run

- name: PHPStan
run: vendor/bin/phpstan analyse ./src --level=8
uses: docker://jakzal/phpqa:php8.3
with:
args: phpstan analyse ./src --level=8

- name: Security Check
run: vendor/bin/security-checker security:check
uses: docker://jakzal/phpqa:php8.3
with:
args: local-php-security-checker

- name: Lint Twig
run: php bin/console lint:twig ./templates
uses: docker://jakzal/phpqa:php8.3
with:
args: bin/console lint:twig ./templates

- name: Lint YAML
run: php bin/console lint:yaml ./config
uses: docker://jakzal/phpqa:php8.3
with:
args: bin/console lint:yaml ./config

- name: Lint Container
run: php bin/console lint:container
uses: docker://jakzal/phpqa:php8.3
with:
args: bin/console lint:container

- name: Execute tests
- name: Create Database Schema
uses: docker://jakzal/phpqa:php8.3
env:
DATABASE_URL: "sqlite:///%kernel.project_dir%/var/test.db"
APP_ENV: test
run: |
php bin/console doctrine:schema:create --env=test
vendor/bin/phpunit --testdox
with:
args: bin/console doctrine:schema:create --env=test

- name: Run Migrations
uses: docker://jakzal/phpqa:php8.3
env:
DATABASE_URL: "sqlite:///%kernel.project_dir%/var/test.db"
APP_ENV: test
with:
args: bin/console doctrine:migrations:migrate --no-interaction --env=test

- name: Load Fixtures
uses: docker://jakzal/phpqa:php8.3
env:
DATABASE_URL: "sqlite:///%kernel.project_dir%/var/test.db"
APP_ENV: test
with:
args: bin/console doctrine:fixtures:load --no-interaction --env=test

- name: Run Tests
uses: docker://jakzal/phpqa:php8.3
env:
DATABASE_URL: "sqlite:///%kernel.project_dir%/var/test.db"
APP_ENV: test
with:
args: bin/phpunit --testdox

0 comments on commit f0addea

Please sign in to comment.