Skip to content

Code_Checks

Code_Checks #622

Workflow file for this run

name: Code_Checks
# Controls when the workflow will run
on:
schedule:
# minute, hour, day of month, month, weekday
# run every night at 5:15
- cron: '15 5 * * *'
# Triggers the workflow on push or pull request events but only for the main branch
push:
branches: [ master ]
pull_request:
branches: [ master ]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
permissions:
contents: read
jobs:
tests:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
php: ['8.4']
stability: [ prefer-stable ]
mongodb-version: ['7.0']
symfony-version: ['8.0.*']
include:
- php: '8.2'
mongodb-version: '7.0'
symfony-version: 6.4.*
stability: prefer-lowest
- php: '8.2'
mongodb-version: '7.0'
symfony-version: 6.4.*
stability: prefer-stable
- php: '8.2'
mongodb-version: '7.0'
symfony-version: 7.4.*
stability: prefer-stable
- php: '8.3'
mongodb-version: '7.0'
symfony-version: 7.4.*
stability: prefer-stable
- php: '8.4'
mongodb-version: '7.0'
symfony-version: 7.4.*
stability: prefer-stable
- php: '8.4'
mongodb-version: '7.0'
symfony-version: 8.0.*
stability: prefer-stable
- php: '8.5'
mongodb-version: '7.0'
symfony-version: 7.4.*
stability: prefer-stable
- php: '8.5'
mongodb-version: '7.0'
symfony-version: 8.0.*
stability: prefer-stable
name: PHP ${{ matrix.php }} - ${{ matrix.symfony-version }} - ${{ matrix.stability }}
steps:
# basically git clone
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd #v6
- name: Cache dependencies
uses: actions/cache@cdf6c1fa76f9f475f3d7449005a359c84ca0f306 #v5
with:
path: ~/.composer/cache/files
key: dependencies-php-${{ matrix.php }}-composer-${{ hashFiles('composer.json') }}
# use PHP of specific version
- uses: shivammathur/setup-php@44454db4f0199b8b9685a5d763dc37cbf79108e1 #v2
with:
php-version: ${{ matrix.php }}
extensions: pcov, curl, mongodb-stable
coverage: pcov
- name: Start MongoDB
uses: supercharge/mongodb-github-action@9306129218d23ef2e0a9e11bd708950d886bb855 #v1
with:
mongodb-version: ${{ matrix.mongodb-version }}
- name: Install dependencies
env:
SYMFONY_REQUIRE: ${{ matrix.symfony-version }}
run: |
composer global config --no-plugins allow-plugins.symfony/flex true
composer global require --no-progress --no-scripts --no-plugins symfony/flex
composer update --no-interaction --prefer-dist
vendor/bin/simple-phpunit install
- name: Execute tests
env:
SYMFONY_DEPRECATIONS_HELPER: 'weak'
run: vendor/bin/phpunit --coverage-text
cs-and-rector:
runs-on: ubuntu-latest
permissions:
# Give the default GITHUB_TOKEN write permission to commit and push the changed files back to the repository.
contents: write
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd #v6
- uses: shivammathur/setup-php@44454db4f0199b8b9685a5d763dc37cbf79108e1 #v2
with:
php-version: 8.4
coverage: none
- name: Cache dependencies
id: composer-cache
uses: actions/cache@cdf6c1fa76f9f475f3d7449005a359c84ca0f306 #v5
with:
path: vendor
key: dependencies-php-8.4-composer-${{ hashFiles('composer.json') }}
- run: |
composer install --prefer-dist --no-progress
composer rector-fix
composer cs-fix
- uses: stefanzweifel/git-auto-commit-action@04702edda442b2e678b25b537cec683a1493fcb9 #v7
with:
commit_message: Apply CS/Rector changes
phpstan:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd #v6
- uses: shivammathur/setup-php@44454db4f0199b8b9685a5d763dc37cbf79108e1 #v2
with:
php-version: 8.4
coverage: none
- run: composer install --no-progress
- run: vendor/bin/phpstan analyse --memory-limit=-1