|
1 | 1 | name: PHP tests |
2 | 2 | on: [push, pull_request] |
3 | 3 | jobs: |
4 | | - # Check there is no syntax errors in the project |
5 | | - php-linter: |
6 | | - name: PHP Syntax check |
7 | | - runs-on: ubuntu-latest |
8 | | - steps: |
9 | | - - name: Checkout |
10 | | - |
11 | | - |
12 | | - - name: PHP syntax checker 5.6 |
13 | | - uses: prestashop/github-action-php-lint/5.6@master |
14 | | - |
15 | | - - name: PHP syntax checker 7.2 |
16 | | - uses: prestashop/github-action-php-lint/7.2@master |
17 | | - |
18 | | - - name: PHP syntax checker 7.3 |
19 | | - uses: prestashop/github-action-php-lint/7.3@master |
20 | | - |
21 | | - - name: PHP syntax checker 7.4 |
22 | | - uses: prestashop/github-action-php-lint/7.4@master |
23 | | - |
24 | | - # Check the PHP code follow the coding standards |
25 | | - php-cs-fixer: |
26 | | - name: PHP-CS-Fixer |
27 | | - runs-on: ubuntu-latest |
28 | | - steps: |
29 | | - - name: Setup PHP |
30 | | - uses: shivammathur/setup-php@v2 |
31 | | - with: |
32 | | - php-version: '7.4' |
33 | | - |
34 | | - - name: Checkout |
35 | | - |
36 | | - |
37 | | - - name: Cache dependencies |
38 | | - uses: actions/cache@v2 |
39 | | - with: |
40 | | - path: vendor |
41 | | - key: php-${{ hashFiles('composer.lock') }} |
42 | | - |
43 | | - - name: Install dependencies |
44 | | - run: composer install |
45 | | - |
46 | | - - name: Run PHP-CS-Fixer |
47 | | - run: ./vendor/bin/php-cs-fixer fix --dry-run --diff --using-cache=no --diff-format udiff |
48 | | - |
49 | | - # Run PHPStan against the module and a PrestaShop release |
50 | | - phpstan: |
51 | | - name: PHPStan |
52 | | - runs-on: ubuntu-latest |
53 | | - strategy: |
54 | | - matrix: |
55 | | - presta-versions: ['1.7.1.2', '1.7.2.5', '1.7.3.4', '1.7.4.4', '1.7.5.1', '1.7.6.9', '1.7.7.3', 'latest'] |
56 | | - steps: |
57 | | - - name: Setup PHP |
58 | | - uses: shivammathur/setup-php@v2 |
59 | | - with: |
60 | | - php-version: '7.4' |
61 | | - |
62 | | - - name: Checkout |
63 | | - |
64 | | - |
65 | | - # Add vendor folder in cache to make next builds faster |
66 | | - - name: Cache vendor folder |
67 | | - uses: actions/cache@v1 |
68 | | - with: |
69 | | - path: vendor |
70 | | - key: php-${{ hashFiles('composer.lock') }} |
71 | | - |
72 | | - # Add composer local folder in cache to make next builds faster |
73 | | - - name: Cache composer folder |
74 | | - uses: actions/cache@v1 |
75 | | - with: |
76 | | - path: ~/.composer/cache |
77 | | - key: php-composer-cache |
78 | | - |
79 | | - - run: composer install |
80 | | - |
81 | | - # Docker images prestashop/prestashop may be used, even if the shop remains uninstalled |
82 | | - - name: Execute PHPStan on PrestaShop (Tag ${{ matrix.presta-versions }}) |
83 | | - run: ./tests/phpstan.sh ${{ matrix.presta-versions }} |
| 4 | + # Check there is no syntax errors in the project |
| 5 | + php-linter: |
| 6 | + name: PHP Syntax check 5.6 => 8.1 |
| 7 | + runs-on: ubuntu-latest |
| 8 | + steps: |
| 9 | + - name: Checkout |
| 10 | + |
| 11 | + |
| 12 | + - name: PHP syntax checker 5.6 |
| 13 | + uses: prestashop/github-action-php-lint/5.6@master |
| 14 | + |
| 15 | + - name: PHP syntax checker 7.2 |
| 16 | + uses: prestashop/github-action-php-lint/7.2@master |
| 17 | + |
| 18 | + - name: PHP syntax checker 7.3 |
| 19 | + uses: prestashop/github-action-php-lint/7.3@master |
| 20 | + |
| 21 | + - name: PHP syntax checker 7.4 |
| 22 | + uses: prestashop/github-action-php-lint/7.4@master |
| 23 | + |
| 24 | + - name: PHP syntax checker 8.0 |
| 25 | + uses: prestashop/github-action-php-lint/8.0@master |
| 26 | + |
| 27 | + - name: PHP syntax checker 8.1 |
| 28 | + uses: prestashop/github-action-php-lint/8.1@master |
| 29 | + |
| 30 | + # Check the PHP code follow the coding standards |
| 31 | + php-cs-fixer: |
| 32 | + name: PHP-CS-Fixer |
| 33 | + runs-on: ubuntu-latest |
| 34 | + steps: |
| 35 | + - name: Setup PHP |
| 36 | + uses: shivammathur/setup-php@v2 |
| 37 | + with: |
| 38 | + php-version: '7.4' |
| 39 | + |
| 40 | + - name: Checkout |
| 41 | + |
| 42 | + |
| 43 | + - name: Cache dependencies |
| 44 | + uses: actions/cache@v2 |
| 45 | + with: |
| 46 | + path: vendor |
| 47 | + key: php-${{ hashFiles('composer.lock') }} |
| 48 | + |
| 49 | + - name: Install dependencies |
| 50 | + run: composer install |
| 51 | + |
| 52 | + - name: Run PHP-CS-Fixer |
| 53 | + run: ./vendor/bin/php-cs-fixer fix --dry-run --diff --using-cache=no --diff-format udiff |
| 54 | + |
| 55 | + # Run PHPStan against the module and a PrestaShop release |
| 56 | + phpstan: |
| 57 | + name: PHPStan |
| 58 | + runs-on: ubuntu-latest |
| 59 | + strategy: |
| 60 | + matrix: |
| 61 | + presta-versions: ['1.7.1.2', '1.7.2.5', '1.7.3.4', '1.7.4.4', '1.7.5.1', '1.7.6', '1.7.7', '1.7.8', 'latest'] |
| 62 | + steps: |
| 63 | + - name: Setup PHP |
| 64 | + uses: shivammathur/setup-php@v2 |
| 65 | + with: |
| 66 | + php-version: '7.4' |
| 67 | + |
| 68 | + - name: Checkout |
| 69 | + |
| 70 | + |
| 71 | + # Add vendor folder in cache to make next builds faster |
| 72 | + - name: Cache vendor folder |
| 73 | + uses: actions/cache@v1 |
| 74 | + with: |
| 75 | + path: vendor |
| 76 | + key: php-${{ hashFiles('composer.lock') }} |
| 77 | + |
| 78 | + # Add composer local folder in cache to make next builds faster |
| 79 | + - name: Cache composer folder |
| 80 | + uses: actions/cache@v1 |
| 81 | + with: |
| 82 | + path: ~/.composer/cache |
| 83 | + key: php-composer-cache |
| 84 | + |
| 85 | + - run: composer install |
| 86 | + |
| 87 | + # Docker images prestashop/prestashop may be used, even if the shop remains uninstalled |
| 88 | + - name: Execute PHPStan on PrestaShop (Tag ${{ matrix.presta-versions }}) |
| 89 | + run: ./tests/phpstan.sh ${{ matrix.presta-versions }} |
0 commit comments