-
Notifications
You must be signed in to change notification settings - Fork 1
129 lines (114 loc) · 3.66 KB
/
Copy pathfe-e2e.yml
File metadata and controls
129 lines (114 loc) · 3.66 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
name: Frontend E2E Workflow
on:
workflow_call:
secrets:
PERCY_TOKEN:
required: false
inputs:
GHA_REF:
type: string
required: true
GHA_BASE:
type: string
required: true
jobs:
e2e-playwright:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
with:
ref: ${{ inputs.GHA_REF }}
fetch-depth: 0
- uses: actions/setup-node@v3
with:
node-version: 22.15.0
- name: Cache Node Modules
id: npm-cache
uses: actions/cache@v4
with:
path: '**/node_modules'
key: ${{ runner.os }}-modules-${{ hashFiles('**/package-lock.json') }}
- name: Install Playwright Browsers
run: npx playwright install --with-deps
- name: Fetch base branch
run: git fetch origin ${{ inputs.GHA_BASE }}:${{ inputs.GHA_BASE }} || true
- name: Affected Regression Tests
id: playwrightRegressionTests
continue-on-error: true
uses: collaborationFactory/github-actions/.github/actions/run-many@test/playwright
with:
target: 'e2e-playwright'
jobIndex: 1
jobCount: 1
base: ${{ inputs.GHA_BASE }}
ref: ${{ inputs.GHA_REF }}
- name: Fail pipeline if regressionTests step failed
run: |
if [ "${{ steps.playwrightRegressionTests.outcome }}" = "failure" ]; then
echo "Regression tests step failed, failing the pipeline."
exit 1
fi
e2e:
runs-on: ubuntu-latest
container:
image: cypress/browsers:22.15.0
options: --user 1001
timeout-minutes: 120
strategy:
matrix:
target: ['e2e']
jobIndex: [1, 2, 3, 4]
env:
jobCount: 4
steps:
- uses: actions/checkout@v4
with:
ref: ${{ inputs.GHA_REF }}
fetch-depth: 0
- name: Cache Node Modules
id: npm-cache
uses: actions/cache@v4
with:
path: '**/node_modules'
key: ${{ runner.os }}-modules-${{ hashFiles('**/package-lock.json') }}
- name: Install Cypress Binary
run: npx cypress install
- name: Fetch base branch
run: git fetch origin ${{ inputs.GHA_BASE }}:${{ inputs.GHA_BASE }} || true
- name: Affected Regression Tests
id: regressionTests
continue-on-error: true
uses: collaborationFactory/github-actions/.github/actions/run-many@master
with:
target: ${{ matrix.target }}
jobIndex: ${{ matrix.jobIndex }}
jobCount: ${{ env.jobCount }}
base: ${{ inputs.GHA_BASE }}
ref: ${{ inputs.GHA_REF }}
env:
PERCY_TOKEN: ${{ secrets.PERCY_TOKEN }}
PERCY_PARTIAL_BUILD: 1
DEV_STORIES: true
CYPRESS_INTERNAL_BROWSER_CONNECT_TIMEOUT: 300000
NODE_OPTIONS: --max-old-space-size=4096
CYPRESS_NO_COMMAND_LOG: 1
- name: Upload E2E Videos
uses: actions/upload-artifact@v4
with:
name: dist-${{ matrix.target }}-${{ matrix.jobIndex }}-e2e-videos
path: |
dist/cypress/apps/**/videos/
retention-days: 3
- name: Upload A11Y Reports
uses: actions/upload-artifact@v4
with:
name: dist-${{ matrix.target }}-${{ matrix.jobIndex }}-a11y-reports
path: |
dist/cypress/apps/**/a11y/html/
retention-days: 3
- name: Fail pipeline if regressionTests step failed
run: |
if [ "${{ steps.regressionTests.outcome }}" = "failure" ]; then
echo "Regression tests step failed, failing the pipeline."
exit 1
fi