Skip to content

Commit c200a1e

Browse files
authored
feat: integrate cycle/transaction and drop the custom EntityManager (#47)
test: Replace PHPUnit with Testo
1 parent ac6750f commit c200a1e

75 files changed

Lines changed: 7770 additions & 7914 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitattributes

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
1-
/.* export-ignore
2-
/tests export-ignore
3-
/*.xml export-ignore
4-
/*.yml export-ignore
5-
/*.yaml export-ignore
6-
/*.lock export-ignore
7-
/*.dist export-ignore
1+
/.* export-ignore
2+
/tests export-ignore
3+
/*.xml export-ignore
4+
/*.yml export-ignore
5+
/*.yaml export-ignore
6+
/*.lock export-ignore
7+
/*.dist export-ignore
8+
/*.json export-ignore
9+
/CLAUDE.md export-ignore
10+
/composer.json -export-ignore

.github/workflows/infection.yml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
name: 🧬 Mutation Tests
2+
3+
on: # yamllint disable-line rule:truthy
4+
push:
5+
paths:
6+
- 'src/**'
7+
- 'tests/**'
8+
- 'infection.json'
9+
- 'testo.php'
10+
- 'composer.json'
11+
- 'composer.lock'
12+
- '.github/workflows/infection.yml'
13+
pull_request:
14+
paths:
15+
- 'src/**'
16+
- 'tests/**'
17+
- 'infection.json'
18+
- 'testo.php'
19+
- 'composer.json'
20+
- 'composer.lock'
21+
- '.github/workflows/infection.yml'
22+
23+
jobs:
24+
infection:
25+
name: Infection · PHP ${{ matrix.php }}
26+
runs-on: ubuntu-latest
27+
28+
strategy:
29+
fail-fast: false
30+
matrix:
31+
php: ['8.4']
32+
dependencies: [highest]
33+
34+
steps:
35+
- name: 📦 Check out the codebase
36+
uses: actions/checkout@v5
37+
38+
- name: 🛠️ Setup PHP
39+
uses: shivammathur/setup-php@v2
40+
with:
41+
php-version: ${{ matrix.php }}
42+
extensions: mbstring, pdo, pdo_sqlite
43+
ini-values: error_reporting=E_ALL
44+
coverage: xdebug
45+
46+
- name: 📥 Install dependencies with composer
47+
uses: ramsey/composer-install@v3
48+
with:
49+
dependency-versions: ${{ matrix.dependencies }}
50+
51+
- name: 🧬 Run Infection
52+
run: composer infect:ci

.github/workflows/refactoring.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ jobs:
4141
coverage: none
4242

4343
- name: 🤖 Validate composer.json and composer.lock
44-
run: composer validate --ansi --strict
44+
run: composer validate --ansi
4545

4646
- name: 📥 Install dependencies with composer
4747
uses: ramsey/composer-install@v3

.github/workflows/security-analysis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ jobs:
3939
coverage: none
4040

4141
- name: 🤖 Validate composer.json and composer.lock
42-
run: composer validate --ansi --strict
42+
run: composer validate --ansi
4343

4444
- name: 📥 Install dependencies with composer
4545
uses: ramsey/composer-install@v3

.github/workflows/static-analysis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ jobs:
4545
run: echo "::add-matcher::${{ runner.tool_cache }}/php.json"
4646

4747
- name: 🤖 Validate composer.json and composer.lock
48-
run: composer validate --ansi --strict
48+
run: composer validate --ansi
4949

5050
- name: 📥 Install dependencies with composer
5151
uses: ramsey/composer-install@v3
Lines changed: 54 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,65 @@
11
---
22

33
on: # yamllint disable-line rule:truthy
4+
pull_request: null
45
push:
56
branches:
7+
- master
8+
- main
69
- '*.*'
710
- '*.*.*'
8-
pull_request: null
911

10-
name: MSSQL
12+
name: 🛢️ MySQL
1113

1214
jobs:
13-
phpunit:
14-
uses: cycle/gh-actions/.github/workflows/db-mssql.yml@master
15-
with:
16-
php: '["8.1","8.2","8.3","8.4"]'
15+
acceptance:
16+
name: MySQL · PHP ${{ matrix.php-version }}
17+
timeout-minutes: 8
18+
runs-on: ubuntu-latest
19+
concurrency:
20+
cancel-in-progress: true
21+
group: mysql-${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}-${{ matrix.php-version }}
22+
strategy:
23+
fail-fast: false
24+
matrix:
25+
php-version:
26+
- '8.2'
27+
- '8.3'
28+
- '8.4'
29+
steps:
30+
- name: 📦 Check out the codebase
31+
uses: actions/checkout@v5
32+
33+
- name: 🛠️ Start MySQL
34+
run: docker compose -f tests/docker-compose.yml up -d cycle-mysql
35+
36+
- name: 🛠️ Setup PHP
37+
uses: shivammathur/setup-php@v2
38+
with:
39+
php-version: ${{ matrix.php-version }}
40+
extensions: mbstring, pdo, pdo_sqlite, pdo_mysql
41+
ini-values: error_reporting=E_ALL
42+
43+
- name: 📥 Install dependencies with composer
44+
uses: ramsey/composer-install@v3
45+
with:
46+
dependency-versions: highest
47+
48+
- name: ⏳ Wait for MySQL
49+
run: |
50+
for i in $(seq 1 30); do
51+
if docker exec $(docker ps -qf "ancestor=mysql:8.0.37") mysqladmin ping -h 127.0.0.1 --silent; then
52+
echo "MySQL is up"; exit 0
53+
fi
54+
echo "Waiting for MySQL... ($i)"; sleep 2
55+
done
56+
echo "MySQL did not become ready in time"; exit 1
1757
18-
...
58+
- name: 🧪 Run acceptance tests (MySQL)
59+
env:
60+
DB_HOSTNAME: 127.0.0.1
61+
DB_PORT: 13306
62+
DB_USER: root
63+
DB_PASSWORD: 'YourStrong!Passw0rd'
64+
DB_DATABASE: spiral
65+
run: composer test:mysql
Lines changed: 54 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,65 @@
11
---
22

33
on: # yamllint disable-line rule:truthy
4+
pull_request: null
45
push:
56
branches:
7+
- master
8+
- main
69
- '*.*'
710
- '*.*.*'
8-
pull_request: null
911

10-
name: Postgres
12+
name: 🐘 Postgres
1113

1214
jobs:
13-
phpunit:
14-
uses: cycle/gh-actions/.github/workflows/db-pgsql.yml@master
15-
with:
16-
php: '["8.1","8.2","8.3","8.4"]'
15+
acceptance:
16+
name: Postgres · PHP ${{ matrix.php-version }}
17+
timeout-minutes: 8
18+
runs-on: ubuntu-latest
19+
concurrency:
20+
cancel-in-progress: true
21+
group: pgsql-${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}-${{ matrix.php-version }}
22+
strategy:
23+
fail-fast: false
24+
matrix:
25+
php-version:
26+
- '8.2'
27+
- '8.3'
28+
- '8.4'
29+
steps:
30+
- name: 📦 Check out the codebase
31+
uses: actions/checkout@v5
32+
33+
- name: 🛠️ Start PostgreSQL
34+
run: docker compose -f tests/docker-compose.yml up -d cycle-postgres
35+
36+
- name: 🛠️ Setup PHP
37+
uses: shivammathur/setup-php@v2
38+
with:
39+
php-version: ${{ matrix.php-version }}
40+
extensions: mbstring, pdo, pdo_sqlite, pdo_pgsql
41+
ini-values: error_reporting=E_ALL
42+
43+
- name: 📥 Install dependencies with composer
44+
uses: ramsey/composer-install@v3
45+
with:
46+
dependency-versions: highest
47+
48+
- name: ⏳ Wait for PostgreSQL
49+
run: |
50+
for i in $(seq 1 30); do
51+
if docker exec $(docker ps -qf "ancestor=postgres:15.2") pg_isready -U postgres; then
52+
echo "PostgreSQL is up"; exit 0
53+
fi
54+
echo "Waiting for PostgreSQL... ($i)"; sleep 2
55+
done
56+
echo "PostgreSQL did not become ready in time"; exit 1
1757
18-
...
58+
- name: 🧪 Run acceptance tests (PostgreSQL)
59+
env:
60+
DB_HOSTNAME: 127.0.0.1
61+
DB_PORT: 15432
62+
DB_USER: postgres
63+
DB_PASSWORD: 'YourStrong!Passw0rd'
64+
DB_DATABASE: spiral
65+
run: composer test:pgsql
Lines changed: 65 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,76 @@
11
---
22

33
on: # yamllint disable-line rule:truthy
4+
pull_request: null
45
push:
56
branches:
7+
- master
8+
- main
69
- '*.*'
710
- '*.*.*'
8-
pull_request: null
911

10-
name: MSSQL
12+
name: 📀 SQLServer
1113

1214
jobs:
13-
phpunit:
14-
uses: cycle/gh-actions/.github/workflows/db-mssql.yml@master
15-
with:
16-
php: '["8.1","8.2","8.3","8.4"]'
15+
acceptance:
16+
name: SQLServer · PHP ${{ matrix.php-version }}
17+
timeout-minutes: 10
18+
runs-on: ubuntu-latest
19+
concurrency:
20+
cancel-in-progress: true
21+
group: mssql-${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}-${{ matrix.php-version }}
22+
strategy:
23+
fail-fast: false
24+
matrix:
25+
php-version:
26+
- '8.2'
27+
- '8.3'
28+
- '8.4'
29+
steps:
30+
- name: 📦 Check out the codebase
31+
uses: actions/checkout@v5
32+
33+
- name: 🛠️ Install ODBC driver
34+
run: |
35+
curl https://packages.microsoft.com/config/ubuntu/$(lsb_release -rs)/prod.list \
36+
| sudo tee /etc/apt/sources.list.d/mssql-release.list
37+
sudo apt-get update
38+
sudo ACCEPT_EULA=Y apt-get install -y msodbcsql18
39+
40+
- name: 🛠️ Start SQLServer
41+
run: docker compose -f tests/docker-compose.yml up -d cycle-sqlserver
42+
43+
- name: 🛠️ Setup PHP
44+
uses: shivammathur/setup-php@v2
45+
with:
46+
php-version: ${{ matrix.php-version }}
47+
tools: pecl
48+
extensions: mbstring, pdo, pdo_sqlite, sqlsrv, pdo_sqlsrv
49+
ini-values: error_reporting=E_ALL
50+
51+
- name: 📥 Install dependencies with composer
52+
uses: ramsey/composer-install@v3
53+
with:
54+
dependency-versions: highest
55+
56+
- name: ⏳ Wait for SQLServer
57+
run: |
58+
container=$(docker ps -qf "ancestor=mcr.microsoft.com/mssql/server:2019-latest")
59+
for i in $(seq 1 30); do
60+
# The image ships sqlcmd under mssql-tools18 (v18 encrypts by default, so it needs -C);
61+
# fall back to the legacy mssql-tools path for older images.
62+
if docker exec "$container" bash -c \
63+
"/opt/mssql-tools18/bin/sqlcmd -S localhost -U SA -P 'YourStrong!Passw0rd' -C -Q 'SELECT 1' -b \
64+
|| /opt/mssql-tools/bin/sqlcmd -S localhost -U SA -P 'YourStrong!Passw0rd' -Q 'SELECT 1' -b"; then
65+
echo "SQLServer is up"; exit 0
66+
fi
67+
echo "Waiting for SQLServer... ($i)"; sleep 3
68+
done
69+
echo "SQLServer did not become ready in time"; exit 1
1770
18-
...
71+
- name: 🧪 Run acceptance tests (SQLServer)
72+
env:
73+
DB_HOSTNAME: 127.0.0.1
74+
DB_PORT: 11433
75+
DB_PASSWORD: 'YourStrong!Passw0rd'
76+
run: composer test:sqlserver

0 commit comments

Comments
 (0)