Skip to content

Commit 04a1452

Browse files
committed
add psaml and infection workflows
1 parent 3ddbd21 commit 04a1452

15 files changed

+431
-15
lines changed
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
# https://help.github.com/en/categories/automating-your-workflow-with-github-actions
2+
3+
name: "Check Coding Standards"
4+
5+
on:
6+
pull_request:
7+
push:
8+
branches:
9+
- "3.x.x"
10+
11+
jobs:
12+
coding-standards:
13+
name: "Check Coding Standards"
14+
15+
runs-on: ${{ matrix.operating-system }}
16+
17+
strategy:
18+
matrix:
19+
dependencies:
20+
- "locked"
21+
php-version:
22+
- "7.4"
23+
operating-system:
24+
- "ubuntu-latest"
25+
26+
steps:
27+
- name: "Checkout"
28+
uses: "actions/checkout@v2"
29+
30+
- name: "Install PHP"
31+
uses: "shivammathur/setup-php@v2"
32+
with:
33+
coverage: "pcov"
34+
php-version: "${{ matrix.php-version }}"
35+
ini-values: memory_limit=-1
36+
37+
- name: "Cache dependencies"
38+
uses: "actions/cache@v2"
39+
with:
40+
path: |
41+
~/.composer/cache
42+
vendor
43+
key: "php-${{ matrix.php-version }}-${{ matrix.dependencies }}"
44+
restore-keys: "php-${{ matrix.php-version }}-${{ matrix.dependencies }}"
45+
46+
- name: "Install lowest dependencies"
47+
if: ${{ matrix.dependencies == 'lowest' }}
48+
run: "composer update --prefer-lowest --no-interaction --no-progress --no-suggest"
49+
50+
- name: "Install highest dependencies"
51+
if: ${{ matrix.dependencies == 'highest' }}
52+
run: "composer update --no-interaction --no-progress --no-suggest"
53+
54+
- name: "Install locked dependencies"
55+
if: ${{ matrix.dependencies == 'locked' }}
56+
run: "composer install --no-interaction --no-progress --no-suggest"
57+
58+
- name: "Coding Standard"
59+
run: "vendor/bin/phpcs"

.github/workflows/mutation-tests.yml

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
# https://help.github.com/en/categories/automating-your-workflow-with-github-actions
2+
3+
name: "Mutation tests"
4+
5+
on:
6+
pull_request:
7+
push:
8+
branches:
9+
- "3.x.x"
10+
11+
jobs:
12+
mutation-tests:
13+
name: "Mutation tests"
14+
15+
runs-on: ${{ matrix.operating-system }}
16+
17+
strategy:
18+
matrix:
19+
dependencies:
20+
- "locked"
21+
php-version:
22+
- "7.4"
23+
operating-system:
24+
- "ubuntu-latest"
25+
26+
steps:
27+
- name: "Checkout"
28+
uses: "actions/checkout@v2"
29+
30+
- name: "Install PHP"
31+
uses: "shivammathur/setup-php@v2"
32+
with:
33+
coverage: "pcov"
34+
php-version: "${{ matrix.php-version }}"
35+
ini-values: memory_limit=-1
36+
37+
- name: "Cache dependencies"
38+
uses: "actions/cache@v2"
39+
with:
40+
path: |
41+
~/.composer/cache
42+
vendor
43+
key: "php-${{ matrix.php-version }}-${{ matrix.dependencies }}"
44+
restore-keys: "php-${{ matrix.php-version }}-${{ matrix.dependencies }}"
45+
46+
- name: "Install lowest dependencies"
47+
if: ${{ matrix.dependencies == 'lowest' }}
48+
run: "composer update --prefer-lowest --no-interaction --no-progress --no-suggest"
49+
50+
- name: "Install highest dependencies"
51+
if: ${{ matrix.dependencies == 'highest' }}
52+
run: "composer update --no-interaction --no-progress --no-suggest"
53+
54+
- name: "Install locked dependencies"
55+
if: ${{ matrix.dependencies == 'locked' }}
56+
run: "composer install --no-interaction --no-progress --no-suggest"
57+
58+
- name: "Infection"
59+
run: "vendor/bin/infection"
60+
env:
61+
INFECTION_BADGE_API_KEY: ${{ secrets.INFECTION_BADGE_API_KEY }}
62+
STRYKER_DASHBOARD_API_KEY: ${{ secrets.STRYKER_DASHBOARD_API_KEY }}
63+

