-
Notifications
You must be signed in to change notification settings - Fork 965
167 lines (157 loc) · 6.36 KB
/
Copy pathe2e-functional.yml
File metadata and controls
167 lines (157 loc) · 6.36 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
name: Electron Playwright Tests
on:
push:
branches: [master]
pull_request:
types: [labeled]
workflow_dispatch:
inputs:
version_name:
type: string
description: "Desktop Version name eg: 5.6"
required: true
platform:
type: choice
description: "Choose platform to run tests"
required: true
default: "all"
options: [linux, macos, windows, all]
jobs:
update-initial-status-linux:
runs-on: ubuntu-22.04
if: contains(github.event.label.name, 'Run Desktop E2E Tests')
steps:
- uses: mattermost/actions/delivery/update-commit-status@main
env:
GITHUB_TOKEN: ${{ github.token }}
with:
repository_full_name: ${{ github.repository }}
commit_sha: ${{ github.event.pull_request.head.sha }}
context: e2e/linux
description: E2E tests for Mattermost desktop app on Linux have started...
status: pending
update-initial-status-macos:
runs-on: ubuntu-22.04
if: contains(github.event.label.name, 'Run Desktop E2E Tests')
steps:
- uses: mattermost/actions/delivery/update-commit-status@main
env:
GITHUB_TOKEN: ${{ github.token }}
with:
repository_full_name: ${{ github.repository }}
commit_sha: ${{ github.event.pull_request.head.sha }}
context: e2e/macOS
description: E2E tests for Mattermost desktop app on macOS have started...
status: pending
# TODO: uncomment when https://mattermost.atlassian.net/browse/MM-63397 is fixed
# update-initial-status-windows:
# runs-on: ubuntu-22.04
# if: contains(github.event.label.name, 'Run Desktop E2E Tests')
# steps:
# - uses: mattermost/actions/delivery/update-commit-status@main
# env:
# GITHUB_TOKEN: ${{ github.token }}
# with:
# repository_full_name: ${{ github.repository }}
# commit_sha: ${{ github.event.pull_request.head.sha }}
# context: e2e/windows
# description: E2E tests for Mattermost desktop app on Windows have started...
# status: pending
determine-platforms:
if: contains(github.event.label.name, 'Run Desktop E2E Tests')
needs: [update-initial-status-linux, update-initial-status-macos] #, update-initial-status-windows]
runs-on: ubuntu-latest
outputs:
platforms: ${{ steps.set-matrix.outputs.platforms }}
steps:
- id: set-matrix
run: |
if [[ "${{ github.event_name }}" == "workflow_dispatch" ]]; then
if [[ "${{ inputs.platform }}" == "all" ]]; then
echo "platforms=['ubuntu-22.04', 'macos-13', 'windows-2022']" >> $GITHUB_OUTPUT
else
case "${{ inputs.platform }}" in
linux) echo "platforms=['ubuntu-22.04']" ;;
macos) echo "platforms=['macos-13']" ;;
# windows) echo "platforms=['windows-2022']" ;; TODO: uncomment when https://mattermost.atlassian.net/browse/MM-63397 is fixed
esac >> $GITHUB_OUTPUT
fi
elif [[ "${{ github.event_name }}" == "push" ]] || [[ "${{ contains(github.event.pull_request.labels.*.name, 'Run Desktop E2E Tests') }}" == "true" ]]; then
echo "platforms=['ubuntu-22.04', 'macos-13']" >> $GITHUB_OUTPUT
# echo "platforms=['ubuntu-22.04', 'macos-13', 'windows-2022']" >> $GITHUB_OUTPUT
else
echo "platforms=[]" >> $GITHUB_OUTPUT
fi
e2e-tests:
needs: determine-platforms
strategy:
matrix:
os: ${{ fromJson(needs.determine-platforms.outputs.platforms) }}
fail-fast: false
uses: ./.github/workflows/e2e-functional-template.yml
secrets: inherit
with:
runs-on: ${{ matrix.os }}
DESKTOP_VERSION: ${{ inputs.version_name || github.head_ref || github.ref }}
update-final-status-linux:
runs-on: ubuntu-22.04
needs:
- e2e-tests
steps:
- uses: mattermost/actions/delivery/update-commit-status@main
env:
GITHUB_TOKEN: ${{ github.token }}
with:
repository_full_name: ${{ github.repository }}
commit_sha: ${{ github.event.pull_request.head.sha }}
context: e2e/linux
description: Completed with ${{ needs.e2e-tests.outputs.NEW_FAILURES_LINUX }} failures
status: ${{ needs.e2e-tests.outputs.STATUS_LINUX }}
target_url: ${{ needs.e2e-tests.outputs.REPORT_LINK_LINUX }}
update-final-status-macos:
runs-on: ubuntu-22.04
needs:
- e2e-tests
steps:
- uses: mattermost/actions/delivery/update-commit-status@main
env:
GITHUB_TOKEN: ${{ github.token }}
with:
repository_full_name: ${{ github.repository }}
commit_sha: ${{ github.event.pull_request.head.sha }}
context: e2e/macOS
description: Completed with ${{ needs.e2e-tests.outputs.NEW_FAILURES_MACOS }} failures
status: ${{ needs.e2e-tests.outputs.STATUS_MACOS }}
target_url: ${{ needs.e2e-tests.outputs.REPORT_LINK_MACOS }}
# TODO: uncomment when https://mattermost.atlassian.net/browse/MM-63397 is fixed
# update-final-status-windows:
# runs-on: ubuntu-22.04
# needs:
# - e2e-tests
# steps:
# - uses: mattermost/actions/delivery/update-commit-status@main
# env:
# GITHUB_TOKEN: ${{ github.token }}
# with:
# repository_full_name: ${{ github.repository }}
# commit_sha: ${{ github.event.pull_request.head.sha }}
# context: e2e/windows
# description: Completed with ${{ needs.e2e-tests.outputs.NEW_FAILURES_WINDOWS }} failures
# status: ${{ needs.e2e-tests.outputs.STATUS_WINDOWS }}
# target_url: ${{ needs.e2e-tests.outputs.REPORT_LINK_WINDOWS }}
e2e-remove-label:
if: ${{ always() && contains(github.event.pull_request.labels.*.name, 'Run Desktop E2E Tests') }}
needs: e2e-tests
runs-on: ubuntu-22.04
steps:
- name: Remove E2E test label
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
continue-on-error: true # Label might have been removed manually
with:
script: |
github.rest.issues.removeLabel({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
name: 'Run Desktop E2E Tests',
});