fix: issue with phpstan type #234
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# https://help.github.com/en/actions | |
# from : https://www.strangebuzz.com/en/blog/setting-a-ci-cd-workflow-for-a-symfony-project-thanks-to-the-github-actions | |
name: MusicAll CI process | |
on: | |
push: | |
branches: | |
- master | |
pull_request: | |
branches: | |
- master | |
jobs: | |
symfony: | |
name: Symfony 7.0 (PHP ${{ matrix.php-versions }}) | |
# https://hub.docker.com/_/ubuntu/ | |
runs-on: ubuntu-22.04 | |
services: | |
# https://docs.docker.com/samples/library/mysql/ | |
mysql: | |
image: mariadb:10.11 | |
env: | |
MYSQL_ROOT_PASSWORD: toor | |
ports: | |
- 3306:3306 | |
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3 | |
strategy: | |
fail-fast: true | |
matrix: | |
php-versions: ['8.2'] | |
steps: | |
# —— Setup Github actions 🐙 ————————————————————————————————————————————— | |
# https://github.com/actions/checkout (official) | |
- name: Checkout | |
uses: actions/checkout@v4 | |
# https://github.com/shivammathur/setup-php (community) | |
- name: Setup PHP, extensions and composer with shivammathur/setup-php | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: ${{ matrix.php-versions }} | |
extensions: mbstring, xml, ctype, intl, pdo, pdo_mysql, mysql, dom, filter, gd, json | |
env: | |
update: true | |
- name: Check PHP Version | |
run: php -v | |
# —— Composer 🧙️ ————————————————————————————————————————————————————————— | |
- name: Cache Composer dependencies | |
uses: actions/cache@v4 | |
with: | |
path: /tmp/composer-cache | |
key: ${{ runner.os }}-${{ hashFiles('**/composer.lock') }} | |
- name: Install dependencies | |
run: composer install --prefer-dist | |
# —— Symfony 🎵 —————————————————————————————————————————————————————————— | |
- name: Check the Symfony console | |
run: | | |
bin/console about | |
## —— Static analysis ✨ ————————————————————————————————————————————————— | |
- name: PHPStan Static Analysis | |
uses: php-actions/phpstan@v2 | |
with: | |
memory_limit: 256M | |
php_version: ${{ matrix.php-versions }} | |
- name: Create test database | |
run: | | |
php bin/console doctrine:cache:clear-metadata | |
php bin/console doctrine:database:create --if-not-exists | |
php bin/console doctrine:schema:drop --force | |
php bin/console doctrine:schema:create | |
php bin/console doctrine:schema:validate | |
env: | |
APP_ENV: test | |
- name: PHPUnit Tests | |
uses: php-actions/phpunit@v3 | |
with: | |
memory_limit: 400M | |
version: 10.5 | |
php_extensions: xdebug pdo_mysql mysqli intl json | |
php_version: ${{ matrix.php-versions }} | |
args: tests --coverage-clover ./coverage.xml | |
env: | |
XDEBUG_MODE: coverage | |
APP_ENV: test | |
- name: Upload coverage reports to Codecov | |
uses: codecov/[email protected] | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} |