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

Commit ffd95b4

Browse files
authored
Merge branch 'develop' into matthew/support-inter-on-custom-themes
2 parents eec265a + b1daf3f commit ffd95b4

File tree

336 files changed

+11586
-12100
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

336 files changed

+11586
-12100
lines changed

.eslintrc.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,8 @@ module.exports = {
8686
"jsx-a11y/no-static-element-interactions": "off",
8787
"jsx-a11y/role-supports-aria-props": "off",
8888
"jsx-a11y/tabindex-no-positive": "off",
89+
90+
"matrix-org/require-copyright-header": "error",
8991
},
9092
overrides: [
9193
{

.github/codecov.yml

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

.github/workflows/element-build-and-test.yaml

Lines changed: 21 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,14 @@ on:
88
branches: [ develop, master ]
99
repository_dispatch:
1010
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 }}
1115
jobs:
1216
build:
1317
name: "Build Element-Web"
1418
runs-on: ubuntu-latest
15-
env:
16-
# This must be set for fetchdep.sh to get the right branch
17-
PR_NUMBER: ${{github.event.number}}
1819
steps:
1920
- uses: actions/checkout@v2
2021

@@ -23,14 +24,23 @@ jobs:
2324
cache: 'yarn'
2425

2526
- name: Fetch layered build
26-
run: scripts/ci/layered.sh
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"
2734
2835
- name: Copy config
2936
run: cp element.io/develop/config.json config.json
3037
working-directory: ./element-web
3138

3239
- name: Build
33-
run: CI_PACKAGE=true yarn build
40+
env:
41+
CI_PACKAGE: true
42+
VERSION: "${{ steps.layered_build.outputs.VERSION }}"
43+
run: yarn build
3444
working-directory: ./element-web
3545

3646
- name: Upload Artifact
@@ -61,6 +71,12 @@ jobs:
6171
# to run the tests, so use chrome.
6272
browser: chrome
6373
start: npx serve -p 8080 webapp
74+
record: true
75+
env:
76+
# pass the Dashboard record key as an environment variable
77+
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}
78+
# pass GitHub token to allow accurately detecting a build vs a re-run build
79+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
6480

6581
- name: Upload Artifact
6682
if: failure()
@@ -75,9 +91,6 @@ jobs:
7591
app-tests:
7692
name: Element Web Integration Tests
7793
runs-on: ubuntu-latest
78-
env:
79-
# This must be set for fetchdep.sh to get the right branch
80-
PR_NUMBER: ${{github.event.number}}
8194
steps:
8295
- uses: actions/checkout@v2
8396

.github/workflows/end-to-end-tests.yaml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,13 @@ on:
99
branches: [ develop ]
1010
repository_dispatch:
1111
types: [ upstream-sdk-notify ]
12+
env:
13+
# These must be set for fetchdep.sh to get the right branch
14+
REPOSITORY: ${{ github.repository }}
15+
PR_NUMBER: ${{ github.event.pull_request.number }}
1216
jobs:
1317
end-to-end:
1418
runs-on: ubuntu-latest
15-
env:
16-
# This must be set for fetchdep.sh to get the right branch
17-
PR_NUMBER: ${{github.event.number}}
1819
container: vectorim/element-web-ci-e2etests-env:latest
1920
steps:
2021
- name: Checkout code

.github/workflows/netlify.yaml

