Skip to content

Commit

Permalink
travis => github action
Browse files Browse the repository at this point in the history
  • Loading branch information
dominikzogg committed Feb 8, 2021
1 parent a260bf2 commit ffc1995
Show file tree
Hide file tree
Showing 33 changed files with 136 additions and 223 deletions.
52 changes: 52 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: CI

on:
push:

jobs:
php72-min:
name: PHP 7.2 (--prefer-lowest)
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v2
- name: composer test
uses: docker://chubbyphp/ci-php72:latest
env:
COMPOSER_ARGS: "--prefer-lowest"
COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
STRYKER_DASHBOARD_API_KEY: ${{ secrets.STRYKER_DASHBOARD_API_KEY }}
php72:
name: PHP 7.2
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v2
- name: composer test
uses: docker://chubbyphp/ci-php72:latest
env:
COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
STRYKER_DASHBOARD_API_KEY: ${{ secrets.STRYKER_DASHBOARD_API_KEY }}
php73-min:
name: PHP 7.3 (--prefer-lowest)
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v2
- name: composer test
uses: docker://chubbyphp/ci-php73:latest
env:
COMPOSER_ARGS: "--prefer-lowest"
COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
STRYKER_DASHBOARD_API_KEY: ${{ secrets.STRYKER_DASHBOARD_API_KEY }}
php73:
name: PHP 7.3
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v2
- name: composer test
uses: docker://chubbyphp/ci-php73:latest
env:
COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
STRYKER_DASHBOARD_API_KEY: ${{ secrets.STRYKER_DASHBOARD_API_KEY }}
9 changes: 7 additions & 2 deletions .php_cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,23 @@ return PhpCsFixer\Config::create()
'final_class' => true,
'is_null' => true,
'linebreak_after_opening_tag' => true,
'list_syntax' => true,
'list_syntax' => ['syntax' => 'short'],
'method_chaining_indentation' => false,
'no_php4_constructor' => true,
'ordered_interfaces' => true,
'php_unit_dedicate_assert' => true,
'php_unit_dedicate_assert_internal_type' => true,
'php_unit_dedicate_assert' => true,
'php_unit_expectation' => true,
'php_unit_mock' => true,
'php_unit_namespaced' => true,
'php_unit_no_expectation_annotation' => true,
'phpdoc_to_comment' => false,
'single_line_throw' => false,
'static_lambda' => true,
'ternary_to_null_coalescing' => true,
'use_arrow_functions' => false,
'void_return' => true,
'yoda_style' => true,
])
->setRiskyAllowed(true)
->setFinder($finder)
Expand Down
31 changes: 0 additions & 31 deletions .travis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# chubbyphp-framework

