Skip to content
This repository has been archived by the owner on Oct 14, 2022. It is now read-only.

Commit

Permalink
Bumped to PHP 7.4, dropped Travis in favour of Github Actions
Browse files Browse the repository at this point in the history
  • Loading branch information
WyriHaximus committed Mar 17, 2020
1 parent bb4def0 commit 7a09a9b
Show file tree
Hide file tree
Showing 17 changed files with 1,762 additions and 2,748 deletions.
1 change: 1 addition & 0 deletions .github/FUNDING.yml
@@ -0,0 +1 @@
github: WyriHaximus
47 changes: 47 additions & 0 deletions .github/workflows/ci.yml
@@ -0,0 +1,47 @@
name: Continuous Integration
on:
push:
pull_request:
jobs:
composer-install:
strategy:
matrix:
php: [7.4]
composer: [lowest, current, highest]
runs-on: ubuntu-latest
container:
image: wyrihaximusnet/php:${{ matrix.php }}-zts-alpine3.11-dev-root
steps:
- uses: actions/checkout@v1
- name: Cache composer packages
uses: actions/cache@v1
with:
path: ./vendor/
key: ${{ matrix.composer }}-${{ matrix.php }}-${{ hashFiles('**/composer.lock') }}
- name: Install Dependencies
run: composer update --prefer-lowest --no-progress --ansi --no-interaction --prefer-dist
if: matrix.composer == 'lowest'
- name: Install Dependencies
run: composer install --ansi --no-progress --no-interaction --prefer-dist
if: matrix.composer == 'current'
- name: Install Dependencies
run: composer update --ansi --no-progress --no-interaction --prefer-dist
if: matrix.composer == 'highest'
qa:
strategy:
matrix:
php: [7.4]
composer: [lowest, current, highest]
qa: [lint, cs, stan, psalm, unit-ci, infection, composer-require-checker, composer-unused]
needs: composer-install
runs-on: ubuntu-latest
container:
image: wyrihaximusnet/php:${{ matrix.php }}-zts-alpine3.11-dev-root
steps:
- uses: actions/checkout@v1
- name: Cache composer packages
uses: actions/cache@v1
with:
path: ./vendor/
key: ${{ matrix.composer }}-${{ matrix.php }}-${{ hashFiles('**/composer.lock') }}
- run: make ${{ matrix.qa }}
73 changes: 7 additions & 66 deletions .scrutinizer.yml
@@ -1,68 +1,9 @@
filter:
paths: [src/*]
excluded_paths: [examples/*, tests/*]
tools:
external_code_coverage: true
php_analyzer: true
php_hhvm: true
php_sim: true
php_pdepend: true
sensiolabs_security_checker: true
php_changetracking: true
php_code_sniffer:
enabled: true
config:
tab_width: 0
encoding: utf8
ruleset: ~
standard: "PSR2"
php_cs_fixer:
enabled: true
config:
level: psr2
php_mess_detector:
enabled: true
config:
ruleset: ~
code_size_rules:
cyclomatic_complexity: true
npath_complexity: true
excessive_method_length: true
excessive_class_length: true
excessive_parameter_list: true
excessive_public_count: true
too_many_fields: true
too_many_methods: true
excessive_class_complexity: true
design_rules:
exit_expression: true
eval_expression: true
goto_statement: true
number_of_class_children: true
depth_of_inheritance: true
coupling_between_objects: true
unused_code_rules:
unused_private_field: true
unused_local_variable: true
unused_private_method: true
unused_formal_parameter: true
naming_rules:
short_variable:
minimum: 3
long_variable:
maximum: 20
short_method:
minimum: 3
constructor_conflict: true
constant_naming: true
boolean_method_name: true
controversial_rules:
superglobals: true
camel_case_class_name: true
camel_case_property_name: true
camel_case_method_name: true
camel_case_parameter_name: true
camel_case_variable_name: true
checks:
php:
code_rating: true
excluded_paths: [tests/*]
build:
nodes:
analysis:
tests:
override:
- php-scrutinizer-run --enable-security-analysis
55 changes: 0 additions & 55 deletions .travis.yml

This file was deleted.

53 changes: 33 additions & 20 deletions Makefile
@@ -1,32 +1,45 @@
all:
composer run-script qa-all --timeout=0
# set all to phony
SHELL=bash

all-coverage:
composer run-script qa-all-coverage --timeout=0
.PHONY: *

ci:
composer run-script qa-ci --timeout=0
ifneq ("$(wildcard /.dockerenv)","")
DOCKER_RUN=
else
DOCKER_RUN=docker run --rm -it \
-v `pwd`:`pwd` \
-w `pwd` \
"wyrihaximusnet/php:7.4-zts-alpine3.11-dev"
endif

ci-extended:
composer run-script qa-ci-extended --timeout=0
all: lint cs-fix cs stan psalm unit infection composer-require-checker composer-unused

contrib:
composer run-script qa-contrib --timeout=0

init:
composer ensure-installed
lint:
$(DOCKER_RUN) vendor/bin/parallel-lint --exclude vendor .

cs:
composer cs
$(DOCKER_RUN) vendor/bin/phpcs --parallel=$(nproc)

cs-fix:
composer cs-fix
$(DOCKER_RUN) vendor/bin/phpcbf --parallel=$(nproc)

stan:
$(DOCKER_RUN) vendor/bin/phpstan analyse src tests --level max --ansi -c phpstan.neon

psalm:
$(DOCKER_RUN) vendor/bin/psalm --threads=$(nproc) --shepherd --stats

unit:
composer run-script unit --timeout=0
$(DOCKER_RUN) vendor/bin/phpunit --colors=always -c phpunit.xml.dist --coverage-text --coverage-html covHtml --coverage-clover ./build/logs/clover.xml

unit-ci: unit
if [ -f ./build/logs/clover.xml ]; then wget https://scrutinizer-ci.com/ocular.phar && sleep 3 && php ocular.phar code-coverage:upload --format=php-clover ./build/logs/clover.xml; fi

infection:
$(DOCKER_RUN) vendor/bin/infection --ansi --min-msi=100 --min-covered-msi=100 --threads=$(nproc)

unit-coverage:
composer run-script unit-coverage --timeout=0
composer-require-checker:
$(DOCKER_RUN) vendor/bin/composer-require-checker --ignore-parse-errors --ansi -vvv --config-file=composer-require-checker.json

ci-coverage: init
composer ci-coverage
composer-unused:
$(DOCKER_RUN) composer unused --ansi
18 changes: 18 additions & 0 deletions composer-require-checker.json
@@ -0,0 +1,18 @@
{
"symbol-whitelist" : [
"null", "true", "false",
"static", "self", "parent",
"array", "string", "int", "float", "bool", "iterable", "callable", "void", "object",
"Safe\\ksort"
],
"php-core-extensions" : [
"Core",
"date",
"pcre",
"Phar",
"Reflection",
"SPL",
"standard"
],
"scan-files" : []
}
94 changes: 27 additions & 67 deletions composer.json
Expand Up @@ -10,36 +10,28 @@
}
],
"require": {
"php": "^7.3",
"php": "^7.4",
"api-clients/rx": "^2.2",
"react-inspector/metric": "dev-master",
"react-inspector/metric": "^1.0",
"react/event-loop": "^1.1",
"reactivex/rxphp": "^2.0",
"thecodingmachine/safe": "^1.0",
"wyrihaximus/ticking-promise": "^1.6"
},
"require-dev": {
"wyrihaximus/async-test-utilities": "^1.0"
},
"autoload": {
"psr-4": {
"ReactInspector\\": "src/"
}
},
"autoload-dev": {
"psr-4": {
"ReactInspector\\Tests\\": "tests/"
}
"wyrihaximus/async-test-utilities": "^2.0"
},
"suggest": {
"react-inspector/bunny": "Measure what is going through fread/fwrite calls from bunny/bunny",
"react-inspector/event-loop": "Measure what is going through the event loop",
"react-inspector/memory-usage": "Message the memory usage of the current PHP process",
"react-inspector/stream": "Measure what is going through fread/fwrite calls from react/stream",
"react-inspector/bunny": "Measure what is going through fread/fwrite calls from bunny/bunny"
"react-inspector/stream": "Measure what is going through fread/fwrite calls from react/stream"
},
"config": {
"sort-packages": true,
"platform": {
"php": "7.3"
}
"php": "7.4"
},
"sort-packages": true
},
"extra": {
"react-inspector": {
Expand All @@ -54,59 +46,27 @@
"inspector.metrics"
]
}
},
"unused": [
"php"
]
},
"autoload": {
"psr-4": {
"ReactInspector\\": "src/"
}
},
"autoload-dev": {
"psr-4": {
"ReactInspector\\Tests\\": "tests/"
}
},
"scripts": {
"ensure-installed": "composer install --ansi -n -q",
"cs": [
"@ensure-installed",
"php-cs-fixer fix --config=.php_cs --ansi --dry-run --diff --verbose --allow-risky=yes --show-progress=estimating"
],
"cs-fix": [
"@ensure-installed",
"php-cs-fixer fix --config=.php_cs --ansi --verbose --allow-risky=yes --show-progress=estimating"
],
"unit": [
"@ensure-installed",
"phpunit --colors=always -c phpunit.xml.dist"
],
"unit-coverage": [
"@ensure-installed",
"phpunit --colors=always -c phpunit.xml.dist --coverage-text --coverage-html covHtml --coverage-clover ./build/logs/clover.xml"
],
"lint-php": [
"@ensure-installed",
"parallel-lint --exclude vendor ."
],
"qa-all": [
"@lint-php",
"@cs",
"@unit"
],
"qa-all-coverage": [
"@lint-php",
"@cs",
"@unit-coverage"
],
"qa-windows": [
"@lint-php",
"@cs",
"@unit"
],
"qa-ci": [
"@unit"
],
"qa-ci-extended": [
"@qa-all-coverage"
],
"qa-ci-windows": [
"@qa-windows"
],
"qa-contrib": [
"@qa-all"
"post-install-cmd": [
"composer normalize"
],
"ci-coverage": [
"if [ -f ./build/logs/clover.xml ]; then wget https://scrutinizer-ci.com/ocular.phar && php ocular.phar code-coverage:upload --format=php-clover ./build/logs/clover.xml; fi"
"post-update-cmd": [
"composer normalize"
]
}
}

0 comments on commit 7a09a9b

Please sign in to comment.