Skip to content

Commit

Permalink
Enhancement: Synchronize with ergebnis/php-package-template
Browse files Browse the repository at this point in the history
  • Loading branch information
localheinz committed Jan 4, 2024
1 parent ec6e25d commit 7efed23
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 33 deletions.
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
4 changes: 2 additions & 2 deletions .github/settings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ repository:
archived: false
default_branch: "main"
delete_branch_on_merge: true
description: ":eyeglasses: Provides rules for phpstan/phpstan."
description: "👓 Provides a composer package with rules for phpstan/phpstan."
enable_automated_security_fixes: true
enable_vulnerability_alerts: true
has_discussions: false
Expand All @@ -90,4 +90,4 @@ repository:

# https://docs.github.com/en/rest/reference/repos#replace-all-repository-topics

topics: "phpstan, phpstan-rules, phpstan-extreme-rules"
topics: "phpstan, phpstan-rules"
16 changes: 2 additions & 14 deletions .github/workflows/integrate.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -127,9 +127,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 @@ -140,10 +137,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 @@ -248,9 +245,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 @@ -360,15 +354,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 }}
7 changes: 2 additions & 5 deletions .github/workflows/renew.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
uses: "shivammathur/[email protected]"
with:
coverage: "none"
extensions: "none, ctype, curl, dom, json, mbstring, phar, simplexml, tokenizer, xml, xmlwriter"
extensions: "none, bcmath, ctype, curl, dom, intl, json, mbstring, phar, simplexml, tokenizer, xml, xmlwriter"
php-version: "${{ matrix.php-version }}"

- name: "Set up problem matchers for PHP"
Expand All @@ -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
13 changes: 2 additions & 11 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,14 @@ it: refactoring coding-standards security-analysis static-code-analysis tests ##

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

.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 @@ -24,12 +22,10 @@ help: ## Displays this list of targets with descriptions

.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 @@ -38,25 +34,20 @@ 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 integration tests with phpunit/phpunit
mkdir -p .build/phpunit/
vendor/bin/phpunit --configuration=test/Integration/phpunit.xml

vendor: composer.json composer.lock
Expand Down

0 comments on commit 7efed23

Please sign in to comment.