Skip to content

Commit 0cbfbc1

Browse files
authored
Merge pull request #854 from algolia/chore/automate-tests-using-phpcompatibility
chore: making PHPCompatibility assess no funky <7.1 PHP is used in our project
2 parents 5c71382 + 4cda0cf commit 0cbfbc1

File tree

2 files changed

+33
-0
lines changed

2 files changed

+33
-0
lines changed

.circleci/config.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,33 @@ jobs:
6464
docker:
6565
- image: algolia/magento2-circleci:2.3.0
6666

67+
"phpcompatibility":
68+
docker: # run the steps with Docker with PHP 7.2
69+
- image: circleci/php:7.2
70+
steps:
71+
- checkout
72+
- run: sudo composer self-update
73+
- run: composer config http-basic.repo.magento.com ${MAGENTO_AUTH_USERNAME} ${MAGENTO_AUTH_PASSWORD}
74+
- restore_cache:
75+
keys:
76+
- composer-v1-{{ checksum "composer.lock" }}
77+
- composer-v1-
78+
- run: composer install -n --prefer-dist --ignore-platform-reqs --no-progress
79+
- save_cache:
80+
key: composer-v1-{{ checksum "composer.lock" }}
81+
paths:
82+
- vendor
83+
- run:
84+
name: PHPCS PHPCompatibility
85+
command: |
86+
./vendor/bin/phpcs --config-set installed_paths vendor/phpcompatibility/php-compatibility/PHPCompatibility/
87+
# vendor/ is large and seems to break phpcs, ls+grep+xargs hack is used to send folders to phpcs
88+
ls -d */ | grep -vE 'dev|Test|vendor' | xargs ./vendor/bin/phpcs -p --standard=PHPCompatibility --runtime-set testVersion 7.1- --runtime-set ignore_warnings_on_exit true
89+
6790
workflows:
6891
version: 2
6992
build:
7093
jobs:
7194
- "magento-2.2"
7295
- "magento-2.3"
96+
- "phpcompatibility"

composer.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,15 @@
1313
"ext-mbstring": "*",
1414
"ext-dom": "*"
1515
},
16+
"repositories": [
17+
{
18+
"type": "composer",
19+
"url": "https://repo.magento.com/"
20+
}
21+
],
22+
"require-dev": {
23+
"phpcompatibility/php-compatibility": "^9.2"
24+
},
1625
"autoload": {
1726
"files": [ "registration.php" ],
1827
"psr-4": {

0 commit comments

Comments
 (0)