employeeService/.github/workflows/playwright.yml
Jan Klattenhoff db0966fdd9
Some checks failed
Playwright Tests / test (pull_request) Failing after 15s
ci: add port mapping to Playwright workflow configuration
2025-01-17 10:18:08 +01:00

82 lines
2.1 KiB
YAML

name: Playwright Tests
on:
push:
branches: [ main, master ]
pull_request:
branches: [ main, master ]
jobs:
test:
timeout-minutes: 60
runs-on: ubuntu-latest
services:
postgres-employee:
container_name: postgres_employee
image: postgres:13.3
env:
POSTGRES_DB: employee_db
POSTGRES_USER: employee
POSTGRES_PASSWORD: secret
employee:
container_name: employee
image: berndheidemann/employee-management-service:1.1.3
# image: berndheidemann/employee-management-service_without_keycloak:1.1
env:
spring.datasource.url: jdbc:postgresql://postgres-employee:5432/employee_db
spring.datasource.username: employee
spring.datasource.password: secret
depends_on:
- postgres-employee
ports:
- 8089:8089
steps:
# Checkout the repository
- uses: actions/checkout@v4
- name: Debug
run: |
docker ps
apt update
apt install telnet -y
telnet localhost 8089
# Set up Node.js
- uses: actions/setup-node@v4
with:
node-version: lts/*
# Install project dependencies
- name: Install dependencies
run: npm ci
# Build the Angular project
- name: Build Angular Project
run: npm run build
# Start Angular development server
- name: Start Angular Development Server in Background
run: nohup npm start > angular.log 2>&1 &
env:
PORT: 4200 # Ensure the server runs on a predictable port
# Install Playwright and dependencies
- name: Install Playwright Browsers
run: npx playwright install --with-deps
# Run Playwright tests
- name: Run Playwright Tests
run: npx playwright test
env:
CI: true # Ensures Playwright runs in CI mode
# Upload Playwright report
- uses: actions/upload-artifact@v3
if: ${{ !cancelled() }}
with:
name: playwright-report
path: playwright-report/
retention-days: 30