-
Notifications
You must be signed in to change notification settings - Fork 2
96 lines (82 loc) · 2.43 KB
/
e2e-test.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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
name: End-to-End testing check for Playground Apps
env:
BRANCH_NAME_RAW: ${{ github.head_ref || github.ref_name }}
on:
pull_request:
branches: [ main ]
push:
branches:
- playwright_setup
jobs:
prepare:
runs-on: ubuntu-latest
outputs:
BRANCH_NAME: ${{ steps.set_branch_name.outputs.BRANCH_NAME }}
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Normalize branch name
id: set_branch_name
run: echo "BRANCH_NAME=$(echo $BRANCH_NAME_RAW | tr '/_' '-')" >> $GITHUB_OUTPUT
shell: bash
- name: Set up Node.js
uses: actions/setup-node@v4
- name: Cache node modules
uses: actions/cache@v3
with:
path: node_modules
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Install Dependencies
run: |
npm ci
npm install lerna
- name: Upload node_modules
uses: actions/upload-artifact@v4
with:
name: node-modules
path: node_modules
e2e-tests:
timeout-minutes: 60
needs: prepare
runs-on: ubuntu-latest
strategy:
matrix:
include:
- app: "react"
url: ".react.playground.corbado.io/"
type: "ui"
# - app: "react-sdk"
# url: ".react-sdk.korbado.com/"
# type: "sdk"
# Add more playground apps as needed
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v4
- name: Download node_modules
uses: actions/download-artifact@v4
with:
name: node-modules
path: node_modules
- name: Grant execute permissions for Playwright
run: chmod +x node_modules/.bin/playwright
- name: Install Playwright Browsers
run: npx playwright install --with-deps
- name: Run E2E Test for ${{ matrix.app }}
run: |
if [ "${{ matrix.type }}" = "sdk" ]; then
npm run test:e2e:sdk
else
npm run test:e2e:ui
fi
env:
PLAYWRIGHT_TEST_URL: ${{ format('https://{0}{1}', needs.prepare.outputs.BRANCH_NAME, matrix.url) }}
- uses: actions/upload-artifact@v4
if: always()
with:
name: playwright-report
path: packages/tests-e2e/playwright-report/
retention-days: 30