Repository navigation
211 lines (182 loc) · 5.88 KB
/
Copy pathe2e.yml
File metadata and controls
211 lines (182 loc) · 5.88 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
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
name: e2e
on:
schedule:
- cron: "0 3 * * *"
push:
branches:
- master
pull_request:
workflow_dispatch:
permissions:
contents: read
jobs:
playwright:
name: playwright (${{ matrix.name }})
runs-on: ubuntu-latest
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
include:
- name: min-server
image: mattermost/mattermost-enterprise-edition:release-12.0
- name: master
image: mattermostdevelopment/mattermost-enterprise-edition:master
env:
CI: true
MM_IMAGE: ${{ matrix.image }}
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
- uses: actions/setup-go@v5
with:
go-version-file: go.mod
cache: true
- uses: actions/setup-node@v4
with:
node-version-file: .nvmrc
cache: npm
cache-dependency-path: |
webapp/package-lock.json
e2e/integration/package-lock.json
- name: Build E2E plugin bundle
run: make e2e-dist
env:
# Builds only for the runner's OS/arch.
MM_SERVICESETTINGS_ENABLEDEVELOPER: true
- name: Install e2e dependencies
working-directory: e2e/integration
run: |
npm ci
npx playwright install --with-deps chromium
- name: Type-check e2e
working-directory: e2e/integration
run: npm run tsc
- name: Start Mattermost
working-directory: e2e/integration
run: npm run env:up
- name: Run Playwright
working-directory: e2e/integration
run: npm run test:ci
- name: Collect server logs
if: failure()
working-directory: e2e/integration
run: mkdir -p playwright-report && docker compose logs mattermost > playwright-report/mattermost.log 2>&1 || true
- uses: actions/upload-artifact@v4
if: always()
with:
name: playwright-report-${{ matrix.name }}
path: e2e/integration/playwright-report
retention-days: 14
# Non-blocking: a screenshot diff needs a person to judge whether the change is intended.
visual:
name: playwright visual
runs-on: ubuntu-latest
timeout-minutes: 20
continue-on-error: true
env:
CI: true
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
- uses: actions/setup-go@v5
with:
go-version-file: go.mod
cache: true
- uses: actions/setup-node@v4
with:
node-version-file: .nvmrc
cache: npm
cache-dependency-path: |
webapp/package-lock.json
e2e/integration/package-lock.json
- name: Build E2E plugin bundle
run: make e2e-dist
env:
MM_SERVICESETTINGS_ENABLEDEVELOPER: true
- name: Install e2e dependencies
working-directory: e2e/integration
run: npm ci
- name: Compare screenshots
working-directory: e2e/integration
run: npm run test:visual
- uses: actions/upload-artifact@v4
if: failure()
with:
name: playwright-visual-diffs
path: |
e2e/integration/playwright-report
e2e/integration/test-results
retention-days: 14
contract-drift:
name: fake-github contract drift
if: github.event_name == 'schedule'
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
- uses: actions/setup-node@v4
with:
node-version-file: .nvmrc
cache: npm
cache-dependency-path: e2e/integration/package-lock.json
- name: Install e2e dependencies
working-directory: e2e/integration
run: npm ci
- name: Compare committed specs with GitHub's published REST description and GraphQL schema
working-directory: e2e/integration
run: npm run contract:check
real-github:
name: real github.com journey
if: (github.event_name == 'schedule' || github.event_name == 'workflow_dispatch') && vars.REAL_GITHUB_E2E_ENABLED == 'true'
runs-on: ubuntu-latest
timeout-minutes: 30
# The fixtures and hook on the test repository are shared between runs.
concurrency:
group: real-github-e2e
cancel-in-progress: false
env:
CI: true
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
- uses: actions/setup-go@v5
with:
go-version-file: go.mod
cache: true
- uses: actions/setup-node@v4
with:
node-version-file: .nvmrc
cache: npm
cache-dependency-path: |
webapp/package-lock.json
e2e/integration/package-lock.json
- name: Build plugin bundle
run: make dist
env:
MM_SERVICESETTINGS_ENABLEDEVELOPER: true
- name: Install e2e dependencies
working-directory: e2e/integration
run: |
npm ci
npx playwright install --with-deps chromium
- name: Start Mattermost
working-directory: e2e/integration
run: npm run env:up
# No report upload: it would carry real tokens and page content.
- name: Run journey
working-directory: e2e/integration
run: npm run test:real
env:
E2E_GITHUB_OAUTH_CLIENT_ID: ${{ secrets.E2E_GITHUB_OAUTH_CLIENT_ID }}
E2E_GITHUB_OAUTH_CLIENT_SECRET: ${{ secrets.E2E_GITHUB_OAUTH_CLIENT_SECRET }}
E2E_GITHUB_REPO: ${{ secrets.E2E_GITHUB_REPO }}
E2E_GITHUB_MACHINE_TOKEN: ${{ secrets.E2E_GITHUB_MACHINE_TOKEN }}
E2E_GITHUB_LOGIN_USERNAME: ${{ secrets.E2E_GITHUB_LOGIN_USERNAME }}
E2E_GITHUB_LOGIN_PASSWORD: ${{ secrets.E2E_GITHUB_LOGIN_PASSWORD }}
E2E_GITHUB_LOGIN_TOTP_SECRET: ${{ secrets.E2E_GITHUB_LOGIN_TOTP_SECRET }}