-
Notifications
You must be signed in to change notification settings - Fork 0
73 lines (71 loc) · 2.29 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
64
65
66
67
68
69
70
71
72
73
name: E2E Tests
on:
push:
branches:
- main
workflow_dispatch:
inputs:
branchName:
description: 'Branch name.'
default: 'develop'
type: string
testPath:
description: 'Files to test.'
default: 'tests'
type: string
jobs:
test:
name: E2E Tests
timeout-minutes: 60
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4.1.1
with:
ref: ${{ inputs.branchName || 'main' }}
- name: Apt Pkgs
run: sudo apt install libnss3-tools
- name: Install mkcert
run: |
curl -JLO "https://dl.filippo.io/mkcert/latest?for=linux/amd64"
chmod +x mkcert-v*-linux-amd64
sudo cp mkcert-v*-linux-amd64 /usr/local/bin/mkcert
- name: Install Certificates
run: |
mkcert -install
mkcert -key-file busmap.localhost-key.pem -cert-file busmap.localhost.pem busmap.localhost localhost
cp *.pem packages/web/certs
- name: Setup Node
uses: actions/setup-node@v4.0.1
with:
node-version: '20.11.0'
- name: Install Dependencies
run: npm ci
- name: Install Playwright
run: npx playwright install --with-deps
- name: Run Tests
run: npm test -- ${{ inputs.testPath || 'tests' }}
env:
CI: true
SERVER_NAME: localhost
HOST_NAME: localhost
UPSTREAM_API_HOST: api
SSL_CERT_PATH: /etc/nginx/certs/busmap.localhost.pem
SSL_KEY_PATH: /etc/nginx/certs/busmap.localhost-key.pem
BM_REDIS_HOST: redis://session
BM_SESSION_STORE: redis
BM_COOKIE_SECURE: true
BM_COOKIE_SAMESITE: strict
BM_COOKIE_SECRET: ${{ secrets.BM_COOKIE_SECRET }}
BM_POSTGRES_PASSWORD: ${{ secrets.BM_POSTGRES_PASSWORD }}
BM_POSTGRES_USER: ${{ secrets.BM_POSTGRES_USER }}
BM_POSTGRES_DB: ${{ secrets.BM_POSTGRES_DB }}
SSO_GOOG_CLIENT_ID: ${{ secrets.SSO_GOOG_CLIENT_ID }}
SSO_GOOG_CLIENT_SECRET: ${{ secrets.SSO_GOOG_CLIENT_SECRET }}
- name: Upload Test Results
uses: actions/upload-artifact@v4.3.0
if: failure()
with:
name: playwright-report
path: test-results
retention-days: 15