Skip to content

Enhancement: Merge upstream/master #6

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

Merged
merged 62 commits into from
Jul 6, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
62 commits
Select commit Hold shift + click to select a range
2ce6675
Update FUNDING.yml
sebastianbergmann Oct 23, 2019
16e54fb
Allow symfony/process 5
GrahamCampbell Nov 18, 2019
81601e2
Test on PHP 7.4
GrahamCampbell Dec 20, 2019
191aece
fix test on sf5 process package
SpacePossum Dec 23, 2019
c961b87
CS
SpacePossum Dec 23, 2019
be22833
happy new year!
SpacePossum Jan 6, 2020
9406a87
* Have Composer in `tools/composer` and managed through `composer sel…
sebastianbergmann Jan 17, 2020
cffa47f
Create Psalm configuration
sebastianbergmann Jan 17, 2020
5e09cdc
Drop support for PHP 7.1 and PHP 7.2
sebastianbergmann Jan 20, 2020
5c3c4d0
Leftover from 5e09cdc815ad9e0a3f00af07b371e2eca0c0eabc
sebastianbergmann Jan 27, 2020
c0c26c9
Prepare release
sebastianbergmann Feb 7, 2020
6ab2449
Fix miimal Symfony version
remicollet Feb 7, 2020
1381b9f
Enhancement: Modernize build automation
localheinz Feb 9, 2020
c243095
Fix: Run friendsofphp/php-cs-fixer
localheinz Feb 9, 2020
1b60f2f
Create Psalm baseline
sebastianbergmann Feb 13, 2020
2ccf1a7
Disable memory limit
sebastianbergmann Feb 13, 2020
6a1b8ad
Fix psalm warning
SpacePossum Feb 13, 2020
11eab82
CS
SpacePossum Feb 13, 2020
f9f2d51
Update tools
sebastianbergmann Feb 25, 2020
603024e
Update tools
sebastianbergmann Mar 9, 2020
2895a2d
Update tools
sebastianbergmann Mar 11, 2020
a52210d
Update tools
sebastianbergmann Mar 20, 2020
550ed27
Update tools
sebastianbergmann Mar 23, 2020
f22c3e6
Update tools
sebastianbergmann Apr 10, 2020
06ff2b2
Go back to Composer 1.10.2
sebastianbergmann Apr 10, 2020
74d0e21
Use 'composer self-update --1' to prevent unintentional update to Com…
sebastianbergmann Apr 10, 2020
1a70c4b
The --no-suggest option has been removed in Composer 2
sebastianbergmann Apr 10, 2020
c580420
Update tools
sebastianbergmann Apr 10, 2020
a788c31
Update tools
sebastianbergmann Apr 10, 2020
c8a48ac
Update tools
sebastianbergmann Apr 13, 2020
8f37481
Update tools
sebastianbergmann Apr 13, 2020
efd2021
Update tools
sebastianbergmann Apr 17, 2020
cea2608
Ignore tests etc. from archive exports
sebastianbergmann May 4, 2020
249d2b1
Leftover from cea2608878edf499e295496ace75efed06ded564
sebastianbergmann May 4, 2020
709f825
Do not add additional newline to unified diff when completely empty
znbailey May 7, 2020
0d2a0f4
Fixes whitespace
znbailey May 7, 2020
be1410b
fix coding standards
znbailey May 7, 2020
63a7082
Reformat
sebastianbergmann May 8, 2020
3e523c5
Prepare release
sebastianbergmann May 8, 2020
7122409
Cleanup
sebastianbergmann May 8, 2020
ade9875
Update tools
sebastianbergmann May 12, 2020
71f613a
Use .phive/phars.xml instead of phive.xml
sebastianbergmann May 27, 2020
0c72a85
Update tools
sebastianbergmann May 28, 2020
0a22a59
Update tools
sebastianbergmann Jun 5, 2020
c65f08f
Install roave-backward-compatibility-check
sebastianbergmann Jun 16, 2020
51ed853
Allow installation of unsigned phars (hopefully roave-backward-compat…
sebastianbergmann Jun 16, 2020
3c5875f
Add roave-backward-compatibility-check to CI pipeline
sebastianbergmann Jun 16, 2020
5408bc0
Update tools
sebastianbergmann Jun 18, 2020
0becbb4
Update
sebastianbergmann Jun 22, 2020
07ffdad
Update PHP-CS-Fixer configuration
sebastianbergmann Jun 22, 2020
cd85830
Fix CS/WS issues
sebastianbergmann Jun 22, 2020
6ba2987
Update tools
sebastianbergmann Jun 23, 2020
e172152
Update tools
sebastianbergmann Jun 24, 2020
bb5ddad
Update tools
sebastianbergmann Jun 26, 2020
ac8608c
Update tools
sebastianbergmann Jun 28, 2020
679f5da
The "--1" option should no longer be necessary for "composer update"
sebastianbergmann Jun 28, 2020
b945d53
Support PHP 8 for https://github.com/sebastianbergmann/phpunit/issues…
sebastianbergmann Jun 30, 2020
1e90b4c
Prepare release
sebastianbergmann Jun 30, 2020
de3eeca
Update tools
sebastianbergmann Jul 4, 2020
80a95e8
Enhancement: Synchronize with ergebnis/php-library-template
localheinz Jul 5, 2020
2c03eca
Merge pull request #9 from localheinz/feature/synchronize
ergebnis-bot Jul 5, 2020
9ba3441
Merge remote-tracking branch 'upstream/master' into feature/merge
localheinz Jul 5, 2020
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
@@ -1,5 +1,6 @@
/.github/ export-ignore
/tests/ export-ignore
/tools/ export-ignore
/.editorconfig export-ignore
/.gitattributes export-ignore
/.gitignore export-ignore
Expand Down
20 changes: 18 additions & 2 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ For details, take a look at the following workflow configuration files:

## Coding Standards

We are using [`ergebnis/composer-normalize`](https://github.com/ergebnis/composer-normalize) to normalize `composer.json`.

We are using [`yamllint`](https://github.com/adrienverge/yamllint) to enforce coding standards in YAML files.

If you do not have `yamllint` installed yet, run
Expand All @@ -21,13 +23,27 @@ $ brew install yamllint

to install `yamllint`.

We are using [`friendsofphp/php-cs-fixer`](https://github.com/FriendsOfPHP/PHP-CS-Fixer) to enforce coding standards in PHP files.

Run

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

to detect coding standard violations.
to automatically fix coding standard violations.

## Static Code Analysis

We are using [`vimeo/psalm`](https://github.com/vimeo/psalm) to statically analyze the code.

Run

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

to run a static code analysis.

## Tests

Expand All @@ -49,7 +65,7 @@ Run
$ make
```