Lines changed: 42 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -7,48 +7,58 @@ on:
77
types:
88
- completed
99
jobs:
10-
build:
10+
deploy:
1111
runs-on: ubuntu-latest
12-
if: >
13-
${{ github.event.workflow_run.conclusion == 'success' && github.event.workflow_run.event == 'pull_request' }}
12+
if: github.event.workflow_run.conclusion == 'success' && github.event.workflow_run.event == 'pull_request'
1413
steps:
1514
- name: "🔍 Read PR number"
1615
id: readctx
17-
# we need to find the PR number that corresponds to the branch, which we do by
18-
# searching the GH API
16+
# We need to find the PR number that corresponds to the branch, which we do by searching the GH API
1917
# The workflow_run event includes a list of pull requests, but it doesn't get populated for
2018
# forked PRs: https://docs.github.com/en/rest/reference/checks#create-a-check-run
2119
run: |
2220
head_branch='${{github.event.workflow_run.head_repository.owner.login}}:${{github.event.workflow_run.head_branch}}'
23-
echo "head branch: $head_branch"
21+
echo "Head branch: $head_branch"
2422
pulls_uri="https://api.github.com/repos/${{ github.repository }}/pulls?head=$(jq -Rr '@uri' <<<$head_branch)"
2523
pr_number=$(curl -s -H 'Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}' "$pulls_uri" |
2624
jq -r '.[] | .number')
2725
echo "PR number: $pr_number"
2826
echo "::set-output name=prnumber::$pr_number"
2927
30-
# There's a 'download artifact' action but it hasn't been updated for the
28+
- name: Create Deployment
29+
uses: bobheadxi/deployments@v1
30+
id: deployment
31+
with:
32+
step: start
33+
token: ${{ secrets.GITHUB_TOKEN }}
34+
env: Netlify
35+
ref: ${{ github.event.workflow_run.head_sha }}
36+
desc: |
37+
Do you trust the author of this PR? Maybe this build will steal your keys or give you malware.
38+
Exercise caution. Use test accounts.
39+
40+
# There's a 'download artifact' action, but it hasn't been updated for the
3141
# workflow_run action (https://github.com/actions/download-artifact/issues/60)
3242
# so instead we get this mess:
3343
- name: 'Download artifact'
3444
uses: actions/[email protected]
3545
with:
3646
script: |
37-
var artifacts = await github.actions.listWorkflowRunArtifacts({
38-
owner: context.repo.owner,
39-
repo: context.repo.repo,
40-
run_id: ${{github.event.workflow_run.id }},
47+
const artifacts = await github.actions.listWorkflowRunArtifacts({
48+
owner: context.repo.owner,
49+
repo: context.repo.repo,
50+
run_id: ${{ github.event.workflow_run.id }},
4151
});
42-
var matchArtifact = artifacts.data.artifacts.filter((artifact) => {
43-
return artifact.name == "previewbuild"
52+
const matchArtifact = artifacts.data.artifacts.filter((artifact) => {
53+
return artifact.name == "previewbuild"
4454
})[0];
45-
var download = await github.actions.downloadArtifact({
46-
owner: context.repo.owner,
47-
repo: context.repo.repo,
48-
artifact_id: matchArtifact.id,
49-
archive_format: 'zip',
55+
const download = await github.actions.downloadArtifact({
56+
owner: context.repo.owner,
57+
repo: context.repo.repo,
58+
artifact_id: matchArtifact.id,
59+
archive_format: 'zip',
5060
});
51-
var fs = require('fs');
61+
const fs = require('fs');
5262
fs.writeFileSync('${{github.workspace}}/previewbuild.zip', Buffer.from(download.data));
5363
5464
- name: Extract Artifacts
@@ -69,12 +79,17 @@ jobs:
6979
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}
7080
timeout-minutes: 1
7181

72-
- name: Edit PR Description
73-
uses: Beakyn/gha-comment-pull-request@2167a7aee24f9e61ce76a23039f322e49a990409
74-
env:
75-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
82+
- name: Update deployment status
83+
uses: bobheadxi/deployments@v1
84+
if: always()
7685
with:
77-
pull-request-number: ${{ steps.readctx.outputs.prnumber }}
78-
description-message: |
79-
Preview: ${{ steps.netlify.outputs.deploy-url }}
80-
⚠️ Do you trust the author of this PR? Maybe this build will steal your keys or give you malware. Exercise caution. Use test accounts.
86+
step: finish
87+
override: false
88+
token: ${{ secrets.GITHUB_TOKEN }}
89+
status: ${{ job.status }}
90+
env: ${{ steps.deployment.outputs.env }}
91+
deployment_id: ${{ steps.deployment.outputs.deployment_id }}
92+
env_url: ${{ steps.netlify.outputs.deploy-url }}
93+
desc: |
94+
Do you trust the author of this PR? Maybe this build will steal your keys or give you malware.
95+
Exercise caution. Use test accounts.

.github/workflows/preview_changelog.yaml

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

.github/workflows/pull_request.yaml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: Pull Request
2+
on:
3+
pull_request_target:
4+
types: [ opened, edited, labeled, unlabeled ]
5+
jobs:
6+
changelog:
7+
name: Preview Changelog
8+
runs-on: ubuntu-latest
9+
steps:
10+
- uses: matrix-org/allchange@main
11+
with:
12+
ghToken: ${{ secrets.GITHUB_TOKEN }}
13+
14+
enforce-label:
15+
name: Enforce Labels
16+
runs-on: ubuntu-latest
17+
permissions:
18+
pull-requests: read
19+
steps:
20+
- uses: yogevbd/[email protected]
21+
with:
22+
REQUIRED_LABELS_ANY: "T-Defect,T-Enhancement,T-Task"
23+
BANNED_LABELS: "X-Blocked"
24+
BANNED_LABELS_DESCRIPTION: "Preventing merge whilst PR is marked blocked!"

.github/workflows/sonarqube.yml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: SonarQube
2+
on:
3+
workflow_run:
4+
workflows: [ "Tests" ]
5+
types:
6+
- completed
7+
jobs:
8+
sonarqube:
9+
name: SonarQube
10+
runs-on: ubuntu-latest
11+
if: github.event.workflow_run.conclusion == 'success'
12+
steps:
13+
- uses: actions/checkout@v2
14+
with:
15+
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
16+
17+
# There's a 'download artifact' action, but it hasn't been updated for the workflow_run action
18+
# (https://github.com/actions/download-artifact/issues/60) so instead we get this mess:
19+
- name: Download Coverage Report
20+
uses: actions/[email protected]
21+
with:
22+
script: |
23+
const artifacts = await github.actions.listWorkflowRunArtifacts({
24+
owner: context.repo.owner,
25+
repo: context.repo.repo,
26+
run_id: ${{ github.event.workflow_run.id }},
27+
});
28+
const matchArtifact = artifacts.data.artifacts.filter((artifact) => {
29+
return artifact.name == "coverage"
30+
})[0];
31+
const download = await github.actions.downloadArtifact({
32+
owner: context.repo.owner,
33+
repo: context.repo.repo,
34+
artifact_id: matchArtifact.id,
35+
archive_format: 'zip',
36+
});
37+
const fs = require('fs');
38+
fs.writeFileSync('${{github.workspace}}/coverage.zip', Buffer.from(download.data));
39+
40+
- name: Extract Coverage Report
41+
run: unzip -d coverage coverage.zip && rm coverage.zip
42+
43+
- name: SonarCloud Scan
44+
uses: SonarSource/sonarcloud-github-action@master
45+
env:
46+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
47+
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}

.github/workflows/static_analysis.yaml

Lines changed: 26 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,14 @@ on:
55
branches: [ develop, master ]
66
repository_dispatch:
77
types: [ upstream-sdk-notify ]
8+
env:
9+
# These must be set for fetchdep.sh to get the right branch
10+
REPOSITORY: ${{ github.repository }}
11+
PR_NUMBER: ${{ github.event.pull_request.number }}
812
jobs:
913
ts_lint:
1014
name: "Typescript Syntax Check"
1115
runs-on: ubuntu-latest
12-
env:
13-
# This must be set for fetchdep.sh to get the right branch
14-
PR_NUMBER: ${{github.event.number}}
1516
steps:
1617
- uses: actions/checkout@v2
1718

@@ -37,11 +38,32 @@ jobs:
3738
run: "yarn run lint:types"
3839

3940
i18n_lint:
40-
name: "i18n Diff Check"
41+
name: "i18n Check"
4142
runs-on: ubuntu-latest
43+
permissions:
44+
pull-requests: read
4245
steps:
4346
- uses: actions/checkout@v2
4447

48+
- name: "Get modified files"
49+
id: changed_files
50+
if: github.event_name == 'pull_request' && github.actor != 'RiotTranslateBot'
51+
uses: tj-actions/changed-files@v19
52+
with:
53+
files: |
54+
src/i18n/strings/*
55+
files_ignore: |
56+
src/i18n/strings/en_EN.json
57+
58+
- name: "Assert only en_EN was modified"
59+
if: |
60+
github.event_name == 'pull_request' &&
61+
github.actor != 'RiotTranslateBot' &&
62+
steps.changed_files.outputs.any_modified == 'true'
63+
run: |
64+
echo "You can only modify en_EN.json, do not touch any of the other i18n files as Weblate will be confused"
65+
exit 1
66+
4567
- uses: actions/setup-node@v3
4668
with:
4769
cache: 'yarn'

.github/workflows/tests.yml

Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -5,21 +5,17 @@ on:
55
branches: [ develop, master ]
66
repository_dispatch:
77
types: [ upstream-sdk-notify ]
8+
env:
9+
# These must be set for fetchdep.sh to get the right branch
10+
REPOSITORY: ${{ github.repository }}
11+
PR_NUMBER: ${{ github.event.pull_request.number }}
812
jobs:
913
jest:
10-
name: Jest with Codecov
14+
name: Jest
1115
runs-on: ubuntu-latest
12-
env:
13-
# This must be set for fetchdep.sh to get the right branch
14-
PR_NUMBER: ${{github.event.number}}
1516
steps:
1617
- name: Checkout code
1718
uses: actions/checkout@v2
18-
with:
19-
# If this is a pull request, make sure we check out its head rather than the
20-
# automatically generated merge commit, so that the coverage diff excludes
21-
# unrelated changes in the base branch
22-
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || '' }}
2319

2420
- name: Yarn cache
2521
uses: actions/setup-node@v3
@@ -30,11 +26,12 @@ jobs:
3026
run: "./scripts/ci/install-deps.sh --ignore-scripts"
3127

3228
- name: Run tests with coverage
33-
run: "yarn coverage"
29+
run: "yarn coverage --ci"
3430

35-
- name: Upload coverage
36-
uses: codecov/codecov-action@v2
31+
- name: Upload Artifact
32+
uses: actions/upload-artifact@v2
3733
with:
38-
fail_ci_if_error: false
39-
verbose: true
40-
override_commit: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || '' }}
34+
name: coverage
35+
path: |
36+
coverage
37+
!coverage/lcov-report

0 commit comments

Comments
 (0)