Skip to content

Commit 494b6c3

Browse files
committed
add ci
1 parent 0b52e5b commit 494b6c3

13 files changed

+3447
-5858
lines changed
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# https://help.github.com/en/categories/automating-your-workflow-with-github-actions
2+
3+
name: "Check Coding Standard"
4+
5+
on:
6+
pull_request:
7+
push:
8+
branches:
9+
- "[0-9]+.[0-9]+.x"
10+
- "renovate/*"
11+
12+
jobs:
13+
static-analysis-coding-standard:
14+
name: "Static Analysis by patchlevel/coding-standard"
15+
16+
runs-on: ${{ matrix.operating-system }}
17+
18+
strategy:
19+
matrix:
20+
dependencies:
21+
- "locked"
22+
php-version:
23+
- "8.3"
24+
operating-system:
25+
- "ubuntu-latest"
26+
27+
steps:
28+
- name: "Checkout"
29+
uses: actions/checkout@v4
30+
31+
- name: "Install PHP"
32+
uses: "shivammathur/setup-php@2.31.1"
33+
with:
34+
coverage: "pcov"
35+
php-version: "${{ matrix.php-version }}"
36+
ini-values: memory_limit=-1
37+
extensions: pdo_sqlite
38+
39+
- uses: ramsey/composer-install@3.0.0
40+
with:
41+
dependency-versions: ${{ matrix.dependencies }}
42+
43+
- name: "Coding Standard"
44+
run: "vendor/bin/phpcs"
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Notify new release
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
env:
8+
NOTIFY_MESSAGE: |
9+
We released ${{ github.event.release.tag_name }} of ${{ github.event.repository.name }}! See here for the changelog: ${{ github.event.release.html_url }}
10+
#PHP #DDD #EventSourcing #Symfony
11+
12+
jobs:
13+
twitter:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: eomm/why-don-t-you-tweet@v2
17+
if: ${{ !github.event.repository.private }}
18+
with:
19+
# GitHub event payload
20+
# https://docs.github.com/en/developers/webhooks-and-events/webhooks/webhook-events-and-payloads#release
21+
tweet-message: ${{ env.NOTIFY_MESSAGE }}
22+
env:
23+
TWITTER_CONSUMER_API_KEY: ${{ secrets.TWITTER_CONSUMER_API_KEY }}
24+
TWITTER_CONSUMER_API_SECRET: ${{ secrets.TWITTER_CONSUMER_API_SECRET }}
25+
TWITTER_ACCESS_TOKEN: ${{ secrets.TWITTER_ACCESS_TOKEN }}
26+
TWITTER_ACCESS_TOKEN_SECRET: ${{ secrets.TWITTER_ACCESS_TOKEN_SECRET }}
27+
28+
mastodon:
29+
runs-on: ubuntu-latest
30+
steps:
31+
- uses: cbrgm/mastodon-github-action@v2
32+
if: ${{ !github.event.repository.private }}
33+
with:
34+
message: ${{ env.NOTIFY_MESSAGE }}
35+
access-token: ${{ secrets.MASTODON_ACCESS_TOKEN }}
36+
url: ${{ secrets.MASTODON_URL }}

.github/workflows/phpstan.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# https://help.github.com/en/categories/automating-your-workflow-with-github-actions
2+
3+
name: "Static Analysis by PHPStan"
4+
5+
on:
6+
pull_request:
7+
push:
8+
branches:
9+
- "[0-9]+.[0-9]+.x"
10+
- "renovate/*"
11+
12+
jobs:
13+
static-analysis-phpstan:
14+
name: "Static Analysis by PHPStan"
15+
16+
runs-on: ${{ matrix.operating-system }}
17+
18+
strategy:
19+
matrix:
20+
dependencies:
21+
- "locked"
22+
php-version:
23+
- "8.3"
24+
operating-system:
25+
- "ubuntu-latest"
26+
27+
steps:
28+
- name: "Checkout"
29+
uses: actions/checkout@v4
30+
31+
- name: "Install PHP"
32+
uses: "shivammathur/setup-php@2.31.1"
33+
with:
34+
coverage: "pcov"
35+
php-version: "${{ matrix.php-version }}"
36+
ini-values: memory_limit=-1
37+
extensions: pdo_sqlite
38+
39+
- uses: ramsey/composer-install@3.0.0
40+
with:
41+
dependency-versions: ${{ matrix.dependencies }}
42+
43+
- name: "PHPStan"
44+
run: "vendor/bin/phpstan analyse"

