mirror of
https://github.com/maelgangloff/domain-watchdog.git
synced 2025-12-17 17:55:42 +00:00
ci: update CI
This commit is contained in:
parent
ea61c0bf12
commit
5e93dee6ea
@ -1,4 +1,4 @@
|
||||
name: Symfony CI
|
||||
name: Lint and Tests
|
||||
|
||||
on:
|
||||
push:
|
||||
@ -10,9 +10,90 @@ permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
symfony:
|
||||
name: CI
|
||||
php-setup:
|
||||
name: PHP Setup
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
vendor-path: ${{ steps.upload.outputs.artifact-path }}
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Set up PHP
|
||||
uses: shivammathur/setup-php@v2
|
||||
with:
|
||||
php-version: '8.3'
|
||||
extensions: mbstring, xml, intl, curl, iconv, pdo_pgsql, sodium, zip, http
|
||||
|
||||
- name: Cache Composer dependencies
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: vendor
|
||||
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-composer-
|
||||
|
||||
- name: Install dependencies
|
||||
run: composer install --prefer-dist --no-progress --no-suggest --optimize-autoloader
|
||||
|
||||
- name: Upload vendor folder
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: php-vendor
|
||||
path: vendor
|
||||
id: upload
|
||||
|
||||
|
||||
phpstan:
|
||||
name: PHPStan
|
||||
runs-on: ubuntu-latest
|
||||
needs: php-setup
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Download PHP vendor
|
||||
uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: php-vendor
|
||||
path: vendor
|
||||
|
||||
- name: Set up PHP
|
||||
uses: shivammathur/setup-php@v2
|
||||
with:
|
||||
php-version: '8.3'
|
||||
|
||||
- name: Run PHPStan
|
||||
run: vendor/bin/phpstan analyse
|
||||
|
||||
|
||||
cs-fixer:
|
||||
name: PHP-CS-Fixer
|
||||
runs-on: ubuntu-latest
|
||||
needs: [ php-setup, phpstan ]
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Download PHP vendor
|
||||
uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: php-vendor
|
||||
path: vendor
|
||||
|
||||
- name: Set up PHP
|
||||
uses: shivammathur/setup-php@v2
|
||||
with:
|
||||
php-version: '8.3'
|
||||
|
||||
- name: Run PHP-CS-Fixer
|
||||
run: vendor/bin/php-cs-fixer fix --dry-run --diff
|
||||
|
||||
|
||||
tests:
|
||||
name: Tests
|
||||
runs-on: ubuntu-latest
|
||||
needs: [ php-setup, cs-fixer, phpstan ]
|
||||
services:
|
||||
postgres:
|
||||
image: postgres
|
||||
@ -29,13 +110,11 @@ jobs:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Cache Composer dependencies
|
||||
uses: actions/cache@v3
|
||||
- name: Download PHP vendor
|
||||
uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: php-vendor
|
||||
path: vendor
|
||||
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-composer-
|
||||
|
||||
- name: Set up PHP
|
||||
uses: shivammathur/setup-php@v2
|
||||
@ -43,15 +122,6 @@ jobs:
|
||||
php-version: '8.3'
|
||||
extensions: mbstring, xml, intl, curl, iconv, pdo_pgsql, sodium, zip, http
|
||||
|
||||
- name: Install backend dependencies
|
||||
run: composer install --prefer-dist --no-progress --no-suggest --optimize-autoloader
|
||||
|
||||
- name: Run PHP-CS-Fixer
|
||||
run: vendor/bin/php-cs-fixer fix --dry-run --diff
|
||||
|
||||
- name: Run PHPStan
|
||||
run: vendor/bin/phpstan analyse
|
||||
|
||||
- name: Prepare database
|
||||
run: bin/console --env=test doctrine:database:create && bin/console --env=test doctrine:migrations:migrate
|
||||
|
||||
@ -64,6 +134,12 @@ jobs:
|
||||
- name: Run PHPUnit
|
||||
run: vendor/bin/phpunit --coverage-text
|
||||
|
||||
eslint:
|
||||
name: ESLint
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v3
|
||||
- name: Cache Node modules
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
Loading…
x
Reference in New Issue
Block a user