Skip to content

Commit

Permalink
Merge pull request #167 from patchlevel/1.0.x-merge-up-into-1.1.x_yvC…
Browse files Browse the repository at this point in the history
…E2TDQ

Merge release 1.0.2 into 1.1.x
  • Loading branch information
DavidBadura authored Jan 19, 2022
2 parents bd4b397 + 4b69f98 commit 0845adf
Show file tree
Hide file tree
Showing 14 changed files with 295 additions and 155 deletions.
21 changes: 2 additions & 19 deletions .github/workflows/coding-standard.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,26 +35,9 @@ jobs:
ini-values: memory_limit=-1
extensions: pdo_sqlite

- name: "Cache dependencies"
uses: "actions/cache@v2"
- uses: "ramsey/composer-install@v2"
with:
path: |
~/.composer/cache
vendor
key: "php-${{ matrix.php-version }}-${{ matrix.dependencies }}"
restore-keys: "php-${{ matrix.php-version }}-${{ matrix.dependencies }}"

- name: "Install lowest dependencies"
if: ${{ matrix.dependencies == 'lowest' }}
run: "composer update --prefer-lowest --no-interaction --no-progress"

- name: "Install highest dependencies"
if: ${{ matrix.dependencies == 'highest' }}
run: "composer update --no-interaction --no-progress"

- name: "Install locked dependencies"
if: ${{ matrix.dependencies == 'locked' }}
run: "composer install --no-interaction --no-progress"
dependency-versions: ${{ matrix.dependencies }}

- name: "Coding Standard"
run: "vendor/bin/phpcs"
200 changes: 200 additions & 0 deletions .github/workflows/integration.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,200 @@
# https://help.github.com/en/categories/automating-your-workflow-with-github-actions

name: "Integration tests"

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

jobs:
postgres:
name: "Postgres"

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

services:
postgres:
# Docker Hub image
image: "postgres:${{ matrix.postgres-version }}"
# Provide the password for postgres
env:
POSTGRES_PASSWORD: postgres
POSTGRES_DB: eventstore
options: >-
--health-cmd "pg_isready"
ports:
- "5432:5432"

strategy:
matrix:
dependencies:
- "locked"
php-version:
- "8.0"
operating-system:
- "ubuntu-latest"
postgres-version:
- "9.4"
- "13"
- "14"

env:
DB_URL: 'postgresql://postgres:postgres@localhost:5432/eventstore?charset=utf8'

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

- name: "Install PHP"
uses: "shivammathur/setup-php@v2"
with:
coverage: "pcov"
php-version: "${{ matrix.php-version }}"
ini-values: memory_limit=-1
extensions: pdo_sqlite

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

- name: "Tests"
run: "vendor/bin/phpunit --testsuite=integration"

mariadb:
name: "mariadb"

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

services:
mariadb:
image: "mariadb:${{ matrix.mariadb-version }}"
env:
MYSQL_ALLOW_EMPTY_PASSWORD: yes
MYSQL_DATABASE: "eventstore"

options: >-
--health-cmd "mysqladmin ping --silent"
ports:
- "3306:3306"

strategy:
matrix:
dependencies:
- "locked"
php-version:
- "8.0"
operating-system:
- "ubuntu-latest"
mariadb-version:
- "10.0"
- "10.2"
- "10.5"

env:
DB_URL: 'mysql://root@127.0.0.1:3306/eventstore?charset=utf8'

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

- name: "Install PHP"
uses: "shivammathur/setup-php@v2"
with:
coverage: "pcov"
php-version: "${{ matrix.php-version }}"
ini-values: memory_limit=-1
extensions: pdo_mysql

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

- name: "Tests"
run: "vendor/bin/phpunit --testsuite=integration"

mysql:
name: "mysql"

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

services:
mysql:
image: "mysql:${{ matrix.mysql-version }}"

env:
MYSQL_ALLOW_EMPTY_PASSWORD: yes
MYSQL_DATABASE: "eventstore"

options: >-
--health-cmd "mysqladmin ping --silent"
ports:
- "3306:3306"

strategy:
matrix:
dependencies:
- "locked"
php-version:
- "8.0"
operating-system:
- "ubuntu-latest"
mysql-version:
- "5.7"
- "8.0"

env:
DB_URL: 'mysql://root@127.0.0.1:3306/eventstore?charset=utf8'

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

- name: "Install PHP"
uses: "shivammathur/setup-php@v2"
with:
coverage: "pcov"
php-version: "${{ matrix.php-version }}"
ini-values: memory_limit=-1
extensions: pdo_mysql

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

- name: "Tests"
run: "vendor/bin/phpunit --testsuite=integration"

sqlite:
name: "Sqlite"

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

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

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

- name: "Install PHP"
uses: "shivammathur/setup-php@v2"
with:
coverage: "pcov"
php-version: "${{ matrix.php-version }}"
ini-values: memory_limit=-1
extensions: pdo_sqlite

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

- name: "Tests"
run: "vendor/bin/phpunit --testsuite=integration"
21 changes: 2 additions & 19 deletions .github/workflows/mutation-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,26 +34,9 @@ jobs:
php-version: "${{ matrix.php-version }}"
ini-values: memory_limit=-1

