Skip to content
Open
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
46 changes: 46 additions & 0 deletions .github/workflows/phpunit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# https://help.github.com/en/categories/automating-your-workflow-with-github-actions

name: "Unit tests"

on:
pull_request:
push:
branches:
- "[0-9]+.[0-9]+.x"
- "renovate/*"

concurrency:
group: ${{ github.workflow_ref }}
cancel-in-progress: true

jobs:
phpunit:
name: "Unit tests"

runs-on: ${{ matrix.operating-system }}

strategy:
matrix:
dependencies:
- "locked"
php-version:
- "8.5"
operating-system:
- "ubuntu-latest"

steps:
- name: "Checkout"
uses: actions/checkout@v7

- name: "Install PHP"
uses: "shivammathur/setup-php@2.40.0"
with:
php-version: "${{ matrix.php-version }}"
ini-values: memory_limit=-1, opcache.enable_cli=1

- uses: ramsey/composer-install@4.0.0
with:
dependency-versions: ${{ matrix.dependencies }}

- name: "PHPUnit"
run: "vendor/bin/phpunit"
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ phpunit.xml
.phpunit.result.cache
.phpcs-cache
phpstan.neon
var/
10 changes: 10 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,16 @@ phpstan-baseline: vendor
.PHONY: static
static: phpstan cs ## run static analyser

.PHONY: phpunit
phpunit: vendor ## run phpunit tests
vendor/bin/phpunit

.PHONY: test
test: phpunit ## run tests

.PHONY: dev
dev: static test ## run dev tools

.PHONY: docs
docs: docs-extract-php docs-php-lint docs-phpcs docs-inject-php

Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
* [Recording in apply methods](https://patchlevel.dev/docs/event-sourcing-phpstan-extension/latest/getting-started#recording-in-apply-methods) is reported as an error, because recording events while replaying them leads to duplicated events.
* [Writing state outside apply methods](https://patchlevel.dev/docs/event-sourcing-phpstan-extension/latest/getting-started#writing-state-outside-apply-methods) is reported as an error, because state that is not derived from an event is lost when the aggregate is reloaded.
* [Typed decisions](https://patchlevel.dev/docs/event-sourcing-phpstan-extension/latest/getting-started#typed-decisions) for the dynamic consistency boundary, so PHPStan knows the state of every projection a decision reads, also when several are read at once.
* [Analyser](https://patchlevel.dev/docs/event-sourcing-phpstan-extension/latest/analyser) that turns your aggregates, commands, events, decisions and subscribers into a diagram inspired by Event Storming or into JSON for your own tooling.

## Installation

Expand Down
2 changes: 2 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,9 @@
"patchlevel/coding-standard": "^1.3.0",
"patchlevel/event-sourcing": "4.0.x-dev",
"phpstan/phpstan-strict-rules": "^2.0.4",
"phpunit/phpunit": "^10.5.0 || ^11.0.0 || ^12.0.0",
"roave/security-advisories": "dev-master",
"symfony/http-kernel": "^6.4.0 || ^7.0.0 || ^8.0.0",
"wnx/commonmark-markdown-renderer": "^1.6"
},
"config": {
Expand Down
Loading
Loading