Skip to content

Commit

Permalink
Merge pull request #18 from alex-patterson-webdev/feature/2.0.0
Browse files Browse the repository at this point in the history
Feature/2.0.0
  • Loading branch information
alex-patterson-webdev committed Mar 18, 2022
2 parents cee31c6 + 997587d commit a71bd7c
Show file tree
Hide file tree
Showing 44 changed files with 2,354 additions and 1,590 deletions.
52 changes: 52 additions & 0 deletions .github/workflows/workflow.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: CI Pipeline

on:
push:
branches:
- master
- feature/*
pull_request:
branches:
- master
- feature/*

jobs:
test:
name: "Integration Test Suite"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: "Validate composer.json and composer.lock"
run: composer validate --strict

- name: "Cache Composer packages"
id: composer-cache
uses: actions/cache@v2
with:
path: vendor
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-php-
- name: "Install dependencies"
run: composer install --prefer-dist --no-progress --no-suggest

- name: "Check coding standards"
run: composer arp:check

- name: "Checking for solutions to code formatting"
run: composer arp:lint

- name: "Running static analysis checks"
run: composer arp:analyse

- name: "Running unit tests with code coverage"
run: composer arp:unit-test-with-coverage

- name: "Uploading code coverage report to Codecov"
uses: codecov/[email protected]
with:
files: ./test/coverage/clover.xml
fail_ci_if_error: true
verbose: true
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,6 @@ vendor/
composer.phar
.phpunit.result.cache
coverage.xml
clover.xml
clover.xml
.php_cs.cache
.php-cs-fixer.cache
24 changes: 24 additions & 0 deletions .php-cs-fixer.dist
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?php

declare(strict_types=1);

use PhpCsFixer\Finder;

$rules = [
'@PSR12' => true,
];

/** @var iterable<string> $finder */
$finder = Finder::create()
->exclude('node_modules')
->exclude('vendor')
->in([
__DIR__ . '/src/',
__DIR__ . '/test/unit/',
]);

return (new PhpCsFixer\Config())
->setRules($rules)
->setFinder($finder)
->setUsingCache(false);

9 changes: 6 additions & 3 deletions .scrutinizer.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,22 @@
build:
nodes:
php73:
environment:
php: 7.3
php74:
environment:
php: 7.4
analysis:
environment:
php: 7.4
project_setup:
override:
- 'true'
tests:
override:
- php-scrutinizer-run
- command: phpcs-run
- command: composer arp:unit-test-with-coverage
coverage:
file: test/coverage/clover.xml
format: clover
checks:
php: true
coding_style:
Expand Down
19 changes: 0 additions & 19 deletions .travis.yml

This file was deleted.

49 changes: 33 additions & 16 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "alex-patterson-webdev/event-dispatcher",
"version": "1.0.0",
"description": "Simple implementation of the PSR-14 event dispatcher",
"minimum-stability": "dev",
"prefer-stable": true,
"license": "MIT",
Expand All @@ -11,14 +11,18 @@
}
],
"require": {
"php": ">=7.3",
"php": ">=7.4 || >=8.0",
"psr/event-dispatcher": "^1"
},
"require-dev": {
"phpunit/phpunit": "^9.1",
"squizlabs/php_codesniffer": "3.*",
"phpmd/phpmd" : "@stable",
"friendsofphp/php-cs-fixer": "^2.16"
"phpspec/prophecy": "^1.15.0",
"phpunit/phpunit": "^9.5",
"squizlabs/php_codesniffer": "^3.6",
"phpstan/phpstan": "^1.4.8",
"friendsofphp/php-cs-fixer": "^3.6.0"
},
"provide": {
"psr/event-dispatcher-implementation": "1.0.0"
},
"autoload": {
"psr-4": {
Expand All @@ -27,21 +31,34 @@
},
"autoload-dev": {
"psr-4": {
"ArpTest\\EventDispatcher\\": "test/phpunit"
"ArpTest\\EventDispatcher\\": "test/unit/"
}
},
"repositories": [
{
"type": "composer",
"url": "http://dev.satis.local"
}
],
"scripts": {
"test": "php vendor/bin/phpunit --coverage-clover=coverage.xml"
"arp:test": [
"@arp:check",
"@arp:lint",
"@arp:analyse",
"@arp:unit-test-with-coverage"
],
"arp:test-dev": [
"@arp:check",
"@arp:lint",
"@arp:fix",
"@arp:analyse",
"@arp:unit-test"
],
"arp:check": "php vendor/bin/phpcs -s --standard=phpcs.xml --colors src/ test/",
"arp:lint": "php vendor/bin/php-cs-fixer fix --dry-run --verbose --config=.php-cs-fixer.dist",
"arp:fix": "php vendor/bin/php-cs-fixer fix --config=.php-cs-fixer.dist",
"arp:analyse": "php vendor/bin/phpstan analyse -c phpstan.neon --level=7",
"arp:unit-test": "php vendor/bin/phpunit",
"arp:unit-test-with-coverage": [
"@putenv XDEBUG_MODE=coverage",
"php vendor/bin/phpunit --coverage-clover=test/coverage/clover.xml"
]
},
"config": {
"secure-http": false,
"preferred-install": "dist",
"optimize-autoloader": true,
"sort-packages": true
}
Expand Down
Loading

0 comments on commit a71bd7c

Please sign in to comment.