to detect coding standard violations and run tests!
to enforce coding standards, run a static code analysis, and run tests!

## Help

Expand Down
2 changes: 1 addition & 1 deletion .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -1 +1 @@
patreon: "s_bergmann"
github: "sebastianbergmann"
10 changes: 9 additions & 1 deletion .github/settings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,18 @@ branches:
required_approving_review_count: 1
required_status_checks:
contexts:
- "Coding Standards"
- "Code Coverage (7.4, highest)"
- "Coding Standards (7.1)"
- "Tests (7.1, highest)"
- "Tests (7.1, lowest)"
- "Tests (7.2, highest)"
- "Tests (7.2, lowest)"
- "Tests (7.3, highest)"
- "Tests (7.3, lowest)"
- "Tests (7.4, highest)"
- "Tests (7.4, lowest)"
- "Tests (8.0, highest)"
- "Tests (8.0, lowest)"
strict: false
restrictions: null

Expand Down
234 changes: 233 additions & 1 deletion .github/workflows/integrate.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@ jobs:

runs-on: "ubuntu-latest"

strategy:
matrix:
php-version:
- "7.1"

steps:
- name: "Checkout"
uses: "actions/[email protected]"
Expand All @@ -25,6 +30,115 @@ jobs:
file_or_dir: "."
strict: true

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

- name: "Validate composer.json and composer.lock"
run: "composer validate --strict"

- name: "Run ergebnis/composer-normalize"
run: "tools/composer-normalize --dry-run"

- name: "Create cache directory for friendsofphp/php-cs-fixer"
run: "mkdir -p .build/php-cs-fixer"

- name: "Cache cache directory for friendsofphp/php-cs-fixer"
uses: "actions/cache@v2"
with:
path: ".build/php-cs-fixer"
key: "php-${{ matrix.php-version }}-php-cs-fixer-${{ hashFiles('tools/php-cs-fixer') }}"
restore-keys: "php-${{ matrix.php-version }}-php-cs-fixer-"

- name: "Run friendsofphp/php-cs-fixer"
run: "tools/php-cs-fixer fix --config=.php_cs --diff --diff-format=udiff --dry-run --verbose"

static-code-analysis:
name: "Static Code Analysis"

runs-on: "ubuntu-latest"

strategy:
matrix:
php-version:
- "7.4"

dependencies:
- "highest"

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

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

- name: "Determine composer cache directory"
id: "determine-composer-cache-directory"
run: "echo \"::set-output name=directory::$(composer config cache-dir)\""

- name: "Cache dependencies installed with composer"
uses: "actions/cache@v2"
with:
path: "${{ steps.determine-composer-cache-directory.outputs.directory }}"
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"
if: "matrix.dependencies == 'lowest'"
run: "composer update --no-interaction --no-progress --no-suggest --prefer-lowest"

- name: "Install locked dependencies from composer.lock"
if: "matrix.dependencies == 'locked'"
run: "composer install --no-interaction --no-progress --no-suggest"

- name: "Install highest dependencies from composer.json"
if: "matrix.dependencies == 'highest'"
run: "composer update --no-interaction --no-progress --no-suggest"

- name: "Create cache directory for vimeo/psalm"
run: "mkdir -p .build/psalm"

