chore: update github workflow #54
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: period-bundle-CI | |
on: | |
[push, pull_request] | |
jobs: | |
phpstan: | |
runs-on: ubuntu-latest | |
name: PHPStan | |
steps: | |
- name: Setup PHP | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: 8.2 | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: composer install | |
run: composer install | |
- name: PHPStan | |
run: composer phpstan | |
env: | |
REQUIRE_DEV: true | |
cs-fixer: | |
runs-on: ubuntu-latest | |
name: PHP-CS-Fixer | |
steps: | |
- name: Setup PHP | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: 8.2 | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: composer install | |
run: composer install | |
- name: CS Check | |
run: composer cs-check | |
tests: | |
name: PHP ${{ matrix.php }} / SF ^${{ matrix.symfony }} | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
php: ['8.2'] | |
symfony: ['6.2.*', '6.3.*', '6.4.*', '7.0.*'] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: Setup MySQL | |
run: | | |
sudo systemctl enable mysql.service | |
sudo systemctl start mysql.service | |
mysql -uroot -proot -h localhost -e "CREATE DATABASE test CHARACTER SET utf8 COLLATE utf8_general_ci;" | |
- name: Setup PHP | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: ${{ matrix.php }} | |
- if: matrix.symfony == '5.4.*' | |
run: | | |
sed -ri 's/"symfony\/framework-bundle": "(.+)"/"symfony\/framework-bundle": "${{ matrix.symfony }}"/' composer.json; | |
sed -ri 's/"symfony\/yaml": "(.+)"/"symfony\/yaml": "${{ matrix.symfony }}"/' composer.json; | |
- if: matrix.symfony != '5.4.*' | |
run: | | |
sed -ri 's/"symfony\/(.+)": "(.+)"/"symfony\/\1": "${{ matrix.symfony }}"/' composer.json; | |
- run: composer update --no-interaction --no-progress --ansi | |
- run: composer phpunit |