-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit ce59faf
Showing
43 changed files
with
6,041 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
root = true | ||
|
||
[*] | ||
end_of_line = lf | ||
insert_final_newline = true | ||
indent_style = space | ||
indent_size = 4 | ||
charset = utf-8 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,104 @@ | ||
name: CI | ||
|
||
on: [push, pull_request] | ||
|
||
jobs: | ||
testsuite: | ||
name: Unittests | ||
runs-on: ubuntu-20.04 | ||
|
||
env: | ||
DB_HOST: 127.0.0.1 | ||
DB_DATABASE: test | ||
DB_USER: test | ||
DB_ROOT_PASSWORD: changeme | ||
DB_PASSWORD: changeme | ||
REDIS_SCHEME: tcp | ||
REDIS_HOST: 127.0.0.1 | ||
REDIS_PORT: 6379 | ||
|
||
services: | ||
mariadb: | ||
image: mariadb:latest | ||
ports: | ||
- 3306:3306 | ||
env: | ||
DATABASE_HOST: 127.0.0.1 | ||
MARIADB_DATABASE: test | ||
MARIADB_USER: test | ||
MARIADB_ROOT_PASSWORD: changeme | ||
MARIADB_PASSWORD: changeme | ||
options: --health-cmd="healthcheck.sh --connect --innodb_initialized" --health-interval=10s --health-timeout=5s --health-retries=3 | ||
redis: | ||
image: redis | ||
options: >- | ||
--health-cmd "redis-cli ping" | ||
--health-interval 10s | ||
--health-timeout 5s | ||
--health-retries 5 | ||
ports: | ||
# Maps port 6379 on service container to the host | ||
- 6379:6379 | ||
|
||
strategy: | ||
fail-fast: false | ||
matrix: | ||
php-version: ['8.2', '8.3'] | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 1 | ||
|
||
- name: Setup PHP | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: ${{ matrix.php-version }} | ||
extensions: mbstring, json, fileinfo | ||
tools: pecl | ||
coverage: pcov | ||
|
||
- name: Composer install | ||
run: | | ||
if [[ ${{ matrix.prefer-lowest == 'prefer-lowest' }} ]]; then | ||
composer update --prefer-lowest --prefer-stable | ||
else | ||
composer install | ||
fi | ||
- name: Run PHPUnit | ||
run: | | ||
if [[ ${{ matrix.php-version }} == '8.2' ]]; then | ||
bin/phpunit --coverage-clover=coverage.xml | ||
else | ||
bin/phpunit | ||
fi | ||
- name: Code Coverage Report | ||
if: success() && matrix.php-version == '8.2' | ||
uses: codecov/codecov-action@v4 | ||
|
||
cs-stan: | ||
name: Coding Standard & Static Analysis | ||
runs-on: ubuntu-20.04 | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 1 | ||
|
||
- name: Setup PHP | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: ${{ matrix.php-version }} | ||
extensions: mbstring, json, fileinfo | ||
coverage: none | ||
tools: pecl | ||
|
||
- name: Composer install | ||
run: composer update --prefer-lowest --prefer-stable | ||
|
||
- name: Run phpcs | ||
run: bin/phpcs --version && bin/phpcs --report=source --standard=phpcs.xml | ||
|
||
- name: Run phpstan | ||
run: bin/phpstan -V && bin/phpstan --error-format=github |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
/vendor/ | ||
/bin/ | ||
/.phpunit.cache/ | ||
/tmp/ | ||
/tools/ | ||
.idea/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<phive xmlns="https://phar.io/phive"> | ||
<phar name="grumphp" version="^2.5.0" installed="2.5.0" location="./bin/grumphp" copy="true"/> | ||
<phar name="phpmd" version="^2.15.0" installed="2.15.0" location="./bin/phpmd" copy="true"/> | ||
<phar name="phpstan" version="^1.10.67" installed="1.10.67" location="./bin/phpstan" copy="true"/> | ||
<phar name="phpcbf" version="^3.9.2" installed="3.9.2" location="./bin/phpcbf" copy="true"/> | ||
<phar name="phpcs" version="^3.9.2" installed="3.9.2" location="./bin/phpcs" copy="true"/> | ||
</phive> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
MIT License | ||
|
||
Copyright (c) Florian Krämer | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# Event Snapshot Store | ||
|
||
**⚠ Do not use it in production!⚠ This is still in development!** | ||
|
||
This is a snapshot store for the [Phauthentic event sourcing library](https://github.com/phauthentic/event-sourcing). | ||
|
||
## Installation | ||
|
||
```sh | ||
composer require phauthentic/snapshot-store | ||
``` | ||
|
||
Running tests: | ||
|
||
```sh | ||
docker compose up | ||
docker exec -it phpunit-container bin/phpunit | ||
``` | ||
|
||
## Documentation | ||
|
||
Please start by reading [docs/index.md](/docs/index.md) in this repository. | ||
|
||
## License | ||
|
||
Copyright Florian Krämer | ||
|
||
Licensed under the [MIT license](license.txt). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
{ | ||
"name": "phauthentic/snapshot-store", | ||
"type": "library", | ||
"description": "", | ||
"keywords": [], | ||
"license": "MIT", | ||
"require": { | ||
"php": "^8.2" | ||
}, | ||
"require-dev": { | ||
"phpunit/phpunit": "^10.5", | ||
"predis/predis": "^2.2", | ||
"ramsey/uuid": "^4.7", | ||
"phpstan/phpstan": "^1.10", | ||
"phpmd/phpmd": "^2.15", | ||
"squizlabs/php_codesniffer": "^3.9" | ||
}, | ||
"autoload": { | ||
"psr-4": { | ||
"Phauthentic\\SnapshotStore\\": "src/" | ||
} | ||
}, | ||
"autoload-dev": { | ||
"psr-4": { | ||
"Phauthentic\\SnapshotStore\\Test\\": "tests/", | ||
"Example\\": "examples/" | ||
} | ||
}, | ||
"config": { | ||
"bin-dir": "bin" | ||
}, | ||
"scripts": { | ||
} | ||
} |
Oops, something went wrong.