- name: "Cache dependencies"
uses: "actions/cache@v2"
- uses: "ramsey/composer-install@v2"
with:
path: |
~/.composer/cache
vendor
key: "php-${{ matrix.php-version }}-${{ matrix.dependencies }}"
restore-keys: "php-${{ matrix.php-version }}-${{ matrix.dependencies }}"

- name: "Install lowest dependencies"
if: ${{ matrix.dependencies == 'lowest' }}
run: "composer update --prefer-lowest --no-interaction --no-progress"

- name: "Install highest dependencies"
if: ${{ matrix.dependencies == 'highest' }}
run: "composer update --no-interaction --no-progress"

- name: "Install locked dependencies"
if: ${{ matrix.dependencies == 'locked' }}
run: "composer install --no-interaction --no-progress"
dependency-versions: ${{ matrix.dependencies }}

- name: "Infection"
run: "vendor/bin/infection"
Expand Down
21 changes: 2 additions & 19 deletions .github/workflows/phpstan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,26 +35,9 @@ jobs:
ini-values: memory_limit=-1
extensions: pdo_sqlite

- name: "Cache dependencies"
uses: "actions/cache@v2"
- uses: "ramsey/composer-install@v2"
with:
path: |
~/.composer/cache
vendor
key: "php-${{ matrix.php-version }}-${{ matrix.dependencies }}"
restore-keys: "php-${{ matrix.php-version }}-${{ matrix.dependencies }}"

- name: "Install lowest dependencies"
if: ${{ matrix.dependencies == 'lowest' }}
run: "composer update --prefer-lowest --no-interaction --no-progress"

- name: "Install highest dependencies"
if: ${{ matrix.dependencies == 'highest' }}
run: "composer update --no-interaction --no-progress"

- name: "Install locked dependencies"
if: ${{ matrix.dependencies == 'locked' }}
run: "composer install --no-interaction --no-progress"
dependency-versions: ${{ matrix.dependencies }}

- name: "PHPStan"
run: "vendor/bin/phpstan analyse"
21 changes: 2 additions & 19 deletions .github/workflows/psalm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,26 +35,9 @@ jobs:
ini-values: memory_limit=-1
extensions: pdo_sqlite

- name: "Cache dependencies"
uses: "actions/cache@v2"
- uses: "ramsey/composer-install@v2"
with:
path: |
~/.composer/cache
vendor
key: "php-${{ matrix.php-version }}-${{ matrix.dependencies }}"
restore-keys: "php-${{ matrix.php-version }}-${{ matrix.dependencies }}"

- name: "Install lowest dependencies"
if: ${{ matrix.dependencies == 'lowest' }}
run: "composer update --prefer-lowest --no-interaction --no-progress"

- name: "Install highest dependencies"
if: ${{ matrix.dependencies == 'highest' }}
run: "composer update --no-interaction --no-progress"

- name: "Install locked dependencies"
if: ${{ matrix.dependencies == 'locked' }}
run: "composer install --no-interaction --no-progress"
dependency-versions: ${{ matrix.dependencies }}

- name: "psalm"
run: "vendor/bin/psalm --shepherd --stats"
28 changes: 6 additions & 22 deletions .github/workflows/phpunit.yml → .github/workflows/unit.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# https://help.github.com/en/categories/automating-your-workflow-with-github-actions

name: "PHPUnit tests"
name: "Unit tests"

on:
pull_request:
Expand All @@ -10,7 +10,7 @@ on:

jobs:
phpunit:
name: "PHPUnit tests"
name: "Unit tests"

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

Expand All @@ -32,6 +32,7 @@ jobs:
- dependencies: "locked"
php-version: "8.0"
operating-system: "windows-latest"

steps:
- name: "Checkout"
uses: "actions/checkout@v2"
Expand All @@ -44,26 +45,9 @@ jobs:
ini-values: memory_limit=-1
extensions: pdo_sqlite

- name: "Cache dependencies"
uses: "actions/cache@v2"
- uses: "ramsey/composer-install@v2"
with:
path: |
~/.composer/cache
vendor
key: "php-${{ matrix.php-version }}-${{ matrix.dependencies }}"
restore-keys: "php-${{ matrix.php-version }}-${{ matrix.dependencies }}"

- name: "Install lowest dependencies"
if: ${{ matrix.dependencies == 'lowest' }}
run: "composer update --prefer-lowest --no-interaction --no-progress"

- name: "Install highest dependencies"
if: ${{ matrix.dependencies == 'highest' }}
run: "composer update --no-interaction --no-progress"

- name: "Install locked dependencies"
if: ${{ matrix.dependencies == 'locked' }}
run: "composer install --no-interaction --no-progress"
dependency-versions: ${{ matrix.dependencies }}

- name: "Tests"
run: "vendor/bin/phpunit --coverage-clover=clover.xml --coverage-text"
run: "vendor/bin/phpunit --testsuite=unit --coverage-clover=clover.xml --coverage-text"
1 change: 1 addition & 0 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@

<php>
<env name="COLUMNS" value="120"/>
<env name="DB_URL" value="sqlite:///:memory:"/>
<ini name="error_reporting" value="E_ALL"/>
</php>
</phpunit>
Loading

0 comments on commit 0845adf

Please sign in to comment.