.github/workflows/phpunit.yml

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
# https://help.github.com/en/categories/automating-your-workflow-with-github-actions
2+
3+
name: "PHPUnit tests"
4+
5+
on:
6+
pull_request:
7+
push:
8+
branches:
9+
- "3.x.x"
10+
11+
jobs:
12+
phpunit:
13+
name: "PHPUnit tests"
14+
15+
runs-on: ${{ matrix.operating-system }}
16+
17+
strategy:
18+
matrix:
19+
dependencies:
20+
- "locked"
21+
php-version:
22+
- "7.4"
23+
operating-system:
24+
- "ubuntu-latest"
25+
26+
steps:
27+
- name: "Checkout"
28+
uses: "actions/checkout@v2"
29+
30+
- name: "Install PHP"
31+
uses: "shivammathur/setup-php@v2"
32+
with:
33+
coverage: "pcov"
34+
php-version: "${{ matrix.php-version }}"
35+
ini-values: memory_limit=-1
36+
37+
- name: "Cache dependencies"
38+
uses: "actions/cache@v2"
39+
with:
40+
path: |
41+
~/.composer/cache
42+
vendor
43+
key: "php-${{ matrix.php-version }}-${{ matrix.dependencies }}"
44+
restore-keys: "php-${{ matrix.php-version }}-${{ matrix.dependencies }}"
45+
46+
- name: "Install lowest dependencies"
47+
if: ${{ matrix.dependencies == 'lowest' }}
48+
run: "composer update --prefer-lowest --no-interaction --no-progress --no-suggest"
49+
50+
- name: "Install highest dependencies"
51+
if: ${{ matrix.dependencies == 'highest' }}
52+
run: "composer update --no-interaction --no-progress --no-suggest"
53+
54+
- name: "Install locked dependencies"
55+
if: ${{ matrix.dependencies == 'locked' }}
56+
run: "composer install --no-interaction --no-progress --no-suggest"
57+
58+
- name: "Tests"
59+
run: "vendor/bin/phpunit"

.github/workflows/psalm.yml

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
# https://help.github.com/en/categories/automating-your-workflow-with-github-actions
2+
3+
name: "Static Analysis by Psalm"
4+
5+
on:
6+
pull_request:
7+
push:
8+
branches:
9+
- "3.x.x"
10+
11+
jobs:
12+
static-analysis-psalm:
13+
name: "Static Analysis by Psalm"
14+
15+
runs-on: ${{ matrix.operating-system }}
16+
17+
strategy:
18+
matrix:
19+
dependencies:
20+
- "locked"
21+
php-version:
22+
- "7.4"
23+
operating-system:
24+
- "ubuntu-latest"
25+
26+
steps:
27+
- name: "Checkout"
28+
uses: "actions/checkout@v2"
29+
30+
- name: "Install PHP"
31+
uses: "shivammathur/setup-php@v2"
32+
with:
33+
coverage: "pcov"
34+
php-version: "${{ matrix.php-version }}"
35+
ini-values: memory_limit=-1
36+
37+
- name: "Cache dependencies"
38+
uses: "actions/cache@v2"
39+
with:
40+
path: |
41+
~/.composer/cache
42+
vendor
43+
key: "php-${{ matrix.php-version }}-${{ matrix.dependencies }}"
44+
restore-keys: "php-${{ matrix.php-version }}-${{ matrix.dependencies }}"
45+
46+
- name: "Install lowest dependencies"
47+
if: ${{ matrix.dependencies == 'lowest' }}
48+
run: "composer update --prefer-lowest --no-interaction --no-progress --no-suggest"
49+
50+
- name: "Install highest dependencies"
51+
if: ${{ matrix.dependencies == 'highest' }}
52+
run: "composer update --no-interaction --no-progress --no-suggest"
53+
54+
- name: "Install locked dependencies"
55+
if: ${{ matrix.dependencies == 'locked' }}
56+
run: "composer install --no-interaction --no-progress --no-suggest"
57+
58+
- name: "psalm"
59+
run: "vendor/bin/psalm --shepherd --stats"
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
# https://help.github.com/en/categories/automating-your-workflow-with-github-actions
2+
3+
name: "Automatic Releases"
4+
5+
on:
6+
milestone:
7+
types:
8+
- "closed"
9+
10+
jobs:
11+
release:
12+
name: "GIT tag, release & create merge-up PR"
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- name: "Checkout"
17+
uses: "actions/checkout@v2"
18+
19+
- name: "Release"
20+
uses: "laminas/automatic-releases@v1"
21+
with:
22+
command-name: "laminas:automatic-releases:release"
23+
env:
24+
"GITHUB_TOKEN": ${{ secrets.GITHUB_TOKEN }}
25+
"SIGNING_SECRET_KEY": ${{ secrets.SIGNING_SECRET_KEY }}
26+
"GIT_AUTHOR_NAME": ${{ secrets.GIT_AUTHOR_NAME }}
27+
"GIT_AUTHOR_EMAIL": ${{ secrets.GIT_AUTHOR_EMAIL }}
28+
29+
- name: "Create Merge-Up Pull Request"
30+
uses: "laminas/automatic-releases@v1"
31+
with:
32+
command-name: "laminas:automatic-releases:create-merge-up-pull-request"
33+
env:
34+
"GITHUB_TOKEN": ${{ secrets.GITHUB_TOKEN }}
35+
"SIGNING_SECRET_KEY": ${{ secrets.SIGNING_SECRET_KEY }}
36+
"GIT_AUTHOR_NAME": ${{ secrets.GIT_AUTHOR_NAME }}
37+
"GIT_AUTHOR_EMAIL": ${{ secrets.GIT_AUTHOR_EMAIL }}
38+
39+
- name: "Create and/or Switch to new Release Branch"
40+
uses: "laminas/automatic-releases@v1"
41+
with:
42+
command-name: "laminas:automatic-releases:switch-default-branch-to-next-minor"
43+
env:
44+
"GITHUB_TOKEN": ${{ secrets.ORGANIZATION_ADMIN_TOKEN }}
45+
"SIGNING_SECRET_KEY": ${{ secrets.SIGNING_SECRET_KEY }}
46+
"GIT_AUTHOR_NAME": ${{ secrets.GIT_AUTHOR_NAME }}
47+
"GIT_AUTHOR_EMAIL": ${{ secrets.GIT_AUTHOR_EMAIL }}
48+
49+
- name: "Bump Changelog Version On Originating Release Branch"
50+
uses: "laminas/automatic-releases@v1"
51+
with:
52+
command-name: "laminas:automatic-releases:bump-changelog"
53+
env:
54+
"GITHUB_TOKEN": ${{ secrets.GITHUB_TOKEN }}
55+
"SIGNING_SECRET_KEY": ${{ secrets.SIGNING_SECRET_KEY }}
56+
"GIT_AUTHOR_NAME": ${{ secrets.GIT_AUTHOR_NAME }}
57+
"GIT_AUTHOR_EMAIL": ${{ secrets.GIT_AUTHOR_EMAIL }}
58+
59+
- name: "Create new milestones"
60+
uses: "laminas/automatic-releases@v1"
61+
with:
62+
command-name: "laminas:automatic-releases:create-milestones"
63+
env:
64+
"GITHUB_TOKEN": ${{ secrets.GITHUB_TOKEN }}
65+
"SIGNING_SECRET_KEY": ${{ secrets.SIGNING_SECRET_KEY }}
66+
"GIT_AUTHOR_NAME": ${{ secrets.GIT_AUTHOR_NAME }}
67+
"GIT_AUTHOR_EMAIL": ${{ secrets.GIT_AUTHOR_EMAIL }}

