Skip to content

Commit

Permalink
feat(composer): allow composers/installers version 2
Browse files Browse the repository at this point in the history
* 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 <netz@sascha-nos.com>
  • Loading branch information
domtra and Sascha Nos authored Dec 18, 2023
1 parent a63594f commit a7960ac
Show file tree
Hide file tree
Showing 13 changed files with 1,163 additions and 707 deletions.
41 changes: 41 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Run PHP tests

on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]

permissions:
contents: read

jobs:
run-test:
runs-on: ubuntu-22.04

strategy:
matrix:
php: [7.4, 8.0, 8.1, 8.2, 8.3]
# dependency-version: [prefer-lowest, prefer-stable]
dependency-version: [prefer-stable]

name: PHP${{ matrix.php }}_${{ matrix.dependency-version }}

steps:
- uses: actions/checkout@v3

- uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
coverage: xdebug

- name: Install dependencies
run: composer update --${{ matrix.dependency-version }} --prefer-dist --no-interaction --no-suggest

- name: Check coding style
run: vendor/bin/phpcs -s --standard=phpcs.ruleset.xml .

- name: Execute tests
run: vendor/bin/phpunit

# TODO: add codecoverage // vendor/bin/phpunit --coverage-clover logs/clover.xml
41 changes: 13 additions & 28 deletions .scrutinizer.yml
Original file line number Diff line number Diff line change
@@ -1,32 +1,17 @@
# language: php

filter:
paths: [lib/*]
excluded_paths: [tests/*, vendor/*]

before_commands:
- 'composer self-update'
- 'composer update --prefer-stable --prefer-source --no-interaction --no-scripts --no-progress --no-suggest'
excluded_paths:
- 'tests/'

tools:
php_code_coverage: false
php_code_sniffer:
enabled: true
config:
standard: 'PSR2'
filter:
paths: [lib/*, tests/*]
php_mess_detector:
enabled: true
config:
ruleset: 'unusedcode,naming,design,controversial,codesize'
php_cpd: true
php_loc: true
php_pdepend: true
php_analyzer: true
sensiolabs_security_checker: true
build:
image: default-jammy
environment:
php: 8.1
nodes:
analysis:
tests:
override:
- php-scrutinizer-run
- phpcs-run --standard=phpcs.ruleset.xml

checks:
php:
custom_coding_standard:
ruleset_path: phpcs.ruleset.xml
php: true
54 changes: 0 additions & 54 deletions .travis.yml

This file was deleted.

13 changes: 9 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,22 @@
}
],
"require": {
"composer/installers": "~1.0"
"composer/installers": "~1.0 || ~2.0"
},
"require-dev": {
"phpunit/phpunit": "^5.6",
"brain/monkey": "1.*",
"squizlabs/php_codesniffer": "~2.0"
"phpunit/phpunit": "^9.6",
"brain/monkey": "^2.6",
"squizlabs/php_codesniffer": "^3.7"
},
"type": "wordpress-plugin",
"autoload": {
"psr-4": {
"ACFComposer\\": "lib/ACFComposer"
}
},
"config": {
"allow-plugins": {
"composer/installers": true
}
}
}
Loading

0 comments on commit a7960ac

Please sign in to comment.