Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhancement: Synchronize with ergebnis/php-library-template #136

Merged
merged 1 commit into from
Jun 25, 2020
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
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
/.github/ export-ignore
/test/ export-ignore
/tools/ export-ignore
/.editorconfig export-ignore
/.gitattributes export-ignore
/.gitignore export-ignore
/.php_cs export-ignore
/infection.json export-ignore
/Makefile export-ignore
/phive.xml export-ignore
/phpstan-baseline.neon export-ignore
/phpstan.neon export-ignore
/psalm-baseline.xml export-ignore
Expand Down
18 changes: 9 additions & 9 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ We are using [`yamllint`](https://github.com/adrienverge/yamllint) to enforce co

If you do not have `yamllint` installed yet, run

```
```sh
$ brew install yamllint
```

Expand All @@ -28,7 +28,7 @@ We are using [`friendsofphp/php-cs-fixer`](https://github.com/FriendsOfPHP/PHP-C

Run

```
```sh
$ make coding-standards
```

Expand All @@ -40,7 +40,7 @@ We are using [`maglnet/composer-require-checker`](https://github.com/maglnet/Com

Run

```
```sh
$ make dependency-analysis
```

Expand All @@ -52,7 +52,7 @@ We are using [`phpstan/phpstan`](https://github.com/phpstan/phpstan) and [`vimeo

Run

```
```sh
$ make static-code-analysis
```

Expand All @@ -62,7 +62,7 @@ We are also using the baseline features of [`phpstan/phpstan`](https://medium.co

Run

```
```sh
$ make static-code-analysis-baseline
```

Expand All @@ -76,7 +76,7 @@ We are using [`phpunit/phpunit`](https://github.com/sebastianbergmann/phpunit) t

Run

```
```sh
$ make tests
```

Expand All @@ -88,7 +88,7 @@ We are using [`infection/infection`](https://github.com/infection/infection) to

Enable `pcov` or `Xdebug` and run

```
```sh
$ make mutation-tests
```

Expand All @@ -98,7 +98,7 @@ to run mutation tests.

Run

```
```sh
$ make
```

Expand All @@ -108,7 +108,7 @@ to enforce coding standards, run a static code analysis, and run tests!

:bulb: Run

```
```sh
$ make help
```

Expand Down
7 changes: 4 additions & 3 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,22 +1,23 @@
# https://help.github.com/en/github/administering-a-repository/configuration-options-for-dependency-updates#target-branch
# https://help.github.com/en/github/administering-a-repository/configuration-options-for-dependency-updates

version: 2

updates:
- commit-message:
include: "scope"
prefix: "Build"
prefix: "composer"
directory: "/"
labels:
- "dependency"
open-pull-requests-limit: 10
package-ecosystem: "composer"
schedule:
interval: "daily"
versioning-strategy: "increase"

- commit-message:
include: "scope"
prefix: "Build"
prefix: "github-actions"
directory: "/"
labels:
- "dependency"
Expand Down
31 changes: 16 additions & 15 deletions .github/workflows/integrate.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ on: # yamllint disable-line rule:truthy
env:
MIN_COVERED_MSI: 95
MIN_MSI: 91
REQUIRED_PHP_EXTENSIONS: "filter, mbstring"
PHP_EXTENSIONS: "mbstring"

jobs:
coding-standards:
Expand All @@ -29,7 +29,7 @@ jobs:

steps:
- name: "Checkout"
uses: "actions/[email protected].0"
uses: "actions/[email protected].1"

- name: "Lint YAML files"
uses: "ibiqlik/action-yamllint@v1"
Expand All @@ -42,7 +42,7 @@ jobs:
uses: "shivammathur/setup-php@v2"
with:
coverage: "none"
extensions: "${{ env.REQUIRED_PHP_EXTENSIONS }}"
extensions: "${{ env.PHP_EXTENSIONS }}"
php-version: "${{ matrix.php-version }}"

- name: "Validate composer.json and composer.lock"
Expand Down Expand Up @@ -102,13 +102,13 @@ jobs:

steps:
- name: "Checkout"
uses: "actions/[email protected].0"
uses: "actions/[email protected].1"

- name: "Install PHP with extensions"
uses: "shivammathur/setup-php@v2"
with:
coverage: "none"
extensions: "${{ env.REQUIRED_PHP_EXTENSIONS }}"
extensions: "${{ env.PHP_EXTENSIONS }}"
php-version: "${{ matrix.php-version }}"

- name: "Determine composer cache directory"
Expand All @@ -135,7 +135,7 @@ jobs:
run: "composer update --no-interaction --no-progress --no-suggest"

- name: "Run maglnet/composer-require-checker"
uses: "docker://webfactory/composer-require-checker:2.1.0"
run: "tools/composer-require-checker check"

static-code-analysis:
name: "Static Code Analysis"
Expand All @@ -152,13 +152,13 @@ jobs:

steps:
- name: "Checkout"
uses: "actions/[email protected].0"
uses: "actions/[email protected].1"

- name: "Install PHP with extensions"
uses: "shivammathur/setup-php@v2"
with:
coverage: "none"
extensions: "${{ env.REQUIRED_PHP_EXTENSIONS }}"
extensions: "${{ env.PHP_EXTENSIONS }}"
php-version: "${{ matrix.php-version }}"

- name: "Determine composer cache directory"
Expand Down Expand Up @@ -230,13 +230,13 @@ jobs:

steps:
- name: "Checkout"
uses: "actions/[email protected].0"
uses: "actions/[email protected].1"

- name: "Install PHP with extensions"
uses: "shivammathur/setup-php@v2"
with:
coverage: "none"
extensions: "${{ env.REQUIRED_PHP_EXTENSIONS }}"
extensions: "${{ env.PHP_EXTENSIONS }}"
php-version: "${{ matrix.php-version }}"

- name: "Determine composer cache directory"
Expand Down Expand Up @@ -286,13 +286,13 @@ jobs:

steps:
- name: "Checkout"
uses: "actions/[email protected].0"
uses: "actions/[email protected].1"

- name: "Install PHP with extensions"
uses: "shivammathur/setup-php@v2"
with:
coverage: "xdebug"
extensions: "${{ env.REQUIRED_PHP_EXTENSIONS }}"
extensions: "${{ env.PHP_EXTENSIONS }}"
php-version: "${{ matrix.php-version }}"

- name: "Determine composer cache directory"
Expand Down Expand Up @@ -344,13 +344,13 @@ jobs:

steps:
- name: "Checkout"
uses: "actions/[email protected].0"
uses: "actions/[email protected].1"

- name: "Install PHP with extensions"
uses: "shivammathur/setup-php@v2"
with:
coverage: "xdebug"
extensions: "${{ env.REQUIRED_PHP_EXTENSIONS }}"
extensions: "${{ env.PHP_EXTENSIONS }}"
php-version: "${{ matrix.php-version }}"

- name: "Determine composer cache directory"
Expand Down Expand Up @@ -399,7 +399,8 @@ jobs:
github.event.action == 'reopened' ||
github.event.action == 'synchronize'
) && (
(github.actor == 'dependabot[bot]' && startsWith(github.event.pull_request.title, 'Build(deps-dev)')) ||
(github.actor == 'dependabot[bot]' && startsWith(github.event.pull_request.title, 'composer(deps-dev)')) ||
(github.actor == 'dependabot[bot]' && startsWith(github.event.pull_request.title, 'github-actions(deps)')) ||
(github.actor == 'ergebnis-bot' && github.event.pull_request.title == 'Enhancement: Update license year') ||
(github.actor == 'localheinz' && contains(github.event.pull_request.labels.*.name, 'merge'))
)
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/renew.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on: # yamllint disable-line rule:truthy
- cron: "1 0 1 1 *"

env:
REQUIRED_PHP_EXTENSIONS: "mbstring"
PHP_EXTENSIONS: "mbstring"

jobs:
license:
Expand All @@ -25,13 +25,13 @@ jobs:

steps:
- name: "Checkout"
uses: "actions/[email protected].0"
uses: "actions/[email protected].1"

- name: "Install PHP with extensions"
uses: "shivammathur/setup-php@v2"
with:
coverage: "none"
extensions: "${{ env.REQUIRED_PHP_EXTENSIONS }}"
extensions: "${{ env.PHP_EXTENSIONS }}"
php-version: "${{ matrix.php-version }}"

- name: "Validate composer.json and composer.lock"
Expand Down
3 changes: 1 addition & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ coding-standards: vendor ## Normalizes composer.json with ergebnis/composer-norm

.PHONY: dependency-analysis
dependency-analysis: vendor ## Runs a dependency analysis with maglnet/composer-require-checker
docker run --interactive --rm --tty --volume ${PWD}:/app webfactory/composer-require-checker:2.0.0
tools/composer-require-checker check

.PHONY: help
help: ## Displays this list of targets with descriptions
Expand All @@ -40,7 +40,6 @@ static-code-analysis: vendor ## Runs a static code analysis with phpstan/phpstan
.PHONY: static-code-analysis-baseline
static-code-analysis-baseline: vendor ## Generates a baseline for static code analysis with phpstan/phpstan and vimeo/psalm
mkdir -p .build/phpstan
echo '' > phpstan-baseline.neon
vendor/bin/phpstan analyze --configuration=phpstan.neon --generate-baseline=phpstan-baseline.neon
mkdir -p .build/psalm
vendor/bin/psalm --config=psalm.xml --set-baseline=psalm-baseline.xml
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Provides an abstraction of an open-source license.

Run

```shell
```sh
$ composer require --dev ergebnis/license
```

Expand Down
4 changes: 4 additions & 0 deletions phive.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<phive xmlns="https://phar.io/phive">
<phar name="composer-require-checker" version="^2.1.0" installed="2.1.0" location="./tools/composer-require-checker" copy="true"/>
</phive>
Binary file added tools/composer-require-checker
Binary file not shown.