generated from ergebnis/php-package-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.
Enhancement: Declare test code in subdirectory
- Loading branch information
1 parent
6238054
commit d4b84dc
Showing
15 changed files
with
551 additions
and
9 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
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 |
---|---|---|
|
@@ -62,6 +62,62 @@ jobs: | |
- name: "Test autoloader for production" | ||
run: "php autoloader.php" | ||
|
||
code-coverage: | ||
name: "Code Coverage" | ||
|
||
runs-on: "ubuntu-latest" | ||
|
||
strategy: | ||
matrix: | ||
php-version: | ||
- "8.2" | ||
|
||
dependencies: | ||
- "locked" | ||
|
||
steps: | ||
- name: "Checkout" | ||
uses: "actions/[email protected]" | ||
|
||
- name: "Set up PHP" | ||
uses: "shivammathur/[email protected]" | ||
with: | ||
coverage: "xdebug" | ||
extensions: "none, ctype, dom, json, mbstring, phar, simplexml, tokenizer, xml, xmlwriter" | ||
php-version: "${{ matrix.php-version }}" | ||
|
||
- 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: "Determine composer cache directory" | ||
uses: "ergebnis/.github/actions/composer/[email protected]" | ||
|
||
- name: "Cache dependencies installed with composer" | ||
uses: "actions/[email protected]" | ||
with: | ||
path: "${{ env.COMPOSER_CACHE_DIR }}" | ||
key: "php-${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-${{ hashFiles('composer.lock') }}" | ||
restore-keys: "php-${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-" | ||
|
||
- name: "Install ${{ matrix.dependencies }} dependencies with composer" | ||
uses: "ergebnis/.github/actions/composer/[email protected]" | ||
with: | ||
dependencies: "${{ matrix.dependencies }}" | ||
|
||
- name: "Collect code coverage with Xdebug and phpunit/phpunit" | ||
env: | ||
XDEBUG_MODE: "coverage" | ||
run: "vendor/bin/phpunit --colors=always --configuration=phpunit.xml --coverage-clover=.build/phpunit/logs/clover.xml" | ||
|
||
- name: "Send code coverage report to codecov.io" | ||
uses: "codecov/[email protected]" | ||
with: | ||
files: ".build/phpunit/logs/clover.xml" | ||
token: "${{ secrets.CODECOV_TOKEN }}" | ||
|
||
coding-standards: | ||
name: "Coding Standards" | ||
|
||
|
@@ -190,6 +246,98 @@ jobs: | |
- name: "Run maglnet/composer-require-checker" | ||
run: ".phive/composer-require-checker check --ansi --config-file=$(pwd)/composer-require-checker.json" | ||
|
||
mutation-tests: | ||
name: "Mutation Tests" | ||
|
||
runs-on: "ubuntu-latest" | ||
|
||
strategy: | ||
matrix: | ||
php-version: | ||
- "8.2" | ||
|
||
dependencies: | ||
- "locked" | ||
|
||
steps: | ||
- name: "Checkout" | ||
uses: "actions/[email protected]" | ||
|
||
- name: "Set up PHP" | ||
uses: "shivammathur/[email protected]" | ||
with: | ||
coverage: "xdebug" | ||
extensions: "none, ctype, dom, json, mbstring, phar, simplexml, tokenizer, xml, xmlwriter" | ||
php-version: "${{ matrix.php-version }}" | ||
|
||
- name: "Set up problem matchers for PHP" | ||
run: "echo \"::add-matcher::${{ runner.tool_cache }}/php.json\"" | ||
|
||
- name: "Determine composer cache directory" | ||
uses: "ergebnis/.github/actions/composer/[email protected]" | ||
|
||
- name: "Cache dependencies installed with composer" | ||
uses: "actions/[email protected]" | ||
with: | ||
path: "${{ env.COMPOSER_CACHE_DIR }}" | ||
key: "php-${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-${{ hashFiles('composer.lock') }}" | ||
restore-keys: "php-${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-" | ||
|
||
- name: "Install ${{ matrix.dependencies }} dependencies with composer" | ||
uses: "ergebnis/.github/actions/composer/[email protected]" | ||
with: | ||
dependencies: "${{ matrix.dependencies }}" | ||
|
||
- name: "Run mutation tests with Xdebug and infection/infection" | ||
env: | ||
XDEBUG_MODE: "coverage" | ||
run: "vendor/bin/infection --ansi --configuration=infection.json --logger-github" | ||
|
||
performance-tests: | ||
name: "Performance Tests" | ||
|
||
runs-on: "ubuntu-latest" | ||
|
||
strategy: | ||
matrix: | ||
php-version: | ||
- "8.2" | ||
|
||
dependencies: | ||
- "locked" | ||
|
||
steps: | ||
- name: "Checkout" | ||
uses: "actions/[email protected]" | ||
|
||
- name: "Set up PHP" | ||
uses: "shivammathur/[email protected]" | ||
with: | ||
coverage: "none" | ||
extensions: "none, ctype, dom, json, mbstring, phar, simplexml, tokenizer, xml, xmlwriter" | ||
php-version: "${{ matrix.php-version }}" | ||
|
||
- name: "Set up problem matchers for PHP" | ||
run: "echo \"::add-matcher::${{ runner.tool_cache }}/php.json\"" | ||
|
||
- name: "Determine composer cache directory" | ||
uses: "ergebnis/.github/actions/composer/[email protected]" | ||
|
||
- name: "Cache dependencies installed with composer" | ||
uses: "actions/[email protected]" | ||
with: | ||
path: "${{ env.COMPOSER_CACHE_DIR }}" | ||
key: "php-${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-${{ hashFiles('composer.lock') }}" | ||
restore-keys: "php-${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-" | ||
|
||
- name: "Install ${{ matrix.dependencies }} dependencies with composer" | ||
uses: "ergebnis/.github/actions/composer/[email protected]" | ||
with: | ||
dependencies: "${{ matrix.dependencies }}" | ||
|
||
- name: "Run performance tests with phpbench/phpbench" | ||
run: "vendor/bin/phpbench run --config=phpbench.json src/Test/" | ||
|
||
refactoring: | ||
name: "Refactoring" | ||
|
||
|
@@ -354,3 +502,53 @@ jobs: | |
|
||
- name: "Run vimeo/psalm" | ||
run: "vendor/bin/psalm --config=psalm.xml --output-format=github --shepherd --show-info=false --stats --threads=4" | ||
|
||
tests: | ||
name: "Tests" | ||
|
||
runs-on: "ubuntu-latest" | ||
|
||
strategy: | ||
matrix: | ||
php-version: | ||
- "8.2" | ||
|
||
dependencies: | ||
- "lowest" | ||
- "locked" | ||
- "highest" | ||
|
||
steps: | ||
- name: "Checkout" | ||
uses: "actions/[email protected]" | ||
|
||
- name: "Set up PHP" | ||
uses: "shivammathur/[email protected]" | ||
with: | ||
coverage: "none" | ||
extensions: "none, ctype, dom, json, mbstring, phar, simplexml, tokenizer, xml, xmlwriter" | ||
php-version: "${{ matrix.php-version }}" | ||
|
||
- 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: "Determine composer cache directory" | ||
uses: "ergebnis/.github/actions/composer/[email protected]" | ||
|
||
- name: "Cache dependencies installed with composer" | ||
uses: "actions/[email protected]" | ||
with: | ||
path: "${{ env.COMPOSER_CACHE_DIR }}" | ||
key: "php-${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-${{ hashFiles('composer.lock') }}" | ||
restore-keys: "php-${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-" | ||
|
||
- name: "Install ${{ matrix.dependencies }} dependencies with composer" | ||
uses: "ergebnis/.github/actions/composer/[email protected]" | ||
with: | ||
dependencies: "${{ matrix.dependencies }}" | ||
|
||
- name: "Run tests with phpunit/phpunit" | ||
run: "vendor/bin/phpunit --colors=always --configuration=phpunit.xml" |
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,20 @@ | ||
{ | ||
"ignoreMsiWithNoMutations": true, | ||
"logs": { | ||
"text": ".build/infection/infection-log.txt" | ||
}, | ||
"minCoveredMsi": 100, | ||
"minMsi": 100, | ||
"phpUnit": { | ||
"configDir": "." | ||
}, | ||
"source": { | ||
"directories": [ | ||
"src" | ||
], | ||
"excludes": [ | ||
"Test/" | ||
] | ||
}, | ||
"timeout": 10 | ||
} |
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,5 @@ | ||
{ | ||
"$schema":"vendor/phpbench/phpbench/phpbench.schema.json", | ||
"runner.bootstrap": "vendor/autoload.php", | ||
"runner.file_pattern": "*.php" | ||
} |
Oops, something went wrong.