Add PHPUnit tests #102
Workflow file for this run
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
name: Analysis | |
'on': | |
push: | |
branches: | |
- master | |
paths-ignore: | |
- README.md | |
pull_request: | |
paths-ignore: | |
- README.md | |
jobs: | |
analysis: | |
name: 'PHP ${{ matrix.php }} Symfony ${{ matrix.symfony }}' | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
php: | |
- 8.1 | |
- 8.2 | |
symfony: | |
- '5.4.*' | |
- '6.3.*' | |
env: | |
APP_ENV: test | |
steps: | |
- | |
uses: actions/checkout@v3 | |
- | |
name: 'Setup PHP' | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: '${{ matrix.php }}' | |
tools: symfony | |
coverage: none | |
- | |
name: 'Composer - Get Cache Directory' | |
id: composer-cache | |
run: 'echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT' | |
- | |
name: 'Composer - Set cache' | |
uses: actions/cache@v3 | |
with: | |
path: '${{ steps.composer-cache.outputs.dir }}' | |
key: 'php-${{ matrix.php }}-symfony-${{ matrix.symfony }}-composer-${{ hashFiles(''**/composer.json'') }}' | |
restore-keys: "php-${{ matrix.php }}-symfony-${{ matrix.symfony }}-composer-\n" | |
- | |
name: 'Composer - Validate composer.json and composer.lock' | |
run: 'composer validate --strict' | |
- | |
name: 'Composer - Github Auth' | |
run: 'composer config -g github-oauth.github.com ${{ github.token }}' | |
- | |
name: 'Composer - Restrict Symfony version' | |
run: 'composer config extra.symfony.require "${{ matrix.symfony }}"' | |
- | |
name: 'Composer - Update dependencies' | |
run: 'composer update --no-progress' | |
id: end-of-setup | |
- | |
name: 'ECS - Run' | |
run: 'if [ -f dev/ecs.php ]; then vendor/bin/ecs check src/ tests/Behat/ --no-progress-bar -c dev/ecs.php ; else echo Ecs ruleset file does not exist, skipping step ; fi' | |
if: 'always() && steps.end-of-setup.outcome == ''success''' | |
- | |
name: 'PHPStan - Run' | |
run: 'if [ -f dev/phpstan.neon ]; then vendor/bin/phpstan analyse -c dev/phpstan.neon src/ ; else echo PHPStan ruleset file does not exist, skipping step ; fi' | |
if: 'always() && steps.end-of-setup.outcome == ''success''' | |
- | |
name: 'PHPSpec - Run' | |
run: 'if [ -f phpspec.yml.dist ]; then vendor/bin/phpspec run ; else echo PHPSpec config file does not exist, skipping step ; fi' | |
if: 'always() && steps.end-of-setup.outcome == ''success''' | |
- | |
name: 'PHPMD - Run' | |
run: 'if [ -f dev/.php_md.xml ]; then vendor/bin/phpmd src ansi dev/.php_md.xml ; else echo PHPMD config file does not exist, skipping step ; fi' | |
if: 'always() && steps.end-of-setup.outcome == ''success''' | |
- | |
name: 'GrumPHP - Run' | |
run: 'if [ -f grumphp.yml ]; then vendor/bin/grumphp run ; else echo Grumphp ruleset file does not exist, skipping step ; fi' | |
if: 'always() && steps.end-of-setup.outcome == ''success''' | |
- | |
uses: symfonycorp/security-checker-action@v5 | |
if: 'always() && steps.end-of-setup.outcome == ''success''' |