-
Notifications
You must be signed in to change notification settings - Fork 54
51 lines (40 loc) · 2.12 KB
/
phpstan.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
name: phpstan
on: [push, pull_request]
jobs:
build:
strategy:
matrix:
include:
- PHP_VERSION: php73-fpm
MAGENTO_VERSION: 2.3.7-p4
- PHP_VERSION: php74-fpm
MAGENTO_VERSION: 2.4.0
- PHP_VERSION: php81-fpm
MAGENTO_VERSION: 2.4.6-p4
- PHP_VERSION: php83-fpm
MAGENTO_VERSION: 2.4.7
- PHP_VERSION: php83-fpm
MAGENTO_VERSION: 2.4.7
PHPSTAN_LEVEL: 2
name: PHP ${{ matrix.PHP_VERSION }} Magento ${{ matrix.MAGENTO_VERSION }}${{ matrix.PHPSTAN_LEVEL && format(' Level {0}', matrix.PHPSTAN_LEVEL) || '' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Start Docker
run: docker run --detach --name magento-project-community-edition michielgerritsen/magento-project-community-edition:${{ matrix.PHP_VERSION }}-magento${{ matrix.MAGENTO_VERSION }}
- name: Remove version from composer.json
run: sed -i '/version/d' ./composer.json
- name: Upload our code into the docker container
run: docker cp $(pwd) magento-project-community-edition:/data/extensions/
- name: Install the extensions in Magento
run: docker exec magento-project-community-edition ./install-composer-package mollie/magento2:@dev
- name: Activate the extension
run: docker exec magento-project-community-edition ./retry "php bin/magento module:enable Mollie_Payment && php bin/magento setup:upgrade && php bin/magento setup:di:compile"
- name: Run PHPStan
continue-on-error: ${{ matrix.PHPSTAN_LEVEL == 2 }}
run: |
LEVEL_OPTION=""
if [ -n "${{ matrix.PHPSTAN_LEVEL }}" ]; then
LEVEL_OPTION="--level=${{ matrix.PHPSTAN_LEVEL }}"
fi
docker exec magento-project-community-edition /bin/bash -c "./vendor/bin/phpstan analyse --no-progress $LEVEL_OPTION -c /data/extensions/*/phpstan.neon /data/extensions"