mirror of
https://github.com/maelgangloff/domain-watchdog.git
synced 2025-12-29 16:15:04 +00:00
80 lines
2.6 KiB
YAML
80 lines
2.6 KiB
YAML
name: Symfony CI
|
|
|
|
on:
|
|
push:
|
|
branches: [ "master", "develop" ]
|
|
pull_request:
|
|
branches: [ "master", "develop" ]
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
jobs:
|
|
symfony:
|
|
name: CI
|
|
runs-on: ubuntu-latest
|
|
services:
|
|
postgres:
|
|
image: postgres
|
|
env:
|
|
POSTGRES_PASSWORD: postgres
|
|
options: >-
|
|
--health-cmd pg_isready
|
|
--health-interval 10s
|
|
--health-timeout 5s
|
|
--health-retries 5
|
|
ports:
|
|
- 5432:5432
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v3
|
|
|
|
- name: Cache Composer dependencies
|
|
uses: actions/cache@v3
|
|
with:
|
|
path: vendor
|
|
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
|
|
restore-keys: |
|
|
${{ runner.os }}-composer-
|
|
|
|
- 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: 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
|
|
|
|
- name: Create JWT keys
|
|
run: bin/console lexik:jwt:generate-keypair
|
|
|
|
- name: Add extra RDAP servers
|
|
run: ln -s config/app/custom_rdap_servers.example.yaml config/app/custom_rdap_servers.yaml
|
|
|
|
- name: Run PHPUnit
|
|
run: vendor/bin/phpunit --coverage-text
|
|
|
|
- name: Cache Node modules
|
|
uses: actions/cache@v3
|
|
with:
|
|
path: node_modules
|
|
key: ${{ runner.os }}-node-${{ hashFiles('**/yarn.lock') }}
|
|
restore-keys: |
|
|
${{ runner.os }}-node-
|
|
|
|
- name: Install frontend dependencies
|
|
run: npm install --global yarn && yarn install
|
|
|
|
- name: Run ESLint
|
|
run: yarn run eslint
|