.github/workflows/phpunit.yml

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
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+
- "[0-9]+.[0-9]+.x"
10+
- "renovate/*"
11+
12+
jobs:
13+
phpunit:
14+
name: "PHPUnit tests"
15+
16+
runs-on: ${{ matrix.operating-system }}
17+
18+
strategy:
19+
matrix:
20+
dependencies:
21+
- "lowest"
22+
- "highest"
23+
php-version:
24+
- "8.1"
25+
- "8.2"
26+
- "8.3"
27+
operating-system:
28+
- "ubuntu-latest"
29+
- "windows-latest"
30+
include:
31+
- dependencies: "locked"
32+
php-version: "8.3"
33+
operating-system: "ubuntu-latest"
34+
- dependencies: "locked"
35+
php-version: "8.3"
36+
operating-system: "windows-latest"
37+
steps:
38+
- name: "Checkout"
39+
uses: actions/checkout@v4
40+
41+
- name: "Install PHP"
42+
uses: "shivammathur/setup-php@2.31.1"
43+
with:
44+
coverage: "pcov"
45+
php-version: "${{ matrix.php-version }}"
46+
ini-values: memory_limit=-1
47+
extensions: pdo_sqlite
48+
49+
- uses: ramsey/composer-install@3.0.0
50+
with:
51+
dependency-versions: ${{ matrix.dependencies }}
52+
53+
- name: "Tests"
54+
run: "vendor/bin/phpunit --coverage-clover=clover.xml --coverage-text"

