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 #771

Merged
merged 1 commit into from
Mar 9, 2022
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

This file was deleted.

22 changes: 0 additions & 22 deletions .github/actions/composer/composer/install/action.yaml

This file was deleted.

25 changes: 0 additions & 25 deletions .github/actions/composer/composer/install/run.sh

This file was deleted.

96 changes: 58 additions & 38 deletions .github/workflows/integrate.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,6 @@ on: # yamllint disable-line rule:truthy
branches:
- "main"

env:
PHP_EXTENSIONS: "mbstring"

jobs:
code-coverage:
name: "Code Coverage"
Expand All @@ -33,14 +30,17 @@ jobs:
uses: "shivammathur/[email protected]"
with:
coverage: "xdebug"
extensions: "${{ env.PHP_EXTENSIONS }}"
extensions: "none, ctype, dom, json, mbstring, pdo, pdo_sqlite, 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: "./.github/actions/composer/composer/determine-cache-directory"
uses: "ergebnis/.github/actions/composer/determine-cache-directory@1.3.2"

- name: "Cache dependencies installed with composer"
uses: "actions/[email protected]"
Expand All @@ -50,17 +50,20 @@ jobs:
restore-keys: "php-${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-"

- name: "Install ${{ matrix.dependencies }} dependencies with composer"
uses: "./.github/actions/composer/composer/install"
uses: "ergebnis/.github/actions/composer/install@1.3.2"
with:
dependencies: "${{ matrix.dependencies }}"

- name: "Collect code coverage with Xdebug and phpunit/phpunit"
run: "vendor/bin/phpunit --configuration=test/phpunit.xml --coverage-clover=.build/phpunit/logs/clover.xml --testsuite=unit,integration"

- name: "Send code coverage report to Codecov.io"
env:
CODECOV_TOKEN: "${{ secrets.CODECOV_TOKEN }}"
run: "bash <(curl -s https://codecov.io/bash)"
XDEBUG_MODE: "coverage"
run: "vendor/bin/phpunit --colors=always --configuration=test/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"
Expand All @@ -80,7 +83,7 @@ jobs:
uses: "actions/checkout@v3"

- name: "Lint YAML files"
uses: "ibiqlik/action-yamllint@v3"
uses: "ibiqlik/action-yamllint@v3.1"
with:
config_file: ".yamllint.yaml"
file_or_dir: "."
Expand All @@ -90,14 +93,17 @@ jobs:
uses: "shivammathur/[email protected]"
with:
coverage: "none"
extensions: "${{ env.PHP_EXTENSIONS }}"
extensions: "none, ctype, dom, json, mbstring, pdo, pdo_sqlite, 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: "Validate composer.json and composer.lock"
run: "composer validate --strict"
run: "composer validate --ansi --strict"

- name: "Determine composer cache directory"
uses: "./.github/actions/composer/composer/determine-cache-directory"
uses: "ergebnis/.github/actions/composer/determine-cache-directory@1.3.2"

- name: "Cache dependencies installed with composer"
uses: "actions/[email protected]"
Expand All @@ -107,12 +113,12 @@ jobs:
restore-keys: "php-${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-"

- name: "Install ${{ matrix.dependencies }} dependencies with composer"
uses: "./.github/actions/composer/composer/install"
uses: "ergebnis/.github/actions/composer/install@1.3.2"
with:
dependencies: "${{ matrix.dependencies }}"

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

- name: "Create cache directory for friendsofphp/php-cs-fixer"
run: "mkdir -p .build/php-cs-fixer"
Expand All @@ -125,10 +131,10 @@ jobs:
restore-keys: "php-${{ matrix.php-version }}-php-cs-fixer-"

- name: "Run friendsofphp/php-cs-fixer"
run: "vendor/bin/php-cs-fixer fix --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 --verbose"

- name: "Run friendsofphp/php-cs-fixer on fixtures"
run: "vendor/bin/php-cs-fixer fix --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 --verbose"

dependency-analysis:
name: "Dependency Analysis"
Expand All @@ -151,11 +157,14 @@ jobs:
uses: "shivammathur/[email protected]"
with:
coverage: "none"
extensions: "${{ env.PHP_EXTENSIONS }}"
extensions: "none, ctype, dom, json, mbstring, pdo, pdo_sqlite, 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: "./.github/actions/composer/composer/determine-cache-directory"
uses: "ergebnis/.github/actions/composer/determine-cache-directory@1.3.2"

- name: "Cache dependencies installed with composer"
uses: "actions/[email protected]"
Expand All @@ -165,7 +174,7 @@ jobs:
restore-keys: "php-${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-"

