Skip to content
This repository was archived by the owner on Sep 11, 2024. It is now read-only.

Commit e20ae18

Browse files
authored
Revert "Split Cypress out into its own workflow (#8677)" (#8685)
This reverts commit 1722eb1.
1 parent 1722eb1 commit e20ae18

File tree

6 files changed

+124
-151
lines changed

6 files changed

+124
-151
lines changed

.github/workflows/cypress.yaml

Lines changed: 0 additions & 84 deletions
This file was deleted.
Lines changed: 122 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,122 @@
1+
# Produce a build of element-web with this version of react-sdk
2+
# and any matching branches of element-web and js-sdk, output it
3+
# as an artifact and run integration tests.
4+
name: Element Web - Build and Test
5+
on:
6+
pull_request: { }
7+
push:
8+
branches: [ develop, master ]
9+
repository_dispatch:
10+
types: [ upstream-sdk-notify ]
11+
env:
12+
# These must be set for fetchdep.sh to get the right branch
13+
REPOSITORY: ${{ github.repository }}
14+
PR_NUMBER: ${{ github.event.pull_request.number }}
15+
jobs:
16+
build:
17+
name: "Build Element-Web"
18+
runs-on: ubuntu-latest
19+
steps:
20+
- uses: actions/checkout@v2
21+
22+
- uses: actions/setup-node@v3
23+
with:
24+
cache: 'yarn'
25+
26+
- name: Fetch layered build
27+
id: layered_build
28+
run: |
29+
scripts/ci/layered.sh
30+
JSSDK_SHA=$(git -C matrix-js-sdk rev-parse --short=12 HEAD)
31+
REACT_SHA=$(git rev-parse --short=12 HEAD)
32+
VECTOR_SHA=$(git -C element-web rev-parse --short=12 HEAD)
33+
echo "::set-output name=VERSION::$VECTOR_SHA-react-$REACT_SHA-js-$JSSDK_SHA"
34+
35+
- name: Copy config
36+
run: cp element.io/develop/config.json config.json
37+
working-directory: ./element-web
38+
39+
- name: Build
40+
env:
41+
CI_PACKAGE: true
42+
VERSION: "${{ steps.layered_build.outputs.VERSION }}"
43+
run: yarn build
44+
working-directory: ./element-web
45+
46+
- name: Upload Artifact
47+
uses: actions/upload-artifact@v2
48+
with:
49+
name: previewbuild
50+
path: element-web/webapp
51+
# We'll only use this in a triggered job, then we're done with it
52+
retention-days: 1
53+
54+
cypress:
55+
name: "Cypress End to End Tests"
56+
needs: build
57+
runs-on: ubuntu-latest
58+
steps:
59+
- uses: actions/checkout@v2
60+
61+
- name: Download build
62+
uses: actions/download-artifact@v3
63+
with:
64+
name: previewbuild
65+
path: webapp
66+
67+
- name: Run Cypress tests
68+
uses: cypress-io/github-action@v2
69+
with:
70+
# The built-in Electron runner seems to grind to a halt trying
71+
# to run the tests, so use chrome.
72+
browser: chrome
73+
start: npx serve -p 8080 webapp
74+
record: true
75+
command-prefix: 'yarn percy exec --'
76+
env:
77+
# pass the Dashboard record key as an environment variable
78+
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}
79+
# pass the Percy token as an environment variable
80+
PERCY_TOKEN: ${{ secrets.PERCY_TOKEN }}
81+
# Use existing chromium rather than downloading another
82+
PUPPETEER_SKIP_CHROMIUM_DOWNLOAD: true
83+
PERCY_BROWSER_EXECUTABLE: /usr/bin/chromium-browser
84+
# pass GitHub token to allow accurately detecting a build vs a re-run build
85+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
86+
87+
- name: Upload Artifact
88+
if: failure()
89+
uses: actions/upload-artifact@v2
90+
with:
91+
name: cypress-results
92+
path: |
93+
cypress/screenshots
94+
cypress/videos
95+
cypress/synapselogs
96+
97+
- name: Store benchmark result
98+
if: github.ref == 'refs/heads/develop'
99+
uses: matrix-org/github-action-benchmark@jsperfentry-1
100+
with:
101+
name: Cypress measurements
102+
tool: 'jsperformanceentry'
103+
output-file-path: cypress/performance/measurements.json
104+
# The dashboard is available at https://matrix-org.github.io/matrix-react-sdk/cypress/bench/
105+
benchmark-data-dir-path: cypress/bench
106+
fail-on-alert: false
107+
comment-on-alert: false
108+
github-token: ${{ secrets.DEPLOY_GH_PAGES }}
109+
auto-push: ${{ github.ref == 'refs/heads/develop' }}
110+
111+
app-tests:
112+
name: Element Web Integration Tests
113+
runs-on: ubuntu-latest
114+
steps:
115+
- uses: actions/checkout@v2
116+
117+
- uses: actions/setup-node@v3
118+
with:
119+
cache: 'yarn'
120+
121+
- name: Run tests
122+
run: "./scripts/ci/app-tests.sh"

.github/workflows/element-web.yaml

Lines changed: 0 additions & 52 deletions
This file was deleted.

.github/workflows/netlify.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
name: Upload Preview Build to Netlify
44
on:
55
workflow_run:
6-
workflows: [ "Element Web - Build" ]
6+
workflows: [ "Element Web - Build and Test" ]
77
types:
88
- completed
99
jobs:

.github/workflows/sonarqube.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ on:
55
types:
66
- completed
77
concurrency:
8-
group: ${{ github.workflow }}-${{ github.event.workflow_run.head_branch }}
8+
group: ${{ github.workflow }}-${{ github.ref }}
99
cancel-in-progress: true
1010
jobs:
1111
prdetails:

.github/workflows/tests.yml

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -35,16 +35,3 @@ jobs:
3535
path: |
3636
coverage
3737
!coverage/lcov-report
38-
39-
app-tests:
40-
name: Element Web Integration Tests
41-
runs-on: ubuntu-latest
42-
steps:
43-
- uses: actions/checkout@v2
44-
45-
- uses: actions/setup-node@v3
46-
with:
47-
cache: 'yarn'
48-
49-
- name: Run tests
50-
run: "./scripts/ci/app-tests.sh"

0 commit comments

Comments
 (0)