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

Fix: Order #456

Merged
merged 1 commit into from
Dec 30, 2021
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
Fix: Order
  • Loading branch information
localheinz committed Dec 30, 2021
commit b70725d47aa21ba04e6877f2a3fb5b3d9457cbab
24 changes: 12 additions & 12 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,18 @@ $ make dependency-analysis

to run a dependency analysis.

## Mutation Tests

We are using [`infection/infection`](https://github.com/infection/infection) to ensure a minimum quality of the tests.

Enable `pcov` or `Xdebug` and run

```sh
$ make mutation-tests
```

to run mutation tests.

## Static Code Analysis

We are using [`vimeo/psalm`](https://github.com/vimeo/psalm) to statically analyze the code.
Expand Down Expand Up @@ -83,18 +95,6 @@ $ make tests

to run all the tests.

## Mutation Tests

We are using [`infection/infection`](https://github.com/infection/infection) to ensure a minimum quality of the tests.

Enable `pcov` or `Xdebug` and run

```sh
$ make mutation-tests
```

to run mutation tests.

## Extra lazy?

Run
Expand Down
160 changes: 80 additions & 80 deletions .github/workflows/integrate.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ env:
PHP_EXTENSIONS: "mbstring, tokenizer"

jobs:
coding-standards:
name: "Coding Standards"
code-coverage:
name: "Code Coverage"

runs-on: "ubuntu-latest"

Expand All @@ -31,22 +31,15 @@ jobs:
- name: "Checkout"
uses: "actions/checkout@v2.4.0"

- name: "Lint YAML files"
uses: "ibiqlik/action-yamllint@v3"
with:
config_file: ".yamllint.yaml"
file_or_dir: "."
strict: true

- name: "Set up PHP"
uses: "shivammathur/setup-php@2.16.0"
with:
coverage: "none"
coverage: "xdebug"
extensions: "${{ env.PHP_EXTENSIONS }}"
php-version: "${{ matrix.php-version }}"

- name: "Validate composer.json and composer.lock"
run: "composer validate --strict"
- 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"
Expand All @@ -66,24 +59,16 @@ jobs:
with:
dependencies: "${{ matrix.dependencies }}"

- name: "Run ergebnis/composer-normalize"
run: "composer normalize --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/cache@v2.1.7"
with:
path: ".build/php-cs-fixer"
key: "php-${{ matrix.php-version }}-php-cs-fixer-${{ github.sha }}"
restore-keys: "php-${{ matrix.php-version }}-php-cs-fixer-"
- name: "Collect code coverage with Xdebug and phpunit/phpunit"
run: "vendor/bin/phpunit --configuration=test/Unit/phpunit.xml --coverage-clover=.build/phpunit/logs/clover.xml"

- name: "Run friendsofphp/php-cs-fixer"
run: "vendor/bin/php-cs-fixer fix --config=.php_cs --diff --diff-format=udiff --dry-run --verbose"
- name: "Send code coverage report to Codecov.io"
env:
CODECOV_TOKEN: "${{ secrets.CODECOV_TOKEN }}"
run: "bash <(curl -s https://codecov.io/bash)"

dependency-analysis:
name: "Dependency Analysis"
coding-standards:
name: "Coding Standards"

runs-on: "ubuntu-latest"

Expand All @@ -99,13 +84,23 @@ jobs:
- name: "Checkout"
uses: "actions/checkout@v2.4.0"

- name: "Lint YAML files"
uses: "ibiqlik/action-yamllint@v3"
with:
config_file: ".yamllint.yaml"
file_or_dir: "."
strict: true

- name: "Set up PHP"
uses: "shivammathur/setup-php@2.16.0"
with:
coverage: "none"
extensions: "${{ env.PHP_EXTENSIONS }}"
php-version: "${{ matrix.php-version }}"

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

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

Expand All @@ -124,11 +119,24 @@ jobs:
with:
dependencies: "${{ matrix.dependencies }}"

- name: "Run maglnet/composer-require-checker"
run: ".phive/composer-require-checker check --config-file=$(pwd)/composer-require-checker.json"
- name: "Run ergebnis/composer-normalize"
run: "composer normalize --dry-run"

static-code-analysis:
name: "Static Code Analysis"
- 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/cache@v2.1.7"
with:
path: ".build/php-cs-fixer"
key: "php-${{ matrix.php-version }}-php-cs-fixer-${{ github.sha }}"
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 --diff --diff-format=udiff --dry-run --verbose"

dependency-analysis:
name: "Dependency Analysis"

runs-on: "ubuntu-latest"

Expand Down Expand Up @@ -169,36 +177,21 @@ jobs:
with:
dependencies: "${{ matrix.dependencies }}"

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

- name: "Cache cache directory for vimeo/psalm"
uses: "actions/cache@v2.1.7"
with:
path: ".build/psalm"
key: "php-${{ matrix.php-version }}-psalm-${{ github.sha }}"
restore-keys: "php-${{ matrix.php-version }}-psalm-"

- name: "Run vimeo/psalm"
run: "vendor/bin/psalm --config=psalm.xml --diff --shepherd --show-info=false --stats --threads=4"
- name: "Run maglnet/composer-require-checker"
run: ".phive/composer-require-checker check --config-file=$(pwd)/composer-require-checker.json"

tests:
name: "Tests"
mutation-tests:
name: "Mutation Tests"

runs-on: "ubuntu-latest"

strategy:
matrix:
php-version:
- "7.2"
- "7.3"
- "7.4"
- "8.0"

dependencies:
- "lowest"
- "locked"
- "highest"

steps:
- name: "Checkout"
Expand All @@ -207,13 +200,10 @@ jobs:
- name: "Set up PHP"
uses: "shivammathur/setup-php@2.16.0"
with:
coverage: "none"
coverage: "xdebug"
extensions: "${{ env.PHP_EXTENSIONS }}"
php-version: "${{ matrix.php-version }}"

- 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"

Expand All @@ -232,17 +222,11 @@ jobs:
with:
dependencies: "${{ matrix.dependencies }}"

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

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

- name: "Run integration tests with phpunit/phpunit"
run: "vendor/bin/phpunit --configuration=test/Integration/phpunit.xml"
- name: "Run mutation tests with Xdebug and infection/infection"
run: "vendor/bin/infection --ignore-msi-with-no-mutations --min-covered-msi=${{ env.MIN_COVERED_MSI }} --min-msi=${{ env.MIN_MSI }}"

code-coverage:
name: "Code Coverage"
static-code-analysis:
name: "Static Code Analysis"

runs-on: "ubuntu-latest"

Expand All @@ -261,13 +245,10 @@ jobs:
- name: "Set up PHP"
uses: "shivammathur/setup-php@2.16.0"
with:
coverage: "xdebug"
coverage: "none"
extensions: "${{ env.PHP_EXTENSIONS }}"
php-version: "${{ matrix.php-version }}"

- 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"

Expand All @@ -286,26 +267,36 @@ jobs:
with:
dependencies: "${{ matrix.dependencies }}"

- name: "Collect code coverage with Xdebug and phpunit/phpunit"
run: "vendor/bin/phpunit --configuration=test/Unit/phpunit.xml --coverage-clover=.build/phpunit/logs/clover.xml"
- name: "Create cache directory for vimeo/psalm"
run: "mkdir -p .build/psalm"

- name: "Send code coverage report to Codecov.io"
env:
CODECOV_TOKEN: "${{ secrets.CODECOV_TOKEN }}"
run: "bash <(curl -s https://codecov.io/bash)"
- name: "Cache cache directory for vimeo/psalm"
uses: "actions/cache@v2.1.7"
with:
path: ".build/psalm"
key: "php-${{ matrix.php-version }}-psalm-${{ github.sha }}"
restore-keys: "php-${{ matrix.php-version }}-psalm-"

mutation-tests:
name: "Mutation Tests"
- name: "Run vimeo/psalm"
run: "vendor/bin/psalm --config=psalm.xml --diff --shepherd --show-info=false --stats --threads=4"

tests:
name: "Tests"

runs-on: "ubuntu-latest"

strategy:
matrix:
php-version:
- "7.2"
- "7.3"
- "7.4"
- "8.0"

dependencies:
- "lowest"
- "locked"
- "highest"

steps:
- name: "Checkout"
Expand All @@ -314,10 +305,13 @@ jobs:
- name: "Set up PHP"
uses: "shivammathur/setup-php@2.16.0"
with:
coverage: "xdebug"
coverage: "none"
extensions: "${{ env.PHP_EXTENSIONS }}"
php-version: "${{ matrix.php-version }}"

- 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"

Expand All @@ -336,5 +330,11 @@ jobs:
with:
dependencies: "${{ matrix.dependencies }}"

- name: "Run mutation tests with Xdebug and infection/infection"
run: "vendor/bin/infection --ignore-msi-with-no-mutations --min-covered-msi=${{ env.MIN_COVERED_MSI }} --min-msi=${{ env.MIN_MSI }}"
- name: "Run auto-review tests with phpunit/phpunit"
run: "vendor/bin/phpunit --configuration=test/AutoReview/phpunit.xml"

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

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