Translated using Weblate (Slovenian)
[phpmyadmin.git] / .github / workflows / lint-and-analyse-php.yml
blob78b2c5f4edbf40d1211112a7b0b73b3a2ddcfb9d
1 name: Lint and analyse php files
3 on:
4   push:
5   pull_request:
6     types: [opened, synchronize, reopened]
7     branches:
8       - master
9       - QA_**
11 permissions:
12   contents: read
14 jobs:
15   lint-php-files:
16     runs-on: ubuntu-latest
17     strategy:
18       matrix:
19         php-version: ["8.1"]
20     steps:
21       - name: Checkout code
22         uses: actions/checkout@v4
24       - name: Set up PHP ${{ matrix.php-version }}
25         uses: shivammathur/setup-php@v2
26         with:
27           php-version: ${{ matrix.php-version }}
29       - name: Validate composer.json and composer.lock
30         run: composer validate --strict
32       - name: Install Composer dependencies
33         # Allow the previous check to fail but not abort
34         if: always()
35         uses: ramsey/composer-install@v2
36         with:
37           # Ignore zip for php-webdriver/webdriver
38           composer-options: "--ignore-platform-req=ext-zip"
40       - name: Cache coding-standard
41         # Allow the previous check to fail but not abort
42         if: always()
43         uses: actions/cache@v3
44         with:
45           path: .phpcs-cache
46           key: phpcs-cache
48       - name: Lint PHP files
49         # Allow the previous check to fail but not abort
50         if: always()
51         run: ./test/ci-phplint
53       - name: Check coding-standard
54         # Allow the previous check to fail but not abort
55         if: always()
56         run: composer phpcs
58       - name: Check Twig templates
59         # Allow the previous check to fail but not abort
60         if: always()
61         run: composer run twig-lint
63   analyse-php:
64     runs-on: ubuntu-latest
65     strategy:
66       matrix:
67         php-version: ["8.1"]
68     steps:
69       - name: Checkout code
70         uses: actions/checkout@v4
72       - name: Set up PHP ${{ matrix.php-version }}
73         uses: shivammathur/setup-php@v2
74         with:
75           php-version: ${{ matrix.php-version }}
76           extensions: mbstring, iconv, mysqli, zip, gd, bz2
78       - name: Install Composer dependencies
79         uses: ramsey/composer-install@v2
81       - name: Analyse files with PHPStan
82         run: composer phpstan -- --memory-limit 2G
84       - name: Analyse files with Psalm
85         # Allow the previous check to fail but not abort
86         if: always()
87         run: composer psalm -- --shepherd