Skip to content

Commit

Permalink
Big 💥
Browse files Browse the repository at this point in the history
  • Loading branch information
simPod committed Mar 12, 2020
0 parents commit 7a7574b
Show file tree
Hide file tree
Showing 68 changed files with 3,064 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .coveralls.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
coverage_clover: /tmp/coverage/*.xml
json_path: /tmp/coverage/coverage.json
11 changes: 11 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Set the default behavior, in case people don't have core.autocrlf set.
* text eol=lf
/.coveralls.yml export-ignore
/.gitattributes export-ignore
/.gitignore export-ignore
/.github export-ignore
/infection.json.dist export-ignore
/phpcs.xml.dist export-ignore
/phpstan.neon.dist export-ignore
/phpunit.xml.dist export-ignore
/tests export-ignore
157 changes: 157 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,157 @@
name: Continuous Integration

on:
push:
branches:
tags:
pull_request:

jobs:
coding-standard:
runs-on: ubuntu-18.04
name: Coding Standard

steps:
- uses: actions/checkout@v2

- name: Install PHP
uses: shivammathur/setup-php@1.7.0
with:
php-version: 7.3
coverage: none
extensions: json, mbstring

- name: Get Composer Cache Directory
id: composer-cache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"

- name: Cache dependencies
uses: actions/cache@v1
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('composer.json') }}
restore-keys: ${{ runner.os }}-composer-

- name: Install Dependencies
run: composer install ${DEPENDENCIES}

- name: Coding Standard
run: vendor/bin/phpcs

phpstan:
runs-on: ubuntu-18.04
name: PHPStan

steps:
- uses: actions/checkout@v2

- name: Install PHP
uses: shivammathur/setup-php@1.7.0
with:
php-version: 7.3
coverage: none
extensions: json, mbstring

- name: Get Composer Cache Directory
id: composer-cache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"

- name: Cache dependencies
uses: actions/cache@v1
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('composer.json') }}
restore-keys: ${{ runner.os }}-composer-

- name: Install Dependencies
run: composer install ${DEPENDENCIES}

- name: PHPStan
run: vendor/bin/phpstan analyse

coverage:
runs-on: ubuntu-18.04
name: Code Coverage

steps:
- uses: actions/checkout@v2
with:
ref: ${{ github.ref }}

- name: Build the docker-compose stack
run: docker-compose -f tests/docker-compose.yaml up -d

- name: Install PHP
uses: shivammathur/setup-php@1.7.0
with:
php-version: 7.3
coverage: pcov
extensions: json, mbstring

- name: Get Composer Cache Directory
id: composer-cache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"

- name: Cache dependencies
uses: actions/cache@v1
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('composer.json') }}
restore-keys: ${{ runner.os }}-composer-

- name: Install Dependencies
run: composer install ${DEPENDENCIES}

- name: Code coverage
run: |
./vendor/bin/phpunit --coverage-clover /tmp/coverage/clover.xml
- name: Report to Coveralls
env:
COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COVERALLS_RUN_LOCALLY: 1
run: vendor/bin/php-coveralls --verbose

build:
runs-on: ubuntu-18.04
strategy:
matrix:
php: [7.3, 7.4]
env: [
'DEPENDENCIES=--prefer-lowest',
'',
]
name: PHP ${{ matrix.php }} Test ${{ matrix.env }}

steps:
- uses: actions/checkout@v2

- name: Build the docker-compose stack
run: docker-compose -f tests/docker-compose.yaml up -d

- name: Install PHP
uses: shivammathur/setup-php@1.7.0
with:
php-version: ${{ matrix.php }}
coverage: none
extensions: json, mbstring
- name: Get Composer Cache Directory
id: composer-cache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"

- name: Cache dependencies
uses: actions/cache@v1
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('composer.json') }}
restore-keys: ${{ runner.os }}-composer-

- name: Install Dependencies
run: composer install ${DEPENDENCIES}

- name: Run unit tests
run: |
export $ENV
./vendor/bin/phpunit --group default,ReactPromise
env:
ENV: ${{ matrix.env}}
26 changes: 26 additions & 0 deletions .github/workflows/infection.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Run Infection

on: [push, pull_request]

jobs:
build:
runs-on: ubuntu-18.04

steps:
- uses: actions/checkout@v2

- name: Build the docker-compose stack
run: docker-compose -f tests/docker-compose.yaml up -d

- name: Install PHP
uses: shivammathur/setup-php@1.7.0
with:
php-version: 7.3
coverage: xdebug
extensions: json, mbstring

- name: Install Dependencies
run: composer install --prefer-dist --no-progress --no-suggest

- name: Run Infection
run: vendor/bin/infection --min-msi=84 --min-covered-msi=90 --log-verbosity=none -s
16 changes: 16 additions & 0 deletions .github/workflows/shepherd.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: Run Shepherd

on: [push, pull_request]

jobs:
build:
runs-on: ubuntu-18.04

steps:
- uses: actions/checkout@v2

- name: Install dependencies
run: composer install --prefer-dist --no-progress --no-suggest

- name: Run Psalm
run: vendor/bin/psalm --threads=4 --output-format=github --shepherd
9 changes: 9 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
/.phpunit.result.cache
/.phpunit.xml
/.phpcs-cache
/infection.json
/infection-log.txt
/phpcs.xml
/phpstan.neon
/composer.lock
/vendor/
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2020 Šimon Podlipský

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Loading

0 comments on commit 7a7574b

Please sign in to comment.