Skip to content

Run CI & security check using GitHub actions #14

Run CI & security check using GitHub actions

Run CI & security check using GitHub actions #14

Workflow file for this run

name: "Tests"
concurrency:
group: "tests-${{ github.head_ref || github.run_id }}"
cancel-in-progress: true
on:
pull_request:
push:
branches: [master]
jobs:
tests:
name: "PHP ${{ matrix.php }}"
runs-on: "ubuntu-latest"
env:
DATABASE_URL: postgresql://main:[email protected]:${{ job.services.postgresql.ports[5432] }}/main?serverVersion=11&charset=utf8

Check failure on line 17 in .github/workflows/tests.yaml

View workflow run for this annotation

GitHub Actions / Tests

Invalid workflow file

The workflow is not valid. .github/workflows/tests.yaml (Line: 17, Col: 21): Unrecognized named-value: 'job'. Located at position 1 within expression: job.services.postgresql.ports[5432]
services:
postgresql:
image: "postgres:11.7-alpine"
env:
POSTGRES_USER: main
POSTGRES_PASSWORD: main
POSTGRES_DB: main
ports:
- 5432/tcp
strategy:
fail-fast: false
matrix:
php:
- "7.4"
include:
- php: "7.4"
php-version: "7.4.1"
steps:
- name: "Setup PHP"
uses: "shivammathur/setup-php@v2"
with:
php-version: "${{ matrix.php-version }}"
extensions: "curl, iconv, intl, pdo_pgsql, zip"
- name: "Checkout"
uses: "actions/checkout@v4"
with:
show-progress: false
- name: "Install composer dependencies"
uses: "ramsey/composer-install@v2"
- name: "Validate composer dependencies"
run: "composer validate"
- name: "Check code style"
run: "composer check-cs"
- name: "Run PHPStan"
run: "composer phpstan"
- name: "Lint twig"
run: "bin/console lint:twig templates --show-deprecations"
- name: "Run migrations"
run: "bin/console doctrine:migrations:migrate --no-interaction"
- name: "Setup messenger transports"
run: "bin/console messenger:setup-transports"
- name: "Validate database schema"
run: "bin/console doctrine:schema:validate"
- name: "Set git committer info"
shell: bash
run: |
git config --global user.email ${GITHUB_ACTOR_ID}[email protected]
git config --global user.name $GITHUB_ACTOR
- name: "Run unit tests"
run: "composer phpunit:unit"
- name: "Run integration tests"
run: "composer phpunit:integration"
- name: "Run functional tests"
run: "composer phpunit:functional"
- name: "Warmup prod cache"
run: "bin/console cache:warmup --env=prod"