-
Notifications
You must be signed in to change notification settings - Fork 2
151 lines (128 loc) · 4.7 KB
/
test-client-e2e.yaml
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
---
# This workflow runs client E2E tests using Playwright
#
# See: https://playwright.dev/
name: Client E2E Tests
# yamllint disable-line rule:truthy
on:
# schedule tests to run every day at 3pm UTC (10am eastern) monday-friday
schedule:
- cron: '0 15 * * 1-5'
jobs:
e2e-tests:
name: Playwright E2E Tests
timeout-minutes: 30
runs-on: ubuntu-22.04
# Shard the tests across multiple machines to improve performance
# Can be increased as needed starting with a small pool
strategy:
fail-fast: false
matrix:
shardIndex: [1]
shardTotal: [1]
steps:
- uses: actions/checkout@v3
# Debugging purposes to verify branch being worked on
- run: git branch
- name: Use Node v18.8.0
uses: actions/setup-node@v3
with:
node-version: 18.8.0
cache: 'yarn'
- name: Install dependencies
run: yarn install --immutable
- name: Cache Browsers
id: cache-browsers
uses: actions/cache@v3
env:
cache-name: cache-playwright-browsers
with:
# Playwright browsers are stored in
# %USERPROFILE%\AppData\Local\ms-playwright on Windows
# ~/Library/Caches/ms-playwright on MacOS
# ~/.cache/ms-playwright on Linux
path: ~/.cache/ms-playwright
key: ${{ runner.os }}-${{ env.cache-name }}-${{ hashFiles('**/yarn.lock') }}
# Install Playwright browsers and dependencies if cache miss
- if: ${{ steps.cache-browsers.outputs.cache-hit != 'true' }}
name: Install Playwright Browsers
run: npx playwright install --with-deps
# Install Playwright dependencies only if cache hit
- if: ${{ steps.cache-browsers.outputs.cache-hit == 'true' }}
name: Install Playwright Dependencies
run: npx playwright install-deps
- name: Run Playwright tests
run: yarn workspace hmi-client test:e2e --shard=${{ matrix.shardIndex }}/${{ matrix.shardTotal }}
- name: Upload test artifacts on failure
uses: actions/upload-artifact@v3
if: failure()
with:
name: playwright-e2e-report
path: packages/client/**/tests/e2e/test-report/
retention-days: 10
# ct-tests-docker:
# name: Playwright Component Tests w Docker
# timeout-minutes: 30
# runs-on: ubuntu-22.04
# container:
# image: mcr.microsoft.com/playwright:v1.31.1-focal
# steps:
# - uses: actions/checkout@v3
# - name: Use Node v18.8.0
# uses: actions/setup-node@v3
# with:
# node-version: 18.8.0
# cache: 'yarn'
# - name: Install dependencies
# run: yarn install --immutable
# - name: Run Playwright tests
# run: yarn workspace hmi-client test:ct
# - name: Upload test artifacts on failure
# uses: actions/upload-artifact@v3
# if: failure()
# with:
# name: playwright-ct-report
# path: packages/client/**/tests/component/test-report/
# retention-days: 10
# ct-tests:
# name: Playwright Component Tests
# timeout-minutes: 30
# runs-on: ubuntu-22.04
# steps:
# - uses: actions/checkout@v3
# - name: Use Node v18.8.0
# uses: actions/setup-node@v3
# with:
# node-version: 18.8.0
# cache: 'yarn'
# - name: Install dependencies
# run: yarn install --immutable
# - name: Cache Browsers
# id: cache-browsers
# uses: actions/cache@v3
# env:
# cache-name: cache-playwright-browsers
# with:
# # Playwright browsers are stored in
# # %USERPROFILE%\AppData\Local\ms-playwright on Windows
# # ~/Library/Caches/ms-playwright on MacOS
# # ~/.cache/ms-playwright on Linux
# path: ~/.cache/ms-playwright
# key: ${{ runner.os }}-${{ env.cache-name }}-${{ hashFiles('**/yarn.lock') }}
# # Install Playwright browsers and dependencies if cache miss
# - if: ${{ steps.cache-browsers.outputs.cache-hit != 'true' }}
# name: Install Playwright Browsers
# run: npx playwright install --with-deps
# # Install Playwright dependencies only if cache hit
# - if: ${{ steps.cache-browsers.outputs.cache-hit == 'true' }}
# name: Install Playwright Dependencies
# run: npx playwright install-deps
# - name: Run Playwright tests
# run: yarn workspace hmi-client test:ct
# - name: Upload test artifacts on failure
# uses: actions/upload-artifact@v3
# if: failure()
# with:
# name: playwright-ct-report
# path: packages/client/**/tests/component/test-report/
# retention-days: 10