fix(ci): start MongoDB explicitly via docker run
Some checks failed
Test / vitest (push) Successful in 11m12s
Test / playwright (push) Failing after 7m43s
Test / visual (push) Failing after 7m39s
Test / Notify on failure (push) Successful in 2s

The Forgejo runner isn't honoring the 'services:' block — the playwright
job booted the server cleanly but every Mongo query returned ECONNREFUSED
on 127.0.0.1:27017. Replace 'services:' with an explicit 'docker run -d'
step + nc-based readiness wait.
This commit is contained in:
Jennie Robinson Faber 2026-05-01 07:03:16 +01:00
parent 16aaeddcee
commit a797f8e17c

View file

@ -21,11 +21,6 @@ jobs:
playwright: playwright:
runs-on: ubuntu-latest runs-on: ubuntu-latest
needs: vitest needs: vitest
services:
mongo:
image: mongo:7
ports:
- 27017:27017
env: env:
MONGODB_URI: mongodb://localhost:27017/ghostguild-test MONGODB_URI: mongodb://localhost:27017/ghostguild-test
JWT_SECRET: ci-test-jwt-secret JWT_SECRET: ci-test-jwt-secret
@ -43,6 +38,10 @@ jobs:
cache: npm cache: npm
- run: npm ci - run: npm ci
- run: npx playwright install --with-deps chromium - run: npx playwright install --with-deps chromium
- name: Start MongoDB
run: docker run -d --name mongo-ci -p 27017:27017 mongo:7
- name: Wait for MongoDB
run: timeout 30 sh -c 'until nc -z localhost 27017; do sleep 1; done'
- run: npm run build - run: npm run build
- name: Start server - name: Start server
run: node .output/server/index.mjs > /tmp/server.log 2>&1 & run: node .output/server/index.mjs > /tmp/server.log 2>&1 &
@ -79,11 +78,6 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
needs: vitest needs: vitest
continue-on-error: true continue-on-error: true
services:
mongo:
image: mongo:7
ports:
- 27017:27017
env: env:
MONGODB_URI: mongodb://localhost:27017/ghostguild-test MONGODB_URI: mongodb://localhost:27017/ghostguild-test
JWT_SECRET: ci-test-jwt-secret JWT_SECRET: ci-test-jwt-secret
@ -101,6 +95,10 @@ jobs:
cache: npm cache: npm
- run: npm ci - run: npm ci
- run: npx playwright install --with-deps chromium - run: npx playwright install --with-deps chromium
- name: Start MongoDB
run: docker run -d --name mongo-ci -p 27017:27017 mongo:7
- name: Wait for MongoDB
run: timeout 30 sh -c 'until nc -z localhost 27017; do sleep 1; done'
- run: npm run build - run: npm run build
- name: Start server - name: Start server
run: node .output/server/index.mjs > /tmp/server.log 2>&1 & run: node .output/server/index.mjs > /tmp/server.log 2>&1 &