-
Notifications
You must be signed in to change notification settings - Fork 7
85 lines (68 loc) · 2.85 KB
/
phpcs.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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
name: PHP Code Standards
on: [pull_request]
jobs:
validate-code-standards:
runs-on: ubuntu-latest
services:
mysql:
image: mysql:latest
env:
MYSQL_DATABASE: magento_test
MYSQL_HOST: 127.0.0.1
MYSQL_USER: magento
MYSQL_PASSWORD: p@ssw0rd1
MYSQL_ROOT_PASSWORD: p@ssw0rd1
ports:
- 3306:3306
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install extensions gd and zip
run: sudo apt-get update && sudo apt-get install -y php8.1-gd && sudo apt-get install -y php8.1-zip
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: "8.1"
extensions: curl, dom, intl, json, openssl
coverage: xdebug
tools: phpmd
- name: Verify PHP Installation
run: php -v
- name: Get Composer cache directory
id: composer-cache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
- name: Setup cache
uses: pat-s/[email protected]
env:
COMPOSER_AUTH: ${{secrets.COMPOSER_AUTH}}
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: ${{ runner.os }}-composer-
- name: Install & Build Magento
id: build-magento
run: bash bin/install-mg2.sh 2.4.7-p2
- name: Install MP Plugin
id: install-plugin
run: mkdir magento2/app/code/MercadoPago/ && mkdir magento2/app/code/MercadoPago/AdbPayment/ && mv $(ls --ignore='bin' --ignore='.github' --ignore='magento2') magento2/app/code/MercadoPago/AdbPayment && ls
- name: Download PHPStan composer dependencies
id: phpstan-composer-dependencies
env:
COMPOSER_AUTH: ${{secrets.COMPOSER_AUTH}}
run: cd magento2 && composer require --dev phpstan/phpstan
- name: Config Warnings Exit
id: phpcs-warning-configs
run: magento2/vendor/bin/phpcs --config-set ignore_warnings_on_exit 1
- name: Detect Coding Standard Violations
id: phpcs
run: magento2/vendor/bin/phpcs -qn --standard=Magento2 --ignore=magento2/app/code/MercadoPago/AdbPayment/Tests magento2/app/code/MercadoPago/
- name: Detect PHP Compatibility
id: phpcs_compatibility
run: magento2/vendor/bin/phpcs -qn --standard=PHPCompatibility --runtime-set testVersion 7.4-8.2 magento2/app/code/MercadoPago/
- name: PHPStan version
id: phpstan-version
run: magento2/vendor/bin/phpstan -V
- name: PHPStan
id: phpstan
run: magento2/vendor/bin/phpstan analyse --error-format=table --level 1 magento2/app/code/MercadoPago/