-
-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Enhancement: Synchronize with ergebnis/php-library-template
- Loading branch information
1 parent
4f20857
commit fc02cc8
Showing
14 changed files
with
142 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,7 +13,7 @@ indent_size = 2 | |
[*.neon] | ||
indent_style = tab | ||
|
||
[*.yaml] | ||
[*.{yaml,yml}] | ||
indent_size = 2 | ||
|
||
[Makefile] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -55,7 +55,7 @@ jobs: | |
uses: "actions/cache@v1" | ||
with: | ||
path: "${{ steps.determine-composer-cache-directory.outputs.directory }}" | ||
key: "php-${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-${{ hashFiles('**/composer.lock') }}" | ||
key: "php-${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-${{ hashFiles('composer.lock') }}" | ||
restore-keys: "php-${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-" | ||
|
||
- name: "Install lowest dependencies from composer.json" | ||
|
@@ -82,7 +82,7 @@ jobs: | |
uses: "actions/cache@v1" | ||
with: | ||
path: ".build/php-cs-fixer" | ||
key: "php-${{ matrix.php-version }}-php-cs-fixer-${{ hashFiles('**/composer.lock') }}" | ||
key: "php-${{ matrix.php-version }}-php-cs-fixer-${{ hashFiles('composer.lock') }}" | ||
restore-keys: "php-${{ matrix.php-version }}-php-cs-fixer-" | ||
|
||
- name: "Run friendsofphp/php-cs-fixer" | ||
|
@@ -120,7 +120,7 @@ jobs: | |
uses: "actions/cache@v1" | ||
with: | ||
path: "${{ steps.determine-composer-cache-directory.outputs.directory }}" | ||
key: "php-${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-${{ hashFiles('**/composer.lock') }}" | ||
key: "php-${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-${{ hashFiles('composer.lock') }}" | ||
restore-keys: "php-${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-" | ||
|
||
- name: "Install lowest dependencies from composer.json" | ||
|
@@ -172,7 +172,7 @@ jobs: | |
uses: "actions/cache@v1" | ||
with: | ||
path: "${{ steps.determine-composer-cache-directory.outputs.directory }}" | ||
key: "${{ matrix.php-version }}-composer-locked-${{ hashFiles('**/composer.lock') }}" | ||
key: "${{ matrix.php-version }}-composer-locked-${{ hashFiles('composer.lock') }}" | ||
restore-keys: "${{ matrix.php-version }}-composer-locked-" | ||
|
||
- name: "Install lowest dependencies from composer.json" | ||
|
@@ -190,14 +190,28 @@ jobs: | |
- name: "Create cache directory for phpstan/phpstan" | ||
run: "mkdir -p .build/phpstan" | ||
|
||
- name: "Cache cache directory for phpstan/phpstan" | ||
uses: "actions/cache@v1" | ||
with: | ||
path: ".build/phpstan" | ||
key: "php-${{ matrix.php-version }}-phpstan-${{ github.sha }}" | ||
restore-keys: "php-${{ matrix.php-version }}-phpstan-" | ||
|
||
- name: "Run phpstan/phpstan" | ||
run: "vendor/bin/phpstan analyse --configuration=phpstan.neon" | ||
|
||
- name: "Create cache directory for vimeo/psalm" | ||
run: "mkdir -p .build/psalm" | ||
|
||
- name: "Cache cache directory for vimeo/psalm" | ||
uses: "actions/cache@v1" | ||
with: | ||
path: ".build/psalm" | ||
key: "php-${{ matrix.php-version }}-psalm-${{ github.sha }}" | ||
restore-keys: "php-${{ matrix.php-version }}-psalm-" | ||
|
||
- name: "Run vimeo/psalm" | ||
run: "vendor/bin/psalm --config=psalm.xml --shepherd --show-info=false --stats" | ||
run: "vendor/bin/psalm --config=psalm.xml --diff --diff-methods --shepherd --show-info=false --stats --threads=4" | ||
|
||
tests: | ||
name: "Tests" | ||
|
@@ -236,7 +250,7 @@ jobs: | |
uses: "actions/cache@v1" | ||
with: | ||
path: "${{ steps.determine-composer-cache-directory.outputs.directory }}" | ||
key: "php-${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-${{ hashFiles('**/composer.lock') }}" | ||
key: "php-${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-${{ hashFiles('composer.lock') }}" | ||
restore-keys: "php-${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-" | ||
|
||
- name: "Install lowest dependencies from composer.json" | ||
|
@@ -292,7 +306,7 @@ jobs: | |
uses: "actions/cache@v1" | ||
with: | ||
path: "${{ steps.determine-composer-cache-directory.outputs.directory }}" | ||
key: "php-${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-${{ hashFiles('**/composer.lock') }}" | ||
key: "php-${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-${{ hashFiles('composer.lock') }}" | ||
restore-keys: "php-${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-" | ||
|
||
- name: "Install lowest dependencies from composer.json" | ||
|
@@ -353,7 +367,7 @@ jobs: | |
uses: "actions/cache@v1" | ||
with: | ||
path: "${{ steps.determine-composer-cache-directory.outputs.directory }}" | ||
key: "php-${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-${{ hashFiles('**/composer.lock') }}" | ||
key: "php-${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-${{ hashFiles('composer.lock') }}" | ||
restore-keys: "php-${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-" | ||
|
||
- name: "Install lowest dependencies from composer.json" | ||
|
@@ -389,8 +403,8 @@ jobs: | |
- name: "Run composer-normalize.phar with argument and options" | ||
run: "${{ env.COMPOSER_NORMALIZE_PHAR }} --dry-run composer.json" | ||
|
||
review: | ||
name: "Review" | ||
merge: | ||
name: "Merge" | ||
|
||
runs-on: "ubuntu-latest" | ||
|
||
|
@@ -402,15 +416,93 @@ jobs: | |
- "static-code-analysis" | ||
- "tests" | ||
|
||
if: > | ||
github.event_name == 'pull_request' && | ||
github.event.pull_request.draft == false && ( | ||
github.event.action == 'opened' || | ||
github.event.action == 'reopened' || | ||
github.event.action == 'synchronize' | ||
) && ( | ||
(github.actor == 'dependabot-preview[bot]' && startsWith(github.event.pull_request.title, 'Build(deps-dev)')) || | ||
(github.actor == 'ergebnis-bot' && github.event.pull_request.title == 'Enhancement: Update license year') || | ||
(github.actor == 'localheinz' && contains(github.event.pull_request.labels.*.name, 'merge')) | ||
) | ||
steps: | ||
- name: "Approve pull requests created by dependabot that update development dependencies" | ||
uses: "hmarr/[email protected]" | ||
if: "(github.actor == 'dependabot[bot]' || github.actor == 'dependabot-preview[bot]') && github.event_name == 'pull_request' && startsWith(github.event.pull_request.title, 'Build(deps-dev)')" | ||
- name: "Request review from @ergebnis-bot" | ||
uses: "actions/[email protected]" | ||
with: | ||
github-token: "${{ secrets.ERGEBNIS_BOT_TOKEN }}" | ||
|
||
- name: "Approve pull requests created by @ergebnis-bot that update the license year" | ||
uses: "hmarr/[email protected]" | ||
if: "github.actor == 'ergebnis-bot' && github.event_name == 'pull_request' && github.event.pull_request.title == 'Enhancement: Update license year'" | ||
script: | | ||
const pullRequest = context.payload.pull_request | ||
const repository = context.repo | ||
const reviewers = [ | ||
"ergebnis-bot", | ||
] | ||
await github.pulls.createReviewRequest({ | ||
owner: repository.owner, | ||
pull_number: pullRequest.number, | ||
repo: repository.repo, | ||
reviewers: reviewers, | ||
}) | ||
- name: "Wait" | ||
run: "sleep 3" | ||
|
||
- name: "Assign @ergebnis-bot" | ||
uses: "actions/[email protected]" | ||
with: | ||
github-token: "${{ secrets.ERGEBNIS_BOT_TOKEN }}" | ||
script: | | ||
const pullRequest = context.payload.pull_request | ||
const repository = context.repo | ||
const reviewers = [ | ||
"ergebnis-bot", | ||
] | ||
await github.issues.addAssignees({ | ||
assignees: reviewers, | ||
issue_number: pullRequest.number, | ||
owner: repository.owner, | ||
repo: repository.repo, | ||
}) | ||
- name: "Wait" | ||
run: "sleep 3" | ||
|
||
- name: "Approve pull request" | ||
uses: "actions/[email protected]" | ||
if: "github.actor != 'ergebnis-bot'" | ||
with: | ||
github-token: "${{ secrets.ERGEBNIS_BOT_TOKEN }}" | ||
script: | | ||
const pullRequest = context.payload.pull_request | ||
const repository = context.repo | ||
await github.pulls.createReview({ | ||
event: "APPROVE", | ||
owner: repository.owner, | ||
pull_number: pullRequest.number, | ||
repo: repository.repo, | ||
}) | ||
- name: "Wait" | ||
run: "sleep 3" | ||
|
||
- name: "Merge pull request" | ||
uses: "actions/[email protected]" | ||
with: | ||
github-token: "${{ secrets.ERGEBNIS_BOT_TOKEN }}" | ||
script: | | ||
const pullRequest = context.payload.pull_request | ||
const repository = context.repo | ||
await github.pulls.merge({ | ||
merge_method: "merge", | ||
owner: repository.owner, | ||
pull_number: pullRequest.number, | ||
repo: repository.repo, | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -74,7 +74,7 @@ jobs: | |
run: "vendor/bin/php-cs-fixer fix --config=.php_cs --diff --diff-format=udiff --dry-run --verbose" | ||
|
||
- name: "Open pull request updating license year" | ||
uses: "gr2m/[email protected].9" | ||
uses: "gr2m/[email protected].10" | ||
with: | ||
author: "ergebnis-bot <[email protected]>" | ||
branch: "feature/license-year" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
/.build/ | ||
/.notes/ | ||
/phar/resource/ | ||
/phar/src/ | ||
/phar/vendor/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -35,6 +35,7 @@ $config->getFinder() | |
'.build/', | ||
'.dependabot/', | ||
'.github/', | ||
'.notes/', | ||
]) | ||
->name('.php_cs'); | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,4 +13,4 @@ parameters: | |
paths: | ||
- src/ | ||
- test/ | ||
tmpDir: %currentWorkingDirectory%/.build/phpstan/ | ||
tmpDir: .build/phpstan/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.