composer.json

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "antidot-fw/event-dispatcher",
3-
"description": "Antidot Framework event dispatcher library",
3+
"description": "Antidot Framework PSR-14 event dispatcher library",
44
"keywords": [
55
"psr-11",
66
"psr-14"
@@ -13,15 +13,17 @@
1313
}
1414
],
1515
"require": {
16-
"php": "^7.4.0|^8.0",
16+
"php": "^7.4.0",
1717
"psr/event-dispatcher": "^1.0"
1818
},
1919
"require-dev": {
20-
"phpro/grumphp": "~0.17 || ~1.0",
21-
"phpstan/phpstan": "^0.11.5 || ^0.12.0",
20+
"infection/infection": "^0.21.0",
21+
"phpro/grumphp": "^1.0",
22+
"phpstan/phpstan": "^0.12",
2223
"phpunit/phpunit": "^8.0 || ^9.0",
2324
"squizlabs/php_codesniffer": "^3.4",
24-
"symfony/var-dumper": "^4.2 || ^5.0"
25+
"symfony/var-dumper": "^4.2 || ^5.0",
26+
"vimeo/psalm": "^4.4"
2527
},
2628
"autoload": {
2729
"psr-4": {
@@ -37,12 +39,16 @@
3739
"check-all": [
3840
"@cs-check",
3941
"@test",
40-
"@inspect"
42+
"@inspect",
43+
"@psalm",
44+
"@infection"
4145
],
4246
"cs-check": "phpcs src --colors",
4347
"cs-fix": "phpcbf src --colors",
4448
"inspect": "phpstan analyse src -l7 --ansi",
45-
"test": "phpunit --colors=always"
49+
"test": "phpunit --colors=always",
50+
"psalm": "psalm",
51+
"infection": "XDEBUG_MODE=coverage infection"
4652
},
4753
"config": {
4854
"sort-packages": true

infection.json.dist

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"source": {
3+
"directories": [
4+
"src"
5+
]
6+
},
7+
"mutators": {
8+
"@default": true
9+
},
10+
"logs": {
11+
"badge": {
12+
"branch": "1.x.x"
13+
},
14+
"text": "infection.log"
15+
}
16+
}

psalm.xml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<?xml version="1.0"?>
2+
<psalm
3+
errorLevel="1"
4+
resolveFromConfigFile="true"
5+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
6+
xmlns="https://getpsalm.org/schema/config"
7+
xsi:schemaLocation="https://getpsalm.org/schema/config vendor/vimeo/psalm/config.xsd"
8+
>
9+
<projectFiles>
10+
<directory name="src" />
11+
<ignoreFiles>
12+
<directory name="vendor" />
13+
</ignoreFiles>
14+
</projectFiles>
15+
</psalm>

0 commit comments

Comments
 (0)