60 lines
2.1 KiB
YAML
60 lines
2.1 KiB
YAML
when:
|
|
- event: push
|
|
- event: pull_request
|
|
|
|
steps:
|
|
- name: clone
|
|
image: woodpeckerci/plugin-git
|
|
settings:
|
|
depth: 0
|
|
lfs: true
|
|
submodules: true
|
|
|
|
- name: verify-mocks
|
|
image: mcr.microsoft.com/playwright:v1.54.2-jammy
|
|
commands:
|
|
- pwd
|
|
- node -v && npm -v
|
|
# Skip lifecycle scripts in CI to avoid running husky's prepare step
|
|
- npm ci --ignore-scripts
|
|
# Zeig mir, ob die Datei wirklich im Checkout liegt:
|
|
- echo "=== git ls-files ==="
|
|
- git ls-files | grep -i "^mocks/device-cgi-simulator/SERVICE/systemMockData.js" || true
|
|
- echo "=== ls -la ==="
|
|
- ls -la mocks/device-cgi-simulator/SERVICE || true
|
|
- echo "=== file exists? ==="
|
|
- test -f mocks/device-cgi-simulator/SERVICE/systemMockData.js && echo "FOUND" || (echo "MISSING" && exit 1)
|
|
|
|
- name: e2e-dev
|
|
image: mcr.microsoft.com/playwright:v1.54.2-jammy
|
|
environment:
|
|
CI: "true"
|
|
NODE_ENV: "production"
|
|
NEXT_TELEMETRY_DISABLED: "1"
|
|
PORT: "3000"
|
|
commands:
|
|
- node -v && npm -v
|
|
# Skip lifecycle scripts in CI to avoid running husky's prepare step (husky is a devDep)
|
|
- npm ci --ignore-scripts
|
|
- npm run build
|
|
# Start local static simulator in background
|
|
- node scripts/local-cpl-sim.mjs &
|
|
# Wait until simulator responds on port 3000 (no curl dependency)
|
|
- |
|
|
node -e "const http=require('http');let n=120;function ping(){http.get('http://localhost:3000',res=>{console.log('Server is up');process.exit(0)}).on('error',()=>{if(n--<=0){console.error('Server did not start');process.exit(1)}setTimeout(ping,1000)});}ping();"
|
|
- npx playwright test --project=chromium
|
|
|
|
- name: notify-success
|
|
image: alpine/curl:latest
|
|
when:
|
|
status: success
|
|
commands:
|
|
- curl -d "Tests erfolgreich in woodpecker" https://ntfy.sh/OEOr8DNB0aT2mXWg231PeEEKwvuzt86qgM8ezQmgfcX9ZIlZ35
|
|
|
|
- name: notify-failure
|
|
image: alpine/curl:latest
|
|
when:
|
|
status: failure
|
|
commands:
|
|
- curl -d "Tests fehlgeschlagen in woodpecker" https://ntfy.sh/OEOr8DNB0aT2mXWg231PeEEKwvuzt86qgM8ezQmgfcX9ZIlZ35
|