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-package-template #1276

Merged
merged 1 commit into from
Jan 26, 2024
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: 1 addition & 1 deletion .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ For details, take a look at the following workflow configuration files:
- [`workflows/renew.yaml`](workflows/renew.yaml)
- [`workflows/triage.yaml`](workflows/triage.yaml)

## Backward-compatibility Analysis
## Backward-Compatibility Analysis

We use [`roave/backward-compatibility-check`](https://github.com/Roave/BackwardCompatibilityCheck) to prevent breaking backwards-compatibility.

Expand Down
2 changes: 1 addition & 1 deletion .github/dependabot.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# https://docs.github.com/en/github/administering-a-repository/configuration-options-for-dependency-updates
# https://docs.github.com/en/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file

version: 2

Expand Down
2 changes: 1 addition & 1 deletion .github/settings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ repository:
archived: false
default_branch: "main"
delete_branch_on_merge: true
description: ":robot: Provides a fixture factory for doctrine/orm entities."
description: "🤖 Provides a composer package with a fixture factory for doctrine/orm entities."
enable_automated_security_fixes: true
enable_vulnerability_alerts: true
has_discussions: false
Expand Down
19 changes: 2 additions & 17 deletions .github/workflows/integrate.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,6 @@ jobs:
- name: "Set up problem matchers for PHP"
run: "echo \"::add-matcher::${{ runner.tool_cache }}/php.json\""

- name: "Set up problem matchers for phpunit/phpunit"
run: "echo \"::add-matcher::${{ runner.tool_cache }}/phpunit.json\""

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

Expand Down Expand Up @@ -182,9 +179,6 @@ jobs:
- name: "Run ergebnis/composer-normalize"
run: "composer normalize --ansi --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/[email protected]"
with:
Expand All @@ -195,10 +189,10 @@ jobs:
php-${{ matrix.php-version }}-php-cs-fixer-

- name: "Run friendsofphp/php-cs-fixer"
run: "vendor/bin/php-cs-fixer fix --ansi --config=.php-cs-fixer.php --diff --dry-run --verbose"
run: "vendor/bin/php-cs-fixer fix --ansi --config=.php-cs-fixer.php --diff --dry-run --show-progress=dots --verbose"

- name: "Run friendsofphp/php-cs-fixer on fixtures"
run: "vendor/bin/php-cs-fixer fix --ansi --config=.php-cs-fixer.fixture.php --diff --dry-run --verbose"
run: "vendor/bin/php-cs-fixer fix --ansi --config=.php-cs-fixer.fixture.php --diff --dry-run --show-progress=dots --verbose"

dependency-analysis:
name: "Dependency Analysis"
Expand Down Expand Up @@ -355,9 +349,6 @@ jobs:
with:
dependencies: "${{ matrix.dependencies }}"

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

- name: "Cache cache directory for rector/rector"
uses: "actions/[email protected]"
with:
Expand Down Expand Up @@ -467,15 +458,9 @@ jobs:
with:
dependencies: "${{ matrix.dependencies }}"

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

- name: "Run phpstan/phpstan"
run: "vendor/bin/phpstan --ansi --configuration=phpstan.neon --memory-limit=-1"

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

- name: "Run vimeo/psalm"
run: "vendor/bin/psalm --config=psalm.xml --output-format=github --shepherd --show-info=false --stats --threads=4"

Expand Down
13 changes: 13 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,16 @@ jobs:
uses: "ergebnis/.github/actions/github/release/[email protected]"
with:
github-token: "${{ secrets.ERGEBNIS_BOT_TOKEN }}"

- name: "Post to twitter.com about release"
uses: "Eomm/[email protected]"
env:
TWITTER_ACCESS_TOKEN: "${{ secrets.ERGEBNIS_TWITTER_ACCESS_TOKEN }}"
TWITTER_ACCESS_TOKEN_SECRET: "${{ secrets.ERGEBNIS_TWITTER_ACCESS_TOKEN_SECRET }}"
TWITTER_CONSUMER_API_KEY: "${{ secrets.ERGEBNIS_TWITTER_CONSUMER_API_KEY }}"
TWITTER_CONSUMER_API_SECRET: "${{ secrets.ERGEBNIS_TWITTER_CONSUMER_API_KEY_SECRET }}"
with:
tweet-message: |
🤖 Just released: ${{ github.event.repository.owner.login }}/${{ github.event.repository.name }}:${{ env.RELEASE_TAG }}.
${{ env.RELEASE_HTML_URL }}
5 changes: 1 addition & 4 deletions .github/workflows/renew.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,6 @@ jobs:
with:
dependencies: "${{ matrix.dependencies }}"

- 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/[email protected]"
with:
Expand All @@ -69,7 +66,7 @@ jobs:
php-${{ matrix.php-version }}-php-cs-fixer-
- name: "Run friendsofphp/php-cs-fixer"
run: "vendor/bin/php-cs-fixer fix --ansi --config=.php-cs-fixer.php --diff --verbose"
run: "vendor/bin/php-cs-fixer fix --ansi --config=.php-cs-fixer.php --diff --show-progress=dots --verbose"

- name: "Commit modified files"
uses: "stefanzweifel/[email protected]"
Expand Down
2 changes: 1 addition & 1 deletion .php-cs-fixer.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
__DIR__ . '/LICENSE.md',
License\Range::since(
License\Year::fromString('2020'),
new \DateTimeZone('UTC'),
new DateTimeZone('UTC'),
),
License\Holder::fromString('Andreas Möller'),
License\Url::fromString('https://github.com/ergebnis/factory-bot'),
Expand Down
15 changes: 2 additions & 13 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,14 @@ backward-compatibility-analysis: vendor ## Runs a backward-compatibility analysi

.PHONY: code-coverage
code-coverage: vendor ## Collects coverage from running unit and integration tests with phpunit/phpunit
mkdir -p .build/phpunit/
vendor/bin/phpunit --configuration=test/phpunit.xml --coverage-text --testsuite=unit,integration

.PHONY: coding-standards
coding-standards: vendor ## Lints YAML files with yamllint, normalizes composer.json with ergebnis/composer-normalize, and fixes code style issues with friendsofphp/php-cs-fixer
yamllint -c .yamllint.yaml --strict .
composer normalize
mkdir -p .build/php-cs-fixer/
vendor/bin/php-cs-fixer fix --config=.php-cs-fixer.php --diff --verbose
vendor/bin/php-cs-fixer fix --config=.php-cs-fixer.fixture.php --diff --verbose
vendor/bin/php-cs-fixer fix --config=.php-cs-fixer.php --diff --show-progress=dots --verbose
vendor/bin/php-cs-fixer fix --config=.php-cs-fixer.fixture.php --diff --show-progress=dots --verbose

.PHONY: dependency-analysis
dependency-analysis: phive vendor ## Runs a dependency analysis with maglnet/composer-require-checker
Expand All @@ -33,17 +31,14 @@ help: ## Displays this list of targets with descriptions

.PHONY: mutation-tests
mutation-tests: vendor ## Runs mutation tests with infection/infection
mkdir -p .build/infection/
vendor/bin/infection --configuration=infection.json

.PHONY: phive
phive: .phive ## Installs dependencies with phive
mkdir -p .build/phive/
PHIVE_HOME=.build/phive phive install --trust-gpg-keys 0x033E5F8D801A2F8D

.PHONY: refactoring
refactoring: vendor ## Runs automated refactoring with rector/rector
mkdir -p .build/rector/
vendor/bin/rector process --config=rector.php

.PHONY: security-analysis
Expand All @@ -52,31 +47,25 @@ security-analysis: vendor ## Runs a security analysis with composer

.PHONY: static-code-analysis
static-code-analysis: vendor ## Runs a static code analysis with phpstan/phpstan and vimeo/psalm
mkdir -p .build/phpstan/
vendor/bin/phpstan clear-result-cache --configuration=phpstan.neon
vendor/bin/phpstan --configuration=phpstan.neon --memory-limit=-1
mkdir -p .build/psalm/
vendor/bin/psalm --config=psalm.xml --clear-cache
vendor/bin/psalm --config=psalm.xml --show-info=false --stats --threads=4

.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/
vendor/bin/phpstan clear-result-cache --configuration=phpstan.neon
vendor/bin/phpstan --allow-empty-baseline --configuration=phpstan.neon --generate-baseline=phpstan-baseline.neon --memory-limit=-1
mkdir -p .build/psalm/
vendor/bin/psalm --config=psalm.xml --clear-cache
vendor/bin/psalm --config=psalm.xml --set-baseline=psalm-baseline.xml

.PHONY: tests
tests: vendor ## Runs unit and integration tests with phpunit/phpunit
mkdir -p .build/phpunit/
vendor/bin/phpunit --configuration=test/phpunit.xml --testsuite=unit
vendor/bin/phpunit --configuration=test/phpunit.xml --testsuite=integration

.PHONY: tests-example
tests-example: vendor ## Runs auto-review and unit tests for examples with phpunit/phpunit
mkdir -p .build/phpunit/
vendor/bin/phpunit --configuration=example/test/AutoReview/phpunit.xml
vendor/bin/phpunit --configuration=example/test/Unit/phpunit.xml

Expand Down
2 changes: 1 addition & 1 deletion psalm-baseline.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<files psalm-version="5.17.0@c620f6e80d0abfca532b00bda366062aaedf6e5d">
<files psalm-version="5.20.0@3f284e96c9d9be6fe6b15c79416e1d1903dcfef4">
<file src="example/src/Entity/Avatar.php">
<PossiblyUnusedMethod>
<code>height</code>
Expand Down
Loading