Translated using Weblate (Finnish) #950
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: Lint and analyse php files | |
on: | |
push: | |
pull_request: | |
types: [opened, synchronize, reopened] | |
jobs: | |
lint-php: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Use PHP 8.2 | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: 8.2 | |
- name: Validate composer.json and composer.lock | |
run: composer validate | |
- name: Cache module | |
uses: actions/cache@v3 | |
with: | |
path: ~/.composer/cache/ | |
key: composer-cache | |
- name: Install dependencies | |
run: composer install | |
- name: Lint files | |
run: composer run phpcs | |
analyse-php: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
php-version: ["8.2"] | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Use PHP ${{ matrix.php-version }} | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: ${{ matrix.php-version }} | |
tools: composer:v2 | |
- name: Get Composer cache directory | |
id: composer-cache | |
run: | | |
echo "::set-output name=dir::$(composer config cache-files-dir)" | |
- name: Cache dependencies | |
uses: actions/cache@v3 | |
with: | |
path: ${{ steps.composer-cache.outputs.dir }} | |
key: composer-${{ runner.os }}-${{ matrix.php-version }}-${{ hashFiles('**/composer.*') }} | |
restore-keys: | | |
composer-${{ runner.os }}-${{ matrix.php-version }}- | |
- name: Install dependencies | |
run: composer install | |
- name: Analyse files with PHPStan | |
run: composer run phpstan | |
- name: Analyse files with Psalm | |
# Allow the previous check to fail but not abort | |
if: always() | |
run: composer run psalm -- --shepherd |