.github/workflows/psalm.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
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+
- "[0-9]+.[0-9]+.x"
10+
- "renovate/*"
11+
12+
jobs:
13+
static-analysis-psalm:
14+
name: "Static Analysis by Psalm"
15+
16+
runs-on: ${{ matrix.operating-system }}
17+
18+
strategy:
19+
matrix:
20+
dependencies:
21+
- "locked"
22+
php-version:
23+
- "8.3"
24+
operating-system:
25+
- "ubuntu-latest"
26+
27+
steps:
28+
- name: "Checkout"
29+
uses: actions/checkout@v4
30+
31+
- name: "Install PHP"
32+
uses: "shivammathur/setup-php@2.31.1"
33+
with:
34+
coverage: "pcov"
35+
php-version: "${{ matrix.php-version }}"
36+
ini-values: memory_limit=-1
37+
extensions: pdo_sqlite
38+
39+
- uses: ramsey/composer-install@3.0.0
40+
with:
41+
dependency-versions: ${{ matrix.dependencies }}
42+
43+
- name: "psalm"
44+
run: "vendor/bin/psalm --shepherd --stats"
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
# Alternate workflow example.
2+
# This one is identical to the one in release-on-milestone.yml, with one change:
3+
# the Release step uses the ORGANIZATION_ADMIN_TOKEN instead, to allow it to
4+
# trigger a release workflow event. This is useful if you have other actions
5+
# that intercept that event.
6+
7+
name: "Automatic Releases"
8+
9+
on:
10+
milestone:
11+
types:
12+
- "closed"
13+
14+
jobs:
15+
release:
16+
name: "GIT tag, release & create merge-up PR"
17+
runs-on: ubuntu-latest
18+
19+
steps:
20+
- name: "Checkout"
21+
uses: actions/checkout@v4
22+
23+
- name: "Release"
24+
uses: "laminas/automatic-releases@v1"
25+
with:
26+
command-name: "laminas:automatic-releases:release"
27+
env:
28+
"GITHUB_TOKEN": ${{ secrets.ORGANIZATION_ADMIN_TOKEN }}
29+
"SIGNING_SECRET_KEY": ${{ secrets.SIGNING_SECRET_KEY }}
30+
"GIT_AUTHOR_NAME": ${{ secrets.GIT_AUTHOR_NAME }}
31+
"GIT_AUTHOR_EMAIL": ${{ secrets.GIT_AUTHOR_EMAIL }}
32+
33+
- name: "Create Merge-Up Pull Request"
34+
uses: "laminas/automatic-releases@v1"
35+
with:
36+
command-name: "laminas:automatic-releases:create-merge-up-pull-request"
37+
env:
38+
"GITHUB_TOKEN": ${{ secrets.GITHUB_TOKEN }}
39+
"SIGNING_SECRET_KEY": ${{ secrets.SIGNING_SECRET_KEY }}
40+
"GIT_AUTHOR_NAME": ${{ secrets.GIT_AUTHOR_NAME }}
41+
"GIT_AUTHOR_EMAIL": ${{ secrets.GIT_AUTHOR_EMAIL }}
42+
43+
- name: "Create and/or Switch to new Release Branch"
44+
uses: "laminas/automatic-releases@v1"
45+
with:
46+
command-name: "laminas:automatic-releases:switch-default-branch-to-next-minor"
47+
env:
48+
"GITHUB_TOKEN": ${{ secrets.ORGANIZATION_ADMIN_TOKEN }}
49+
"SIGNING_SECRET_KEY": ${{ secrets.SIGNING_SECRET_KEY }}
50+
"GIT_AUTHOR_NAME": ${{ secrets.GIT_AUTHOR_NAME }}
51+
"GIT_AUTHOR_EMAIL": ${{ secrets.GIT_AUTHOR_EMAIL }}
52+
53+
- name: "Bump Changelog Version On Originating Release Branch"
54+
uses: "laminas/automatic-releases@v1"
55+
with:
56+
command-name: "laminas:automatic-releases:bump-changelog"
57+
env:
58+
"GITHUB_TOKEN": ${{ secrets.GITHUB_TOKEN }}
59+
"SIGNING_SECRET_KEY": ${{ secrets.SIGNING_SECRET_KEY }}
60+
"GIT_AUTHOR_NAME": ${{ secrets.GIT_AUTHOR_NAME }}
61+
"GIT_AUTHOR_EMAIL": ${{ secrets.GIT_AUTHOR_EMAIL }}
62+
63+
- name: "Create new milestones"
64+
uses: "laminas/automatic-releases@v1"
65+
with:
66+
command-name: "laminas:automatic-releases:create-milestones"
67+
env:
68+
"GITHUB_TOKEN": ${{ secrets.GITHUB_TOKEN }}
69+
"SIGNING_SECRET_KEY": ${{ secrets.SIGNING_SECRET_KEY }}
70+
"GIT_AUTHOR_NAME": ${{ secrets.GIT_AUTHOR_NAME }}
71+
"GIT_AUTHOR_EMAIL": ${{ secrets.GIT_AUTHOR_EMAIL }}

composer.json

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,15 @@
2222
"illuminate/contracts": "^9.28|^10.0|^11.0"
2323
},
2424
"require-dev": {
25-
"ext-pdo_sqlite": "*"
25+
"ext-pdo_sqlite": "*",
26+
"infection/infection": "^0.27.0",
27+
"patchlevel/coding-standard": "^1.3.0",
28+
"phpspec/prophecy-phpunit": "^2.1.0",
29+
"phpstan/phpstan": "^1.10.48",
30+
"phpunit/phpunit": "^10.5.2",
31+
"roave/security-advisories": "dev-master",
32+
"symfony/var-dumper": "^6.4.0|^7.0.0",
33+
"vimeo/psalm": "^5.17.0"
2634
},
2735
"config": {
2836
"preferred-install": {

0 commit comments

Comments
 (0)