Mention PsFixturesCreator in README #71
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: PHP tests | |
on: [push, pull_request] | |
jobs: | |
# Check the PHP code follow the coding standards | |
php-cs-fixer: | |
name: PHP-CS-Fixer | |
runs-on: ubuntu-latest | |
steps: | |
- name: Setup PHP | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: '7.4' | |
- name: Checkout | |
uses: actions/[email protected] | |
- name: Cache dependencies | |
uses: actions/cache@v2 | |
with: | |
path: vendor | |
key: php-${{ hashFiles('composer.lock') }} | |
- name: Install dependencies | |
run: composer install | |
- name: Run PHP-CS-Fixer | |
run: ./vendor/bin/php-cs-fixer fix --dry-run --diff --using-cache=no --diff-format udiff | |
# Check there is no syntax errors in the project | |
php-linter: | |
name: PHP Syntax check 7.2 => 8.1 | |
runs-on: ubuntu-latest | |
steps: | |
- name: Cancel Previous Runs | |
uses: styfle/[email protected] | |
with: | |
all_but_latest: true | |
access_token: ${{ github.token }} | |
- name: Checkout | |
uses: actions/[email protected] | |
- name: PHP syntax checker 7.2 | |
uses: prestashop/github-action-php-lint/7.2@master | |
- name: PHP syntax checker 7.3 | |
uses: prestashop/github-action-php-lint/7.3@master | |
- name: PHP syntax checker 7.4 | |
uses: prestashop/github-action-php-lint/7.4@master | |
- name: PHP syntax checker 8.0 | |
uses: prestashop/github-action-php-lint/8.0@master | |
- name: PHP syntax checker 8.1 | |
uses: prestashop/github-action-php-lint/8.1@master | |
phpstan: | |
permissions: | |
actions: write # for styfle/cancel-workflow-action to cancel/stop running workflows | |
contents: read # for actions/checkout to fetch code | |
name: PHP Static Analysis | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
php: [ '7.2', '7.3', '7.4', '8.0', '8.1' ] | |
fail-fast: false | |
steps: | |
- name: Cancel Previous Runs | |
uses: styfle/[email protected] | |
with: | |
all_but_latest: true | |
access_token: ${{ github.token }} | |
- name: Setup PHP | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: '7.4' | |
extensions: mbstring, intl, gd, xml, dom, json, fileinfo, curl, zip, iconv, simplexml | |
- uses: actions/checkout@v2 | |
- name: Get Composer Cache Directory | |
id: composer-cache | |
run: echo "::set-output name=dir::$(composer config cache-files-dir)" | |
- name: Cache Composer Directory | |
uses: actions/cache@v2 | |
with: | |
path: ${{ steps.composer-cache.outputs.dir }} | |
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} | |
restore-keys: ${{ runner.os }}-composer- | |
- name: Composer Install | |
run: | | |
composer install --ansi --prefer-dist --no-interaction --no-progress | |
rm composer.lock | |
composer config platform.php ${{ matrix.php }} | |
- name: Run phpstan | |
run: ./vendor/bin/phpstan analyse |