Merge pull request #31 from Stogon/develop #151
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: Test Symfony bundle | |
on: [push, pull_request] | |
jobs: | |
test: | |
name: Test Symfony bundle using PHP ${{ matrix.php-versions }} and ${{ matrix.dependencies }} dependencies | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
php-versions: | |
- '7.4' | |
- '8.0' | |
- '8.1' | |
- '8.2' | |
- '8.3' | |
dependencies: | |
- "lowest" | |
- "highest" | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Setup PHP, with composer and extensions | |
uses: shivammathur/setup-php@v2 #https://github.com/shivammathur/setup-php | |
with: | |
php-version: ${{ matrix.php-versions }} | |
extensions: dom, json, tokenizer, mbstring, xml, ctype, iconv, intl, curl | |
coverage: xdebug #optional | |
tools: php-cs-fixer, phpunit, phpstan | |
- name: Setup problem matchers for PHP | |
run: echo "::add-matcher::${{ runner.tool_cache }}/php.json" | |
- name: Setup problem matchers for PHPUnit | |
run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json" | |
- name: Get composer cache directory | |
id: composer-cache | |
run: echo "DIR=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT | |
- name: Cache composer dependencies | |
uses: actions/cache@v3 | |
with: | |
path: ${{ steps.composer-cache.outputs.DIR }} | |
key: ${{ runner.os }}-composer-${{ matrix.php-versions }}-${{ hashFiles('**/composer.lock') }} | |
restore-keys: ${{ runner.os }}-composer- | |
- uses: "ramsey/composer-install@v2" | |
name: Install Composer dependencies | |
with: | |
dependency-versions: "${{ matrix.dependencies }}" | |
- name: Run PHPUnit Tests | |
uses: php-actions/phpunit@v3 | |
env: | |
XDEBUG_MODE: coverage | |
with: | |
version: 9.6 | |
php_version: "${{ matrix.php-versions }}" | |
bootstrap: "vendor/autoload.php" | |
configuration: "./phpunit.xml" | |
php_extensions: "xdebug" | |
coverage_clover: "coverage.xml" | |
args: --coverage-text | |
- name: Upload to Codecov | |
uses: codecov/codecov-action@v3 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
flags: unittests | |
files: ./coverage.xml | |
verbose: true | |
- name: Run PHPStan | |
env: | |
XDEBUG_MODE: off | |
run: php vendor/bin/phpstan analyse --no-progress | |
- name: Run php-cs-fixer | |
env: | |
PHP_CS_FIXER_IGNORE_ENV: true | |
run: php vendor/bin/php-cs-fixer fix --config=.php-cs-fixer.dist.php --diff --dry-run |