Skip to content

Commit a7960ac

Browse files
domtraSascha Nos
andauthored
feat(composer): allow composers/installers version 2
* feat(composer): allow composer/installers version 2 * feat: update dependencies for PHP 8.1 * fix(ResolveConfig): remove PHP 8.2 deprecations * ci(travis): update php versions * ci: switch from travisci to github actions * ci(scrutinizer): update config * style: fix scrutinizer issues --------- Co-authored-by: Sascha Nos <[email protected]>
1 parent a63594f commit a7960ac

13 files changed

+1163
-707
lines changed

.github/workflows/main.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: Run PHP tests
2+
3+
on:
4+
push:
5+
branches: [ "master" ]
6+
pull_request:
7+
branches: [ "master" ]
8+
9+
permissions:
10+
contents: read
11+
12+
jobs:
13+
run-test:
14+
runs-on: ubuntu-22.04
15+
16+
strategy:
17+
matrix:
18+
php: [7.4, 8.0, 8.1, 8.2, 8.3]
19+
# dependency-version: [prefer-lowest, prefer-stable]
20+
dependency-version: [prefer-stable]
21+
22+
name: PHP${{ matrix.php }}_${{ matrix.dependency-version }}
23+
24+
steps:
25+
- uses: actions/checkout@v3
26+
27+
- uses: shivammathur/setup-php@v2
28+
with:
29+
php-version: ${{ matrix.php }}
30+
coverage: xdebug
31+
32+
- name: Install dependencies
33+
run: composer update --${{ matrix.dependency-version }} --prefer-dist --no-interaction --no-suggest
34+
35+
- name: Check coding style
36+
run: vendor/bin/phpcs -s --standard=phpcs.ruleset.xml .
37+
38+
- name: Execute tests
39+
run: vendor/bin/phpunit
40+
41+
# TODO: add codecoverage // vendor/bin/phpunit --coverage-clover logs/clover.xml

.scrutinizer.yml

Lines changed: 13 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,17 @@
1-
# language: php
2-
31
filter:
4-
paths: [lib/*]
5-
excluded_paths: [tests/*, vendor/*]
6-
7-
before_commands:
8-
- 'composer self-update'
9-
- 'composer update --prefer-stable --prefer-source --no-interaction --no-scripts --no-progress --no-suggest'
2+
excluded_paths:
3+
- 'tests/'
104

11-
tools:
12-
php_code_coverage: false
13-
php_code_sniffer:
14-
enabled: true
15-
config:
16-
standard: 'PSR2'
17-
filter:
18-
paths: [lib/*, tests/*]
19-
php_mess_detector:
20-
enabled: true
21-
config:
22-
ruleset: 'unusedcode,naming,design,controversial,codesize'
23-
php_cpd: true
24-
php_loc: true
25-
php_pdepend: true
26-
php_analyzer: true
27-
sensiolabs_security_checker: true
5+
build:
6+
image: default-jammy
7+
environment:
8+
php: 8.1
9+
nodes:
10+
analysis:
11+
tests:
12+
override:
13+
- php-scrutinizer-run
14+
- phpcs-run --standard=phpcs.ruleset.xml
2815

2916
checks:
30-
php:
31-
custom_coding_standard:
32-
ruleset_path: phpcs.ruleset.xml
17+
php: true

.travis.yml

Lines changed: 0 additions & 54 deletions
This file was deleted.

composer.json

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,22 @@
77
}
88
],
99
"require": {
10-
"composer/installers": "~1.0"
10+
"composer/installers": "~1.0 || ~2.0"
1111
},
1212
"require-dev": {
13-
"phpunit/phpunit": "^5.6",
14-
"brain/monkey": "1.*",
15-
"squizlabs/php_codesniffer": "~2.0"
13+
"phpunit/phpunit": "^9.6",
14+
"brain/monkey": "^2.6",
15+
"squizlabs/php_codesniffer": "^3.7"
1616
},
1717
"type": "wordpress-plugin",
1818
"autoload": {
1919
"psr-4": {
2020
"ACFComposer\\": "lib/ACFComposer"
2121
}
22+
},
23+
"config": {
24+
"allow-plugins": {
25+
"composer/installers": true
26+
}
2227
}
2328
}

0 commit comments

Comments
 (0)