-
Notifications
You must be signed in to change notification settings - Fork 489
171 lines (158 loc) · 5.6 KB
/
Copy pathtests-e2e-playwright-v2.yml
File metadata and controls
171 lines (158 loc) · 5.6 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
name: E2E Playwright Tests (v2)
on:
# Manual trigger
workflow_dispatch:
inputs:
environment:
description: 'Environment to run tests'
type: choice
options:
- staging
default: 'staging'
debug:
description: 'Enable SSH debugging'
type: boolean
default: false
# Trigger on PR with label (remove and re-add label to rerun)
pull_request:
types: [labeled]
# Nightly schedule (0 AM UTC)
schedule:
- cron: '0 0 * * *'
# Cancel in-progress runs for the same PR/branch
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
# Check if workflow should run (for PR label trigger)
check-trigger:
runs-on: ubuntu-latest
outputs:
should_run: ${{ steps.check.outputs.should_run }}
steps:
- name: Check trigger conditions
id: check
env:
EVENT_NAME: ${{ github.event_name }}
HAS_E2E_LABEL: ${{ contains(github.event.pull_request.labels.*.name, 'e2e-tests') }}
HAS_RUN_ALL_LABEL: ${{ contains(github.event.pull_request.labels.*.name, 'run-all-tests') }}
HAS_DEPENDENCIES_LABEL: ${{ contains(github.event.pull_request.labels.*.name, 'dependencies') }}
run: |
if [[ "$EVENT_NAME" == "workflow_dispatch" ]]; then
echo "should_run=true" >> $GITHUB_OUTPUT
elif [[ "$EVENT_NAME" == "schedule" ]]; then
echo "should_run=true" >> $GITHUB_OUTPUT
elif [[ "$EVENT_NAME" == "pull_request" ]]; then
if [[ "$HAS_E2E_LABEL" == "true" || "$HAS_RUN_ALL_LABEL" == "true" || "$HAS_DEPENDENCIES_LABEL" == "true" ]]; then
echo "should_run=true" >> $GITHUB_OUTPUT
else
echo "should_run=false" >> $GITHUB_OUTPUT
fi
else
echo "should_run=false" >> $GITHUB_OUTPUT
fi
# Lint and type-check E2E code
lint:
name: Lint
needs: check-trigger
if: needs.check-trigger.outputs.should_run == 'true'
uses: ./.github/workflows/tests-e2e-playwright-lint.yml
# Chromium tests (local dev mode) - no build required
e2e-dev-chromium:
name: Chromium (Dev)
needs: lint
uses: ./.github/workflows/tests-e2e-playwright-chromium.yml
secrets: inherit
with:
environment: ${{ inputs.environment || 'staging' }}
debug: ${{ inputs.debug || false }}
# Build Docker image for Docker tests
build-docker:
name: Build Docker
needs: lint
uses: ./.github/workflows/pipeline-build-docker.yml
secrets: inherit
with:
debug: ${{ inputs.debug || false }}
for_e2e_tests: true
# Docker tests (Chromium against Docker image)
e2e-docker:
name: Docker
needs: build-docker
uses: ./.github/workflows/tests-e2e-playwright-docker.yml
secrets: inherit
with:
environment: ${{ inputs.environment || 'staging' }}
debug: ${{ inputs.debug || false }}
# Build Linux AppImage for Electron tests
build-linux:
name: Build Linux
needs: lint
uses: ./.github/workflows/pipeline-build-linux.yml
secrets: inherit
with:
environment: ${{ inputs.environment || 'staging' }}
target: 'build_linux_appimage_x64'
debug: ${{ inputs.debug || false }}
enterprise: false
# Electron tests (Linux AppImage)
e2e-electron:
name: Electron (Linux)
needs: build-linux
uses: ./.github/workflows/tests-e2e-playwright-electron.yml
secrets: inherit
with:
environment: ${{ inputs.environment || 'staging' }}
debug: ${{ inputs.debug || false }}
# Alert on any non-success nightly result (incl. 'cancelled' from a timeout).
notify-slack:
name: Notify Slack on nightly failure
needs:
- lint
- build-docker
- build-linux
- e2e-dev-chromium
- e2e-docker
- e2e-electron
if: |
always() &&
github.event_name == 'schedule' &&
(needs.lint.result != 'success' ||
needs.build-docker.result != 'success' ||
needs.build-linux.result != 'success' ||
needs.e2e-dev-chromium.result != 'success' ||
needs.e2e-docker.result != 'success' ||
needs.e2e-electron.result != 'success')
runs-on: ubuntu-latest
steps:
- name: Post to Slack
uses: slackapi/slack-github-action@v3.0.5
with:
method: chat.postMessage
token: ${{ secrets.SLACK_TEST_REPORT_KEY }}
payload: |
channel: "${{ secrets.SLACK_TEST_REPORT_CHANNEL }}"
text: "<!here> *Nightly E2E did not succeed* — `${{ github.repository }}` on `${{ github.ref_name }}` @ `${{ github.sha }}`"
attachments:
- color: "#cc0000"
title: "${{ github.workflow }}"
title_link: "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
fields:
- title: "Lint"
value: "${{ needs.lint.result }}"
short: true
- title: "Build Docker"
value: "${{ needs.build-docker.result }}"
short: true
- title: "Build Linux"
value: "${{ needs.build-linux.result }}"
short: true
- title: "Chromium (Dev)"
value: "${{ needs.e2e-dev-chromium.result }}"
short: true
- title: "Docker"
value: "${{ needs.e2e-docker.result }}"
short: true
- title: "Electron (Linux)"
value: "${{ needs.e2e-electron.result }}"
short: true