- name: "Cache cache directory for vimeo/psalm"
uses: "actions/cache@v2"
with:
path: ".build/psalm"
key: "php-${{ matrix.php-version }}-psalm-${{ github.sha }}"
restore-keys: "php-${{ matrix.php-version }}-psalm-"

- name: "Run vimeo/psalm"
run: "tools/psalm --config=psalm.xml --diff --diff-methods --shepherd --show-info=false --stats --threads=4"

backward-compatibility:
name: "Backward Compatibility"

runs-on: "ubuntu-latest"

steps:
- name: "Checkout"
uses: "actions/[email protected]"
with:
fetch-depth: 0

- name: "Fetch tags"
run: "git fetch --depth=1 origin +refs/tags/*:refs/tags/*"

- name: "Install PHP with extensions"
uses: "shivammathur/setup-php@v2"
with:
php-version: "7.4"
coverage: "none"
extensions: "intl"

- name: "Run roave/backward-compatibility-check"
run: "tools/roave-backward-compatibility-check --from=1.0.0"

tests:
name: "Tests"

Expand All @@ -36,8 +150,11 @@ jobs:
- "7.1"
- "7.2"
- "7.3"
- "7.4"
- "8.0"

dependencies:
- "lowest"
- "highest"

steps:
Expand Down Expand Up @@ -76,12 +193,73 @@ jobs:
- name: "Run tests with phpunit/phpunit"
run: "vendor/bin/phpunit --configuration=phpunit.xml"

code-coverage:
name: "Code Coverage"

runs-on: "ubuntu-latest"

strategy:
matrix:
php-version:
- "7.4"

dependencies:
- "highest"

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

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

- name: "Determine composer cache directory"
id: "determine-composer-cache-directory"
run: "echo \"::set-output name=directory::$(composer config cache-dir)\""

- name: "Cache dependencies installed with composer"
uses: "actions/cache@v2"
with:
path: "${{ steps.determine-composer-cache-directory.outputs.directory }}"
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"
if: "matrix.dependencies == 'lowest'"
run: "composer update --no-interaction --no-progress --no-suggest --prefer-lowest"

- name: "Install locked dependencies from composer.lock"
if: "matrix.dependencies == 'locked'"
run: "composer install --no-interaction --no-progress --no-suggest"

- name: "Install highest dependencies from composer.json"
if: "matrix.dependencies == 'highest'"
run: "composer update --no-interaction --no-progress --no-suggest"

- name: "Dump Xdebug filter with phpunit/phpunit"
run: "vendor/bin/phpunit --configuration=phpunit.xml --dump-xdebug-filter=.build/phpunit/xdebug-filter.php"

- name: "Collect code coverage with Xdebug and phpunit/phpunit"
run: "vendor/bin/phpunit --configuration=phpunit.xml --coverage-clover=.build/logs/clover.xml --prepend=.build/phpunit/xdebug-filter.php"

- name: "Send code coverage report to Codecov.io"
env:
CODECOV_TOKEN: "${{ secrets.CODECOV_TOKEN }}"
run: "bash <(curl -s https://codecov.io/bash)"

merge:
name: "Merge"

runs-on: "ubuntu-latest"

needs:
- "backward-compatibility"
- "code-coverage"
- "coding-standards"
- "static-code-analysis"
- "tests"

if: >
Expand All @@ -97,10 +275,64 @@ jobs:
)

steps:
- name: "Request review from @ergebnis-bot"
uses: "actions/github-script@v2"
with:
github-token: "${{ secrets.ERGEBNIS_BOT_TOKEN }}"
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: "Assign @ergebnis-bot"
uses: "actions/github-script@v2"
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: "Approve pull request"
uses: "actions/github-script@v2"
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: "Merge pull request"
uses: "actions/github-script@v2"
with:
github-token: "${{ secrets.GITHUB_TOKEN }}"
github-token: "${{ secrets.ERGEBNIS_BOT_TOKEN }}"
script: |
const pullRequest = context.payload.pull_request
const repository = context.repo
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/prune.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
with:
days-before-close: 5
days-before-stale: 60
repo-token: "${{ secrets.GITHUB_TOKEN }}"
repo-token: "${{ secrets.ERGEBNIS_BOT_TOKEN }}"
stale-issue-label: "stale"
stale-issue-message: |
Since this issue has not had any activity within the last sixty days, I have marked it as stale.
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
- name: "Create release"
uses: "actions/[email protected]"
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
ERGEBNIS_BOT_TOKEN: "${{ secrets.ERGEBNIS_BOT_TOKEN }}"
with:
draft: false
prerelease: false
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/triage.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
- name: "Add labels based on branch name"
uses: "actions/github-script@v2"
with:
github-token: "${{ secrets.GITHUB_TOKEN }}"
github-token: "${{ secrets.ERGEBNIS_BOT_TOKEN }}"
script: |
const branchPrefixLabels = {
feature: "enhancement",
Expand Down
Loading