generated from bcgov/quickstart-openshift
-
Notifications
You must be signed in to change notification settings - Fork 0
63 lines (63 loc) · 2.11 KB
/
.e2e.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
name: .E2E
on:
workflow_call:
inputs:
frontend_url:
description: 'The URL of the frontend to test'
required: true
type: string
tag:
description: 'The tag of the containers to test'
default: 'latest'
type: string
required: false
jobs:
e2e-tests:
name: E2E Tests
runs-on: ubuntu-24.04
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Run Docker compose
if: ${{ inputs.frontend_url == 'http://localhost:3000' }}
env:
BACKEND_IMAGE: ghcr.io/${{ github.repository }}/backend:${{ inputs.tag }}
FLYWAY_IMAGE: ghcr.io/${{ github.repository }}/migrations:${{ inputs.tag }}
FRONTEND_IMAGE: ghcr.io/${{ github.repository }}/frontend:${{ inputs.tag }}
run: docker compose up -d --wait
continue-on-error: true
- name: Docker Compose Logs
if: ${{ inputs.frontend_url == 'http://localhost:3000' }}
run: docker compose logs
- name: Cache Playwright Browsers
uses: actions/cache@v4
id: playwright-cache
with:
path: |
~/.cache/ms-playwright
key: ${{ runner.os }}-playwright-${{ hashFiles('**/package-lock.json') }}
- uses: actions/setup-node@v4
name: Setup Node
with:
node-version: 22
cache: 'npm'
cache-dependency-path: frontend/package-lock.json
- name: Fix permissions
run: sudo chown -R $USER:$USER frontend
- name: Install dependencies
working-directory: frontend
run: |
npm ci
- run: npx @playwright/test install --with-deps
if: steps.playwright-cache.outputs.cache-hit != 'true'
working-directory: ./frontend
- run: npx @playwright/test install-deps
if: steps.playwright-cache.outputs.cache-hit == 'true'
working-directory: ./frontend
- name: Run Tests
working-directory: frontend
env:
E2E_BASE_URL: ${{ inputs.frontend_url }}
CI: 'true'
run: |
npx playwright test --project="chromium" --reporter=blob