Skip to content

Commit

Permalink
Fix: Order
Browse files Browse the repository at this point in the history
  • Loading branch information
localheinz committed Dec 27, 2021
1 parent b4022dd commit b02baf8
Show file tree
Hide file tree
Showing 2 changed files with 98 additions and 98 deletions.
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 `Xdebug` and run

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

to run mutation tests.

## Static Code Analysis

We are using [`phpstan/phpstan`](https://github.com/phpstan/phpstan) and [`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 `Xdebug` and run

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

to run mutation tests.

## Extra lazy?

Run
Expand Down
172 changes: 86 additions & 86 deletions .github/workflows/integrate.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,56 @@ env:
PHP_EXTENSIONS: "mbstring"

jobs:
code-coverage:
name: "Code Coverage"

runs-on: "ubuntu-latest"

strategy:
matrix:
php-version:
- "7.4"

dependencies:
- "locked"

steps:
- name: "Checkout"
uses: "actions/checkout@v2.4.0"

- name: "Install PHP with extensions"
uses: "shivammathur/setup-php@2.16.0"
with:
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"

- name: "Cache dependencies installed with composer"
uses: "actions/cache@v2.1.7"
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: "./.github/actions/composer/composer/install"
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)"

coding-standards:
name: "Coding Standards"

Expand Down Expand Up @@ -122,8 +172,8 @@ jobs:
- name: "Run maglnet/composer-require-checker"
run: ".phive/composer-require-checker check --config-file=$(pwd)/composer-require-checker.json"

static-code-analysis:
name: "Static Code Analysis"
mutation-tests:
name: "Mutation Tests"

runs-on: "ubuntu-latest"

Expand All @@ -142,7 +192,7 @@ jobs:
- name: "Install PHP with extensions"
uses: "shivammathur/setup-php@2.16.0"
with:
coverage: "none"
coverage: "xdebug"
extensions: "${{ env.PHP_EXTENSIONS }}"
php-version: "${{ matrix.php-version }}"

Expand All @@ -161,34 +211,21 @@ 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 analyse --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"
- name: "Run mutation tests with Xdebug and infection/infection"
run: "vendor/bin/infection --configuration=infection.json"

tests:
name: "Tests"
static-code-analysis:
name: "Static Code Analysis"

runs-on: "ubuntu-latest"

strategy:
matrix:
php-version:
- "7.4"
- "8.0"
- "8.1"

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

steps:
- name: "Checkout"
Expand All @@ -201,9 +238,6 @@ jobs:
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 @@ -219,39 +253,34 @@ jobs:
with:
dependencies: "${{ matrix.dependencies }}"

- name: "Show Doctrine mapping information"
run: "vendor/bin/doctrine orm:info"

- name: "Validate Doctrine mapping"
run: "vendor/bin/doctrine orm:validate-schema --skip-sync"

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

- name: "Run unit tests with phpunit/phpunit"
run: "vendor/bin/phpunit --configuration=test/phpunit.xml --testsuite=unit"
- name: "Create cache directory for phpstan/phpstan"
run: "mkdir -p .build/phpstan"

- name: "Run integration tests with phpunit/phpunit"
run: "vendor/bin/phpunit --configuration=test/phpunit.xml --testsuite=integration"
- name: "Run phpstan/phpstan"
run: "vendor/bin/phpstan analyse --configuration=phpstan.neon --memory-limit=-1"

- name: "Run auto-review tests for examples with phpunit/phpunit"
run: "vendor/bin/phpunit --configuration=example/test/AutoReview/phpunit.xml"
- name: "Create cache directory for vimeo/psalm"
run: "mkdir -p .build/psalm"

- name: "Run unit tests for examples with phpunit/phpunit"
run: "vendor/bin/phpunit --configuration=example/test/Unit/phpunit.xml"
- name: "Run vimeo/psalm"
run: "vendor/bin/psalm --config=psalm.xml --diff --shepherd --show-info=false --stats --threads=4"

code-coverage:
name: "Code Coverage"
tests:
name: "Tests"

runs-on: "ubuntu-latest"

strategy:
matrix:
php-version:
- "7.4"
- "8.0"
- "8.1"

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

steps:
- name: "Checkout"
Expand All @@ -260,7 +289,7 @@ jobs:
- name: "Install PHP with extensions"
uses: "shivammathur/setup-php@2.16.0"
with:
coverage: "xdebug"
coverage: "none"
extensions: "${{ env.PHP_EXTENSIONS }}"
php-version: "${{ matrix.php-version }}"

Expand All @@ -282,52 +311,23 @@ jobs:
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)"

mutation-tests:
name: "Mutation Tests"

runs-on: "ubuntu-latest"

strategy:
matrix:
php-version:
- "7.4"

dependencies:
- "locked"
- name: "Show Doctrine mapping information"
run: "vendor/bin/doctrine orm:info"

steps:
- name: "Checkout"
uses: "actions/checkout@v2.4.0"
- name: "Validate Doctrine mapping"
run: "vendor/bin/doctrine orm:validate-schema --skip-sync"

- name: "Install PHP with extensions"
uses: "shivammathur/setup-php@2.16.0"
with:
coverage: "xdebug"
extensions: "${{ env.PHP_EXTENSIONS }}"
php-version: "${{ matrix.php-version }}"
- name: "Run auto-review tests with phpunit/phpunit"
run: "vendor/bin/phpunit --configuration=test/phpunit.xml --testsuite=auto-review"

- name: "Determine composer cache directory"
uses: "./.github/actions/composer/composer/determine-cache-directory"
- name: "Run unit tests with phpunit/phpunit"
run: "vendor/bin/phpunit --configuration=test/phpunit.xml --testsuite=unit"

- name: "Cache dependencies installed with composer"
uses: "actions/cache@v2.1.7"
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: "Run integration tests with phpunit/phpunit"
run: "vendor/bin/phpunit --configuration=test/phpunit.xml --testsuite=integration"

- name: "Install ${{ matrix.dependencies }} dependencies with composer"
uses: "./.github/actions/composer/composer/install"
with:
dependencies: "${{ matrix.dependencies }}"
- name: "Run auto-review tests for examples with phpunit/phpunit"
run: "vendor/bin/phpunit --configuration=example/test/AutoReview/phpunit.xml"

- name: "Run mutation tests with Xdebug and infection/infection"
run: "vendor/bin/infection --configuration=infection.json"
- name: "Run unit tests for examples with phpunit/phpunit"
run: "vendor/bin/phpunit --configuration=example/test/Unit/phpunit.xml"

0 comments on commit b02baf8

Please sign in to comment.