- name: "Install ${{ matrix.dependencies }} dependencies with composer"
uses: "./.github/actions/composer/composer/install"
uses: "ergebnis/.github/actions/composer/install@1.3.2"
with:
dependencies: "${{ matrix.dependencies }}"

Expand Down Expand Up @@ -193,11 +202,14 @@ jobs:
uses: "shivammathur/[email protected]"
with:
coverage: "xdebug"
extensions: "${{ env.PHP_EXTENSIONS }}"
extensions: "none, ctype, dom, json, mbstring, pdo, pdo_sqlite, 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: "./.github/actions/composer/composer/determine-cache-directory"
uses: "ergebnis/.github/actions/composer/determine-cache-directory@1.3.2"

- name: "Cache dependencies installed with composer"
uses: "actions/[email protected]"
Expand All @@ -207,12 +219,14 @@ jobs:
restore-keys: "php-${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-"

- name: "Install ${{ matrix.dependencies }} dependencies with composer"
uses: "./.github/actions/composer/composer/install"
uses: "ergebnis/.github/actions/composer/install@1.3.2"
with:
dependencies: "${{ matrix.dependencies }}"

- name: "Run mutation tests with Xdebug and infection/infection"
run: "vendor/bin/infection --configuration=infection.json"
env:
XDEBUG_MODE: "coverage"
run: "vendor/bin/infection --ansi --configuration=infection.json --logger-github"

static-code-analysis:
name: "Static Code Analysis"
Expand All @@ -235,11 +249,14 @@ jobs:
uses: "shivammathur/[email protected]"
with:
coverage: "none"
extensions: "${{ env.PHP_EXTENSIONS }}"
extensions: "none, ctype, curl, dom, json, mbstring, pcntl, pdo, pdo_sqlite, phar, posix, 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: "./.github/actions/composer/composer/determine-cache-directory"
uses: "ergebnis/.github/actions/composer/determine-cache-directory@1.3.2"

- name: "Cache dependencies installed with composer"
uses: "actions/[email protected]"
Expand All @@ -249,21 +266,21 @@ jobs:
restore-keys: "php-${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-"

- name: "Install ${{ matrix.dependencies }} dependencies with composer"
uses: "./.github/actions/composer/composer/install"
uses: "ergebnis/.github/actions/composer/install@1.3.2"
with:
dependencies: "${{ matrix.dependencies }}"

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

- name: "Run phpstan/phpstan"
run: "vendor/bin/phpstan analyse --configuration=phpstan.neon --memory-limit=-1"
run: "vendor/bin/phpstan --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 --diff --shepherd --show-info=false --stats --threads=4"
run: "vendor/bin/psalm --config=psalm.xml --output-format=github --shepherd --show-info=false --stats --threads=4"

tests:
name: "Tests"
Expand All @@ -290,14 +307,17 @@ jobs:
uses: "shivammathur/[email protected]"
with:
coverage: "none"
extensions: "${{ env.PHP_EXTENSIONS }}"
extensions: "none, ctype, dom, json, mbstring, pdo, pdo_sqlite, 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: "./.github/actions/composer/composer/determine-cache-directory"
uses: "ergebnis/.github/actions/composer/determine-cache-directory@1.3.2"

- name: "Cache dependencies installed with composer"
uses: "actions/[email protected]"
Expand All @@ -307,7 +327,7 @@ jobs:
restore-keys: "php-${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-"

- name: "Install ${{ matrix.dependencies }} dependencies with composer"
uses: "./.github/actions/composer/composer/install"
uses: "ergebnis/.github/actions/composer/install@1.3.2"
with:
dependencies: "${{ matrix.dependencies }}"

Expand All @@ -318,13 +338,13 @@ jobs:
run: "vendor/bin/doctrine orm:validate-schema --skip-sync"

- name: "Run unit tests with phpunit/phpunit"
run: "vendor/bin/phpunit --configuration=test/phpunit.xml --testsuite=unit"
run: "vendor/bin/phpunit --colors=always --configuration=test/phpunit.xml --testsuite=unit"

- name: "Run integration tests with phpunit/phpunit"
run: "vendor/bin/phpunit --configuration=test/phpunit.xml --testsuite=integration"
run: "vendor/bin/phpunit --colors=always --configuration=test/phpunit.xml --testsuite=integration"

- name: "Run auto-review tests for examples with phpunit/phpunit"
run: "vendor/bin/phpunit --configuration=example/test/AutoReview/phpunit.xml"
run: "vendor/bin/phpunit --colors=always --configuration=example/test/AutoReview/phpunit.xml"

- name: "Run unit tests for examples with phpunit/phpunit"
run: "vendor/bin/phpunit --configuration=example/test/Unit/phpunit.xml"
run: "vendor/bin/phpunit --colors=always --configuration=example/test/Unit/phpunit.xml"
Loading