[![Build Status](https://api.travis-ci.org/chubbyphp/chubbyphp-framework.png?branch=master)](https://travis-ci.org/chubbyphp/chubbyphp-framework)
[![CI](https://github.com/chubbyphp/chubbyphp-framework/workflows/CI/badge.svg?branch=master)](https://github.com/chubbyphp/chubbyphp-framework/actions?query=workflow%3ACI)
[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/chubbyphp/chubbyphp-framework/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/chubbyphp/chubbyphp-framework/?branch=master)
[![Code Coverage](https://scrutinizer-ci.com/g/chubbyphp/chubbyphp-framework/badges/coverage.png?b=master)](https://scrutinizer-ci.com/g/chubbyphp/chubbyphp-framework/?branch=master)
[![Total Downloads](https://poser.pugx.org/chubbyphp/chubbyphp-framework/downloads.png)](https://packagist.org/packages/chubbyphp/chubbyphp-framework)
Expand Down
29 changes: 22 additions & 7 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,17 +32,17 @@
},
"require-dev": {
"aura/router": "^3.1",
"chubbyphp/chubbyphp-mock": "^1.4",
"friendsofphp/php-cs-fixer": "^2.15.1",
"chubbyphp/chubbyphp-mock": "^1.5.1",
"friendsofphp/php-cs-fixer": "^2.18.2",
"guzzlehttp/psr7": "^1.4.2",
"http-interop/http-factory-guzzle": "^1.0",
"infection/infection": "^0.13.4",
"infection/infection": "^0.17.7",
"nikic/fast-route": "^1.3",
"nunomaduro/phpinsights": "^1.7",
"nyholm/psr7": "^1.0",
"phploc/phploc": "^5.0",
"phpstan/phpstan": "^0.11.12",
"phpunit/phpunit": "^8.3.3",
"php-coveralls/php-coveralls": "^2.4.3",
"phploc/phploc": "^5.0|^6.0.2",
"phpstan/phpstan": "^0.12.74",
"phpunit/phpunit": "^8.5.14",
"slim/psr7": "^0.5",
"zendframework/zend-diactoros": "^2.0"
},
Expand All @@ -56,5 +56,20 @@
"branch-alias": {
"dev-master": "1.2-dev"
}
},
"scripts": {
"fix:cs": "mkdir -p build && vendor/bin/php-cs-fixer fix --cache-file=build/phpcs.cache",
"test": [
"@test:phpunit",
"@test:infection",
"@test:static-analysis",
"@test:loc",
"@test:cs"
],
"test:cs": "mkdir -p build && vendor/bin/php-cs-fixer fix --dry-run --stop-on-violation --cache-file=build/phpcs.cache",
"test:infection": "vendor/bin/infection --threads=$(nproc) --min-msi=98 --min-covered-msi=98 --verbose",
"test:loc": "vendor/bin/phploc src --verbose",
"test:phpunit": "vendor/bin/phpunit --coverage-text --coverage-clover=build/phpunit/clover.xml --coverage-html=build/phpunit/coverage-html --coverage-xml=build/phpunit/coverage-xml --log-junit=build/phpunit/junit.xml --cache-result-file=build/phpunit/result.cache",
"test:static-analysis": "vendor/bin/phpstan analyse"
}
}
2 changes: 1 addition & 1 deletion infection.json.dist → infection.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@
},
"timeout": 10,
"logs": {
"text": "infectionlog.txt"
"text": "build/infectionlog.txt"
}
}
57 changes: 0 additions & 57 deletions phpinsights.php

This file was deleted.

5 changes: 1 addition & 4 deletions src/Application.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,7 @@ final class Application implements RequestHandlerInterface
private $middlewares;

/**
* @param RouterInterface $router
* @param MiddlewareDispatcherInterface $middlewareDispatcher
* @param ExceptionHandlerInterface $exceptionHandler
* @param array<MiddlewareInterface> $middlewares
* @param array<MiddlewareInterface> $middlewares
*/
public function __construct(
RouterInterface $router,
Expand Down
2 changes: 0 additions & 2 deletions src/ExceptionHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,6 @@ public function createExceptionResponse(ServerRequestInterface $request, \Throwa

/**
* @param array<array<string, string>> $exceptionsData
*
* @return string
*/
private function addDebugToHtml(array $exceptionsData): string
{
Expand Down
2 changes: 0 additions & 2 deletions src/ExceptionHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@
final class ExceptionHelper
{
/**
* @param \Throwable $exception
*
* @return array<int, array<string, mixed>>
*/
public static function toArray(\Throwable $exception): array
Expand Down
4 changes: 0 additions & 4 deletions src/Middleware/MiddlewareDispatcher.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,6 @@ final class MiddlewareDispatcher implements MiddlewareDispatcherInterface
{
/**
* @param array<MiddlewareInterface> $middlewares
* @param RequestHandlerInterface $handler
* @param ServerRequestInterface $request
*
* @return ResponseInterface
*/
public function dispatch(
array $middlewares,
Expand Down
4 changes: 0 additions & 4 deletions src/Middleware/MiddlewareDispatcherInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,6 @@ interface MiddlewareDispatcherInterface
{
/**
* @param array<MiddlewareInterface> $middlewares
* @param RequestHandlerInterface $handler
* @param ServerRequestInterface $request
*
* @return ResponseInterface
*/
public function dispatch(
array $middlewares,
Expand Down
14 changes: 2 additions & 12 deletions src/Router/AuraRouter.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ final class AuraRouter implements RouterInterface

/**
* @param array<RouteInterface> $routes
* @param string $basePath
*/
public function __construct(array $routes, string $basePath = '')
{
Expand Down Expand Up @@ -71,14 +70,10 @@ public function match(ServerRequestInterface $request): RouteInterface
}

/**
* @param ServerRequestInterface $request
* @param string $name
* @param array<string, string> $attributes
* @param array<string, mixed> $queryParams
* @param array<string, string> $attributes
* @param array<string, mixed> $queryParams
*
* @throws RouterException
*
* @return string
*/
public function generateUrl(
ServerRequestInterface $request,
Expand All @@ -93,13 +88,10 @@ public function generateUrl(
}

/**
* @param string $name
* @param array<string, string> $attributes
* @param array<string, mixed> $queryParams
*
* @throws RouterException
*
* @return string
*/
public function generatePath(string $name, array $attributes = [], array $queryParams = []): string
{
Expand Down Expand Up @@ -133,8 +125,6 @@ private function getRoutesByName(array $routes): array

/**
* @param array<RouteInterface> $routes
*
* @return RouterContainer
*/
private function getRouterContainer(array $routes): RouterContainer
{
Expand Down
20 changes: 2 additions & 18 deletions src/Router/FastRouteRouter.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,6 @@ final class FastRouteRouter implements RouterInterface

/**
* @param array<RouteInterface> $routes
* @param string|null $cacheFile
* @param string $basePath
*/
public function __construct(array $routes, ?string $cacheFile = null, string $basePath = '')
{
Expand Down Expand Up @@ -71,14 +69,10 @@ public function match(ServerRequestInterface $request): RouteInterface
}

/**
* @param ServerRequestInterface $request
* @param string $name
* @param array<string, string> $attributes
* @param array<string, mixed> $queryParams
* @param array<string, string> $attributes
* @param array<string, mixed> $queryParams
*
* @throws RouterException
*
* @return string
*/
public function generateUrl(
ServerRequestInterface $request,
Expand All @@ -93,13 +87,10 @@ public function generateUrl(
}

/**
* @param string $name
* @param array<string, string> $attributes
* @param array<string, mixed> $queryParams
*
* @throws RouterException
*
* @return string
*/
public function generatePath(string $name, array $attributes = [], array $queryParams = []): string
{
Expand Down Expand Up @@ -144,9 +135,6 @@ private function getRoutesByName(array $routes): array

/**
* @param array<RouteInterface> $routes
* @param string|null $cacheFile
*
* @return Dispatcher
*/
private function getDispatcher(array $routes, ?string $cacheFile = null): Dispatcher
{
Expand All @@ -166,8 +154,6 @@ private function getDispatcher(array $routes, ?string $cacheFile = null): Dispat

/**
* @param array<RouteInterface> $routes
*
* @return RouteCollector
*/
private function getRouteCollector(array $routes): RouteCollector
{
Expand All @@ -191,8 +177,6 @@ private function getRoute(string $name): RouteInterface
/**
* @param array<int, array<int, array|string>> $routePartSets
* @param array<string> $attributes
*
* @return int
*/
private function getRouteIndex(array $routePartSets, array $attributes): int
{
Expand Down
Loading

0 comments on commit ffc1995

Please sign in to comment.