-
Notifications
You must be signed in to change notification settings - Fork 61
183 lines (152 loc) · 4.92 KB
/
e2e-tests.yml
File metadata and controls
183 lines (152 loc) · 4.92 KB
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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
# E2E tests for the React SDK using the teamspace-react sample app.
name: 🧪 E2E Tests
on:
pull_request:
branches: [main]
paths:
- 'packages/**'
- 'samples/teamspace-react/**'
- 'e2e/**'
workflow_dispatch:
inputs:
idp_target:
description: 'IDP target (is, thunder, both)'
required: false
default: 'both'
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
jobs:
e2e-is:
name: 🧪 E2E (WSO2 IS)
if: >-
github.event_name == 'pull_request' ||
github.event.inputs.idp_target == 'is' ||
github.event.inputs.idp_target == 'both'
runs-on: ubuntu-latest
timeout-minutes: 30
strategy:
matrix:
node-version: [lts/*]
pnpm-version: [latest]
steps:
- name: ⬇️ Checkout
uses: actions/checkout@v4
- name: 🟢 Setup node
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- name: 🥡 Setup pnpm
uses: pnpm/action-setup@v4
with:
version: ${{ matrix.pnpm-version }}
run_install: false
- name: 🎈 Get pnpm store directory
id: get-pnpm-cache-dir
run: echo "pnpm_cache_dir=$(pnpm store path)" >> $GITHUB_OUTPUT
- name: 🔆 Cache pnpm modules
uses: actions/cache@v4
with:
path: ${{ steps.get-pnpm-cache-dir.outputs.pnpm_cache_dir }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: 🧩 Install Dependencies
run: pnpm install --frozen-lockfile
- name: 🏗️ Build SDK packages
run: pnpm build
- name: 🎭 Install Playwright browsers
run: pnpm e2e:install
- name: 🐳 Start WSO2 IS
run: pnpm e2e:docker:up:is
- name: 🧪 Run E2E redirect tests against IS
run: pnpm e2e -- --idp is --mode redirect
env:
CI: true
- name: 🧪 Run E2E embedded tests against IS
run: pnpm e2e -- --idp is --mode embedded
env:
CI: true
- name: 📊 Upload redirect test report
uses: actions/upload-artifact@v4
if: always()
with:
name: e2e-is-redirect-report
path: e2e/playwright-report/
retention-days: 14
- name: 📊 Upload embedded test report
uses: actions/upload-artifact@v4
if: always()
with:
name: e2e-is-embedded-report
path: e2e/playwright-report-embedded/
retention-days: 14
- name: 🐳 Stop Docker containers
if: always()
run: pnpm e2e:docker:down
e2e-thunder:
name: 🧪 E2E (Thunder)
if: >-
github.event_name == 'pull_request' ||
github.event.inputs.idp_target == 'thunder' ||
github.event.inputs.idp_target == 'both'
runs-on: ubuntu-latest
timeout-minutes: 20
strategy:
matrix:
node-version: [lts/*]
pnpm-version: [latest]
steps:
- name: ⬇️ Checkout
uses: actions/checkout@v4
- name: 🟢 Setup node
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- name: 🥡 Setup pnpm
uses: pnpm/action-setup@v4
with:
version: ${{ matrix.pnpm-version }}
run_install: false
- name: 🎈 Get pnpm store directory
id: get-pnpm-cache-dir
run: echo "pnpm_cache_dir=$(pnpm store path)" >> $GITHUB_OUTPUT
- name: 🔆 Cache pnpm modules
uses: actions/cache@v4
with:
path: ${{ steps.get-pnpm-cache-dir.outputs.pnpm_cache_dir }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: 🧩 Install Dependencies
run: pnpm install --frozen-lockfile
- name: 🏗️ Build SDK packages
run: pnpm build
- name: 🎭 Install Playwright browsers
run: pnpm e2e:install
- name: 🐳 Start Thunder
run: pnpm e2e:docker:up:thunder
- name: 🧪 Run E2E redirect tests against Thunder
run: pnpm e2e -- --idp thunder --mode redirect
env:
CI: true
- name: 🧪 Run E2E embedded tests against Thunder
run: pnpm e2e -- --idp thunder --mode embedded
env:
CI: true
- name: 📊 Upload redirect test report
uses: actions/upload-artifact@v4
if: always()
with:
name: e2e-thunder-redirect-report
path: e2e/playwright-report/
retention-days: 14
- name: 📊 Upload embedded test report
uses: actions/upload-artifact@v4
if: always()
with:
name: e2e-thunder-embedded-report
path: e2e/playwright-report-embedded/
retention-days: 14
- name: 🐳 Stop Docker containers
if: always()
run: pnpm e2e:docker:down