Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@
/phpcs.xml.dist export-ignore
/phpunit.xml.dist export-ignore
/tests export-ignore
/vendor-bin export-ignore
27 changes: 23 additions & 4 deletions .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ jobs:
strategy:
matrix:
php-version:
- "7.1"
- "7.2"
- "7.3"
- "7.4"
Expand All @@ -33,12 +34,15 @@ jobs:
uses: "actions/cache@v1"
with:
path: "~/.composer/cache"
key: "php-${{ matrix.php-version }}-composer-locked-${{ hashFiles('composer.lock') }}"
key: "php-${{ matrix.php-version }}-composer-locked-${{ hashFiles('composer.lock') }}-${{ hashFiles('vendor-bin/*/composer.lock') }}"
restore-keys: "php-${{ matrix.php-version }}-composer-locked-"

- name: "Install dependencies with composer"
run: "composer install --no-interaction --no-progress --no-suggest"

- name: "Install phpunit with composer"
run: "composer bin phpunit install --no-interaction --no-progress --no-suggest"

- name: "Test fixes"
run: "vendor/bin/phpunit --coverage-text"

Expand Down Expand Up @@ -67,12 +71,18 @@ jobs:
uses: "actions/cache@v1"
with:
path: "~/.composer/cache"
key: "php-${{ matrix.php-version }}-composer-locked-${{ hashFiles('composer.lock') }}"
key: "php-${{ matrix.php-version }}-composer-locked-${{ hashFiles('composer.lock') }}-${{ hashFiles('vendor-bin/*/composer.lock') }}"
restore-keys: "php-${{ matrix.php-version }}-composer-locked-"

- name: "Install dependencies with composer"
run: "composer install --no-interaction --no-progress --no-suggest"

- name: "Install phpunit with composer"
run: "composer bin phpunit install --no-interaction --no-progress --no-suggest"

- name: "Install phpstan with composer"
run: "composer bin phpstan install --no-interaction --no-progress --no-suggest"

- name: "Run a static analysis with phpstan/phpstan"
run: "vendor/bin/phpstan analyse --error-format=checkstyle | cs2pr"

Expand Down Expand Up @@ -100,12 +110,18 @@ jobs:
uses: "actions/cache@v1"
with:
path: "~/.composer/cache"
key: "php-${{ matrix.php-version }}-composer-locked-${{ hashFiles('composer.lock') }}"
key: "php-${{ matrix.php-version }}-composer-locked-${{ hashFiles('composer.lock') }}-${{ hashFiles('vendor-bin/*/composer.lock') }}"
restore-keys: "php-${{ matrix.php-version }}-composer-locked-"

- name: "Install dependencies with composer"
run: "composer install --no-interaction --no-progress --no-suggest"

- name: "Install phpunit with composer"
run: "composer bin phpunit install --no-interaction --no-progress --no-suggest"

- name: "Install psalm with composer"
run: "composer bin all install --no-interaction --no-progress --no-suggest"

- name: "Run a static analysis with vimeo/psalm"
run: "vendor/bin/psalm --show-info=false --stats --output-format=github --threads=4"

Expand Down Expand Up @@ -133,12 +149,15 @@ jobs:
uses: "actions/cache@v1"
with:
path: "~/.composer/cache"
key: "php-${{ matrix.php-version }}-composer-locked-${{ hashFiles('composer.lock') }}"
key: "php-${{ matrix.php-version }}-composer-locked-${{ hashFiles('composer.lock') }}-${{ hashFiles('vendor-bin/*/composer.lock') }}"
restore-keys: "php-${{ matrix.php-version }}-composer-locked-"

- name: "Install dependencies with composer"
run: "composer install --no-interaction --no-progress --no-suggest"

- name: "Install phpcs with composer"
run: "composer bin all install --no-interaction --no-progress --no-suggest"

# Remove -q when updating to phpcs v4
- name: "Run squizlabs/php_codesniffer"
run: "vendor/bin/phpcs -q --no-colors --report=checkstyle | cs2pr"
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/.phpunit.result.cache
/.phpcs-cache
vendor/
vendor-bin/**/vendor
24 changes: 24 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# CONTRIBUTING

Make sure you read our [contributing guide][contributing guide on the website].

[contributing guide on the website]:https://www.doctrine-project.org/contribute

## Installing dependencies

```shell
composer install
composer bin all install
```

## Running checks locally

Here is a script to run all checks, you can use it as a git hook:

```shell
#!/bin/bash -eu
vendor/bin/phpunit --testdox
vendor/bin/psalm
echo '' | vendor/bin/phpcs
vendor/bin/phpstan analyze
```
9 changes: 3 additions & 6 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,10 @@
"license": "MIT",
"type": "library",
"require": {
"php": "^7.2"
"php": "^7.1"
},
"require-dev": {
"doctrine/coding-standard": "^7.0",
"phpstan/phpstan": "^0.12.18",
"phpunit/phpunit": "^8.0",
"vimeo/psalm": "^3.10"
"bamarni/composer-bin-plugin": "^1.4"
},
"authors": [
{
Expand All @@ -34,7 +31,7 @@
"config": {
"sort-packages": true,
"platform": {
"php": "7.2.0"
"php": "7.1.0"
}
},
"extra": {
Expand Down
Loading