Skip to content

Commit 914d0dc

Browse files
committed
feat: Update mutation workflow to support PostgreSQL with docker setup.
1 parent 595f12f commit 914d0dc

File tree

1 file changed

+27
-1
lines changed

1 file changed

+27
-1
lines changed

.github/workflows/mutation.yml

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,33 @@ jobs:
2121
mutation:
2222
uses: php-forge/actions/.github/workflows/infection.yml@main
2323
with:
24+
extensions: pdo, pdo_pgsql
25+
framework-options: --test-framework-options="--group=pgsql"
26+
hook: |
27+
# Configurar PostgreSQL con Docker
28+
docker run -d \
29+
--name postgres-test \
30+
-e POSTGRES_DB=yiitest \
31+
-e POSTGRES_USER=root \
32+
-e POSTGRES_PASSWORD=root \
33+
-p 5432:5432 \
34+
--health-cmd="pg_isready -U postgres" \
35+
--health-interval=10s \
36+
--health-timeout=5s \
37+
--health-retries=3 \
38+
postgres:16
39+
40+
# Esperar a que PostgreSQL esté listo
41+
echo "Waiting for PostgreSQL to be ready..."
42+
timeout 60s bash -c 'until docker exec postgres-test pg_isready -U postgres; do sleep 2; done'
43+
44+
# Verificar que está funcionando
45+
docker exec postgres-test psql -U root -d yiitest -c "SELECT version();"
46+
47+
# Configurar variables de entorno para los tests
48+
echo "DB_DSN=pgsql:host=localhost;port=5432;dbname=yiitest" >> $GITHUB_ENV
49+
echo "DB_USERNAME=root" >> $GITHUB_ENV
50+
echo "DB_PASSWORD=root" >> $GITHUB_ENV
2451
phpstan: true
25-
framework-options: --test-framework-options="--group=sqlite"
2652
secrets:
2753
STRYKER_DASHBOARD_API_KEY: ${{ secrets.STRYKER_DASHBOARD_API_KEY }}

0 commit comments

Comments
 (0)