This repository has been archived by the owner on Aug 14, 2021. It is now read-only.
generated from mimmi20/template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
103 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 |
---|---|---|
|
@@ -51,7 +51,7 @@ jobs: | |
run: "composer-normalize --dry-run" | ||
|
||
install: | ||
name: "Check dependencies" | ||
name: "Install dependencies" | ||
|
||
needs: "validate" | ||
|
||
|
@@ -100,7 +100,7 @@ jobs: | |
restore-keys: "php-${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-" | ||
|
||
- name: "Update dependencies with composer" | ||
run: "composer update --optimize-autoloader --prefer-dist --prefer-stable --no-progress --no-interaction -vv --ansi ${{ matrix.dependencies }}" | ||
run: "composer update --optimize-autoloader --prefer-dist --prefer-stable --no-progress --no-interaction -v --ansi ${{ matrix.dependencies }}" | ||
|
||
- name: "Check dependencies with composer" | ||
run: "composer outdated --direct --strict" | ||
|
@@ -152,7 +152,7 @@ jobs: | |
restore-keys: "php-${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-" | ||
|
||
- name: "Update dependencies with composer" | ||
run: "composer update --optimize-autoloader --prefer-dist --prefer-stable --no-progress --no-interaction -vv --ansi ${{ matrix.dependencies }}" | ||
run: "composer update --optimize-autoloader --prefer-dist --prefer-stable --no-progress --no-interaction -v --ansi ${{ matrix.dependencies }}" | ||
|
||
- name: "Run friendsofphp/php-cs-fixer" | ||
run: "vendor/bin/php-cs-fixer fix --dry-run -vv" | ||
|
@@ -204,7 +204,7 @@ jobs: | |
restore-keys: "php-${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-" | ||
|
||
- name: "Update dependencies with composer" | ||
run: "composer update --optimize-autoloader --prefer-dist --prefer-stable --no-progress --no-interaction -vv --ansi ${{ matrix.dependencies }}" | ||
run: "composer update --optimize-autoloader --prefer-dist --prefer-stable --no-progress --no-interaction -v --ansi ${{ matrix.dependencies }}" | ||
|
||
- name: "Run squizlabs/php_codesniffer" | ||
uses: "chekalsky/[email protected]" | ||
|
@@ -257,11 +257,63 @@ jobs: | |
restore-keys: "php-${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-" | ||
|
||
- name: "Update dependencies with composer" | ||
run: "composer update --optimize-autoloader --prefer-dist --prefer-stable --no-progress --no-interaction -vv --ansi ${{ matrix.dependencies }}" | ||
run: "composer update --optimize-autoloader --prefer-dist --prefer-stable --no-progress --no-interaction -v --ansi ${{ matrix.dependencies }}" | ||
|
||
- name: "Run phpstan/phpstan" | ||
run: "vendor/bin/phpstan analyse -c phpstan.neon --memory-limit=768M --no-progress" | ||
|
||
phpmd: | ||
name: "Check Rules with PHPMD" | ||
|
||
needs: "install" | ||
|
||
runs-on: "${{ matrix.operating-system }}" | ||
|
||
continue-on-error: false | ||
|
||
strategy: | ||
fail-fast: false | ||
|
||
matrix: | ||
operating-system: | ||
- "ubuntu-20.04" | ||
|
||
php-version: | ||
- "7.4" | ||
|
||
dependencies: | ||
- "" | ||
|
||
steps: | ||
- name: "Checkout" | ||
uses: "actions/[email protected]" | ||
|
||
- name: "Install PHP" | ||
uses: "shivammathur/[email protected]" | ||
with: | ||
php-version: "${{ matrix.php-version }}" | ||
extensions: "${{ env.PHP_EXTENSIONS }}" | ||
ini-values: "${{ env.PHP_INI_VALUES }}" | ||
coverage: "none" | ||
tools: "composer:v2" | ||
|
||
- 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/[email protected]" | ||
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: "Update dependencies with composer" | ||
run: "composer update --optimize-autoloader --prefer-dist --prefer-stable --no-progress --no-interaction -v --ansi ${{ matrix.dependencies }}" | ||
|
||
- name: "Run phpmd/phpmd" | ||
run: "vendor/bin/phpmd src github phpmd.ruleset.xml" | ||
|
||
tests: | ||
name: "UnitTests with PHPUnit" | ||
|
||
|
@@ -278,29 +330,17 @@ jobs: | |
operating-system: | ||
- "ubuntu-18.04" | ||
- "ubuntu-20.04" | ||
- "windows-2019" | ||
- "macos-10.15" | ||
|
||
php-version: | ||
- "7.4" | ||
- "8.0" | ||
|
||
dependencies: | ||
- "" | ||
|
||
continue-on-error: | ||
- false | ||
|
||
include: | ||
- operating-system: "ubuntu-20.04" | ||
php-version: "8.0" | ||
continue-on-error: true | ||
- operating-system: "windows-2019" | ||
php-version: "8.0" | ||
continue-on-error: true | ||
- operating-system: "macos-10.15" | ||
php-version: "8.0" | ||
continue-on-error: true | ||
|
||
steps: | ||
- name: "Checkout" | ||
uses: "actions/[email protected]" | ||
|
@@ -326,10 +366,10 @@ jobs: | |
restore-keys: "php-${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-" | ||
|
||
- name: "Update dependencies with composer" | ||
run: "composer update --optimize-autoloader --prefer-dist --prefer-stable --no-progress --no-interaction -vv --ansi ${{ matrix.dependencies }}" | ||
run: "composer update --optimize-autoloader --prefer-dist --prefer-stable --no-progress --no-interaction -v --ansi ${{ matrix.dependencies }}" | ||
|
||
- name: "Run unit tests with phpunit/phpunit" | ||
run: "vendor/bin/phpunit -c phpunit.xml --colors --no-coverage" | ||
run: "vendor/bin/phpunit -c phpunit.xml --verbose --no-coverage" | ||
|
||
code-coverage: | ||
name: "Code Coverage with PHPUnit" | ||
|
@@ -367,7 +407,7 @@ jobs: | |
extensions: "${{ env.PHP_EXTENSIONS }}" | ||
ini-values: "${{ env.PHP_INI_VALUES }}" | ||
coverage: "${{ matrix.coverage-drivers }}" | ||
tools: "composer:v2" | ||
tools: "composer:v2, infection" | ||
|
||
- name: "Determine composer cache directory" | ||
id: "determine-composer-cache-directory" | ||
|
@@ -381,20 +421,20 @@ jobs: | |
restore-keys: "php-${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-" | ||
|
||
- name: "Update dependencies with composer" | ||
run: "composer update --optimize-autoloader --prefer-dist --prefer-stable --no-progress --no-interaction -vv --ansi ${{ matrix.dependencies }}" | ||
run: "composer update --optimize-autoloader --prefer-dist --prefer-stable --no-progress --no-interaction -v --ansi ${{ matrix.dependencies }}" | ||
|
||
- name: "Create cache directory for phpunit/phpunit" | ||
run: "mkdir -p .build/coverage" | ||
|
||
- name: "Collect code coverage with Xdebug and phpunit/phpunit" | ||
run: "vendor/bin/phpunit -c phpunit.xml --colors --coverage-clover=.build/coverage/clover.xml --coverage-text --coverage-xml=.build/coverage/coverage-xml --log-junit=.build/coverage/phpunit.junit.xml" | ||
run: "vendor/bin/phpunit -c phpunit.xml --verbose --coverage-clover=.build/coverage/clover.xml --coverage-text --coverage-xml=.build/coverage/coverage-xml --log-junit=.build/coverage/phpunit.junit.xml" | ||
|
||
- name: "Upload coverage to Codecov" | ||
uses: "codecov/[email protected]" | ||
with: | ||
file: ".build/coverage/clover.xml" | ||
flags: "phpunit,php-${{ matrix.php-version }},${{ matrix.coverage-drivers }}" | ||
verbose: true | ||
flags: "phpunit,php-${{ matrix.php-version }},${{ matrix.coverage-drivers }},${{ matrix.php-version }},${{ matrix.operating-system }}" | ||
verbose: false | ||
|
||
- name: "Run mutation tests with infection/infection" | ||
run: "vendor/bin/infection --min-covered-msi=83 --min-msi=83 --git-diff-filter=AM --git-diff-base=origin/$GITHUB_BASE_REF --coverage=.build/coverage --logger-github" | ||
run: "infection -s --min-covered-msi=83 --min-msi=83 --coverage=.build/coverage --logger-github" |
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,29 @@ | ||
<?xml version="1.0"?> | ||
<ruleset name="mimmi20-cs" | ||
xmlns="http://pmd.sf.net/ruleset/1.0.0" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://pmd.sf.net/ruleset/1.0.0 http://pmd.sf.net/ruleset_xml_schema.xsd" | ||
xsi:noNamespaceSchemaLocation="http://pmd.sf.net/ruleset_xml_schema.xsd"> | ||
<description>The coding standard.</description> | ||
|
||
<rule ref="rulesets/cleancode.xml"> | ||
<exclude name="BooleanArgumentFlag"/> | ||
<exclude name="ElseExpression"/> | ||
<exclude name="MissingImport"/> | ||
<exclude name="StaticAccess"/> | ||
</rule> | ||
|
||
<rule ref="rulesets/codesize.xml"> | ||
<exclude name="CyclomaticComplexity"/> | ||
<exclude name="NPathComplexity"/> | ||
</rule> | ||
|
||
<rule ref="rulesets/controversial.xml"/> | ||
<rule ref="rulesets/design.xml"/> | ||
|
||
<rule ref="rulesets/naming.xml/ConstantNamingConventions"/> | ||
|
||
<rule ref="rulesets/unusedcode.xml"> | ||
<exclude name="UnusedFormalParameter"/> | ||
</rule> | ||
</ruleset> |
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