Skip to content

Commit

Permalink
initial skeleton
Browse files Browse the repository at this point in the history
  • Loading branch information
rieschl committed Sep 23, 2020
0 parents commit e202e83
Show file tree
Hide file tree
Showing 11 changed files with 192 additions and 0 deletions.
52 changes: 52 additions & 0 deletions .github/workflows/checks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Check Build

on: [pull_request]

jobs:
build:

runs-on: ubuntu-latest
container:
image: eventjet/checks-7.4:latest

steps:
- name: Checkout
uses: actions/checkout@v2

- name: Prepare environment
run: |
mkdir -p /root/.ssh
ssh-keyscan -t rsa github.com >> /root/.ssh/known_hosts
- name: Composer Cache
uses: actions/cache@v1
with:
path: $(composer config cache-files-dir)
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
restore-keys: |
${{ runner.os }}-composer-
- name: Install dependencies
run: |
composer install --no-progress --no-suggest --no-interaction > /dev/null
- name: Static analysis
run: |
composer check-deps
composer cs-check
composer phpstan -- --no-progress
composer psalm
- name: Tests
run: |
vendor/bin/phpunit --coverage-clover=coverage.xml --stop-on-failure
composer run --timeout=0 infection
- name: Monitor coverage
if: github.event_name == 'pull_request'
uses: slavcodev/coverage-monitor-action@1.1.0
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
clover_file: "coverage.xml"
threshold_alert: 99
threshold_warning: 99
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/vendor/
/composer.lock
/infection-log.txt
.phpunit.result.cache
20 changes: 20 additions & 0 deletions .scrutinizer.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
build:
nodes:
ej_default:
dependencies:
before:
- pecl install pcov
environment:
php:
version: "7.4"
tests:
override:
- 'composer check-deps'
- 'composer cs-check'
- 'composer psalm'
- 'composer phpstan'
- command: 'php -d pcov.enabled=1 vendor/bin/phpunit --coverage-clover=coverage'
coverage:
file: 'coverage'
format: 'php-clover'
- 'composer run --timeout=0 infection-xdebug'
54 changes: 54 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
{
"name": "eventjet/psr-container-doctrine-odm",
"type": "library",
"description": "Doctrine ODM factory for PSR-11 container",
"license": "MIT",
"require": {
"php": "^7.4"
},
"require-dev": {
"eventjet/coding-standard": "^3.1",
"infection/infection": "^0.17.0",
"maglnet/composer-require-checker": "^2.1",
"phpstan/extension-installer": "^1.0",
"phpstan/phpstan": "^0.12.32",
"phpstan/phpstan-phpunit": "^0.12.11",
"phpstan/phpstan-strict-rules": "^0.12.2",
"phpunit/phpunit": "^9.3",
"thecodingmachine/phpstan-safe-rule": "^1.0",
"vimeo/psalm": "^3.11"
},
"config": {
"sort-packages": true
},
"autoload": {
"psr-4": {
"Eventjet\\PsrContainerDoctrineOdm\\": "src"
}
},
"autoload-dev": {
"psr-4": {
"Eventjet\\Test\\Functional\\PsrContainerDoctrineOdm\\": "tests/functional",
"Eventjet\\Test\\Unit\\PsrContainerDoctrineOdm\\": "tests/unit"
}
},
"minimum-stability": "stable",
"scripts": {
"check": [
"@check-deps",
"@cs-check",
"@psalm",
"@phpstan",
"@phpunit",
"@infection"
],
"check-deps": "vendor/bin/composer-require-checker",
"cs-check": "vendor/bin/phpcs",
"cs-fix": "vendor/bin/phpcbf",
"infection": "vendor/bin/infection --threads=4",
"infection-xdebug": "@composer run --timeout=0 infection -- --initial-tests-php-options='-d zend_extension=xdebug.so'",
"phpstan": "vendor/bin/phpstan analyse",
"phpunit": "vendor/bin/phpunit",
"psalm": "vendor/bin/psalm"
}
}
13 changes: 13 additions & 0 deletions infection.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"timeout": 10,
"source": {
"directories": [
"src"
]
},
"logs": {
"text": "infection-log.txt"
},
"minMsi": 100,
"minCoveredMsi": 100
}
6 changes: 6 additions & 0 deletions phpcs.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0"?>
<ruleset name="Eventjet coding standard">
<rule ref="EventjetStrict"/>
<file>src</file>
<file>tests</file>
</ruleset>
5 changes: 5 additions & 0 deletions phpstan.neon
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
parameters:
level: max
paths:
- src/
- tests/
22 changes: 22 additions & 0 deletions phpunit.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<phpunit
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="vendor/phpunit/phpunit/phpunit.xsd"
bootstrap="vendor/autoload.php"
beStrictAboutChangesToGlobalState="true"
beStrictAboutOutputDuringTests="true"
verbose="true"
>
<testsuites>
<testsuite name="Eventjet\PsrContainerDoctrineOdm\Unit">
<directory>tests/unit</directory>
</testsuite>
<testsuite name="Eventjet\PsrContainerDoctrineOdm\Functional">
<directory>tests/functional</directory>
</testsuite>
</testsuites>
<coverage>
<include>
<directory>src</directory>
</include>
</coverage>
</phpunit>
16 changes: 16 additions & 0 deletions psalm.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?xml version="1.0"?>
<psalm
strictBinaryOperands="true"
errorLevel="1"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="https://getpsalm.org/schema/config"
xsi:schemaLocation="https://getpsalm.org/schema/config vendor/vimeo/psalm/config.xsd"
>
<projectFiles>
<directory name="src"/>
<directory name="tests"/>
<ignoreFiles>
<directory name="vendor"/>
</ignoreFiles>
</projectFiles>
</psalm>
Empty file added tests/functional/.gitignore
Empty file.
Empty file added tests/unit/.gitignore
Empty file.

0 comments on commit e202e83

Please sign in to comment.