Move more stuff from BK to GHA (#8372)
This commit is contained in:
parent
dd880df6ae
commit
146bcdd6a6
9 changed files with 336 additions and 210 deletions
|
@ -21,3 +21,6 @@ insert_final_newline = true
|
||||||
indent_style = space
|
indent_style = space
|
||||||
indent_size = 4
|
indent_size = 4
|
||||||
trim_trailing_whitespace = true
|
trim_trailing_whitespace = true
|
||||||
|
|
||||||
|
[*.{yml,yaml}]
|
||||||
|
indent_size = 2
|
||||||
|
|
44
.github/workflows/element-build-and-test.yaml
vendored
44
.github/workflows/element-build-and-test.yaml
vendored
|
@ -3,17 +3,36 @@
|
||||||
# as an artifact and run integration tests.
|
# as an artifact and run integration tests.
|
||||||
name: Element Web - Build and Test
|
name: Element Web - Build and Test
|
||||||
on:
|
on:
|
||||||
pull_request:
|
pull_request: { }
|
||||||
|
push:
|
||||||
|
branches: [ develop, master ]
|
||||||
|
repository_dispatch:
|
||||||
|
types: [ upstream-sdk-notify ]
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
|
name: "Build Element-Web"
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
env:
|
env:
|
||||||
# This must be set for fetchdep.sh to get the right branch
|
# This must be set for fetchdep.sh to get the right branch
|
||||||
PR_NUMBER: ${{github.event.number}}
|
PR_NUMBER: ${{github.event.number}}
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
|
|
||||||
|
- uses: actions/setup-node@v3
|
||||||
|
with:
|
||||||
|
cache: 'yarn'
|
||||||
|
|
||||||
|
- name: Fetch layered build
|
||||||
|
run: scripts/ci/layered.sh
|
||||||
|
|
||||||
|
- name: Copy config
|
||||||
|
run: cp element.io/develop/config.json config.json
|
||||||
|
working-directory: ./element-web
|
||||||
|
|
||||||
- name: Build
|
- name: Build
|
||||||
run: scripts/ci/layered.sh && cd element-web && cp element.io/develop/config.json config.json && CI_PACKAGE=true yarn build
|
run: CI_PACKAGE=true yarn build
|
||||||
|
working-directory: ./element-web
|
||||||
|
|
||||||
- name: Upload Artifact
|
- name: Upload Artifact
|
||||||
uses: actions/upload-artifact@v2
|
uses: actions/upload-artifact@v2
|
||||||
with:
|
with:
|
||||||
|
@ -21,16 +40,20 @@ jobs:
|
||||||
path: element-web/webapp
|
path: element-web/webapp
|
||||||
# We'll only use this in a triggered job, then we're done with it
|
# We'll only use this in a triggered job, then we're done with it
|
||||||
retention-days: 1
|
retention-days: 1
|
||||||
|
|
||||||
cypress:
|
cypress:
|
||||||
|
name: "Cypress End to End Tests"
|
||||||
needs: build
|
needs: build
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
|
|
||||||
- name: Download build
|
- name: Download build
|
||||||
uses: actions/download-artifact@v3
|
uses: actions/download-artifact@v3
|
||||||
with:
|
with:
|
||||||
name: previewbuild
|
name: previewbuild
|
||||||
path: webapp
|
path: webapp
|
||||||
|
|
||||||
- name: Run Cypress tests
|
- name: Run Cypress tests
|
||||||
uses: cypress-io/github-action@v2
|
uses: cypress-io/github-action@v2
|
||||||
with:
|
with:
|
||||||
|
@ -38,6 +61,7 @@ jobs:
|
||||||
# to run the tests, so use chrome.
|
# to run the tests, so use chrome.
|
||||||
browser: chrome
|
browser: chrome
|
||||||
start: npx serve -p 8080 webapp
|
start: npx serve -p 8080 webapp
|
||||||
|
|
||||||
- name: Upload Artifact
|
- name: Upload Artifact
|
||||||
if: failure()
|
if: failure()
|
||||||
uses: actions/upload-artifact@v2
|
uses: actions/upload-artifact@v2
|
||||||
|
@ -47,3 +71,19 @@ jobs:
|
||||||
cypress/screenshots
|
cypress/screenshots
|
||||||
cypress/videos
|
cypress/videos
|
||||||
cypress/synapselogs
|
cypress/synapselogs
|
||||||
|
|
||||||
|
app-tests:
|
||||||
|
name: Element Web Integration Tests
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
env:
|
||||||
|
# This must be set for fetchdep.sh to get the right branch
|
||||||
|
PR_NUMBER: ${{github.event.number}}
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
|
||||||
|
- uses: actions/setup-node@v3
|
||||||
|
with:
|
||||||
|
cache: 'yarn'
|
||||||
|
|
||||||
|
- name: Run tests
|
||||||
|
run: "./scripts/ci/app-tests.sh"
|
||||||
|
|
11
.github/workflows/end-to-end-tests.yaml
vendored
11
.github/workflows/end-to-end-tests.yaml
vendored
|
@ -7,6 +7,8 @@ on:
|
||||||
branches: [ develop ]
|
branches: [ develop ]
|
||||||
pull_request:
|
pull_request:
|
||||||
branches: [ develop ]
|
branches: [ develop ]
|
||||||
|
repository_dispatch:
|
||||||
|
types: [ upstream-sdk-notify ]
|
||||||
jobs:
|
jobs:
|
||||||
end-to-end:
|
end-to-end:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
@ -17,10 +19,17 @@ jobs:
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v2
|
||||||
|
|
||||||
|
- uses: actions/setup-node@v3
|
||||||
|
with:
|
||||||
|
cache: 'yarn'
|
||||||
|
|
||||||
- name: Prepare End-to-End tests
|
- name: Prepare End-to-End tests
|
||||||
run: ./scripts/ci/prepare-end-to-end-tests.sh
|
run: ./scripts/ci/prepare-end-to-end-tests.sh
|
||||||
|
|
||||||
- name: Run End-to-End tests
|
- name: Run End-to-End tests
|
||||||
run: ./scripts/ci/run-end-to-end-tests.sh
|
run: ./scripts/ci/run-end-to-end-tests.sh
|
||||||
|
|
||||||
- name: Archive logs
|
- name: Archive logs
|
||||||
uses: actions/upload-artifact@v2
|
uses: actions/upload-artifact@v2
|
||||||
if: ${{ always() }}
|
if: ${{ always() }}
|
||||||
|
@ -29,11 +38,13 @@ jobs:
|
||||||
test/end-to-end-tests/logs/**/*
|
test/end-to-end-tests/logs/**/*
|
||||||
test/end-to-end-tests/synapse/installations/consent/homeserver.log
|
test/end-to-end-tests/synapse/installations/consent/homeserver.log
|
||||||
retention-days: 14
|
retention-days: 14
|
||||||
|
|
||||||
- name: Download previous benchmark data
|
- name: Download previous benchmark data
|
||||||
uses: actions/cache@v1
|
uses: actions/cache@v1
|
||||||
with:
|
with:
|
||||||
path: ./cache
|
path: ./cache
|
||||||
key: ${{ runner.os }}-benchmark
|
key: ${{ runner.os }}-benchmark
|
||||||
|
|
||||||
- name: Store benchmark result
|
- name: Store benchmark result
|
||||||
uses: matrix-org/github-action-benchmark@jsperfentry-1
|
uses: matrix-org/github-action-benchmark@jsperfentry-1
|
||||||
with:
|
with:
|
||||||
|
|
5
.github/workflows/netlify.yaml
vendored
5
.github/workflows/netlify.yaml
vendored
|
@ -26,6 +26,7 @@ jobs:
|
||||||
jq -r '.[] | .number')
|
jq -r '.[] | .number')
|
||||||
echo "PR number: $pr_number"
|
echo "PR number: $pr_number"
|
||||||
echo "::set-output name=prnumber::$pr_number"
|
echo "::set-output name=prnumber::$pr_number"
|
||||||
|
|
||||||
# There's a 'download artifact' action but it hasn't been updated for the
|
# There's a 'download artifact' action but it hasn't been updated for the
|
||||||
# workflow_run action (https://github.com/actions/download-artifact/issues/60)
|
# workflow_run action (https://github.com/actions/download-artifact/issues/60)
|
||||||
# so instead we get this mess:
|
# so instead we get this mess:
|
||||||
|
@ -49,8 +50,10 @@ jobs:
|
||||||
});
|
});
|
||||||
var fs = require('fs');
|
var fs = require('fs');
|
||||||
fs.writeFileSync('${{github.workspace}}/previewbuild.zip', Buffer.from(download.data));
|
fs.writeFileSync('${{github.workspace}}/previewbuild.zip', Buffer.from(download.data));
|
||||||
|
|
||||||
- name: Extract Artifacts
|
- name: Extract Artifacts
|
||||||
run: unzip -d webapp previewbuild.zip && rm previewbuild.zip
|
run: unzip -d webapp previewbuild.zip && rm previewbuild.zip
|
||||||
|
|
||||||
- name: Deploy to Netlify
|
- name: Deploy to Netlify
|
||||||
id: netlify
|
id: netlify
|
||||||
uses: nwtgck/actions-netlify@v1.2
|
uses: nwtgck/actions-netlify@v1.2
|
||||||
|
@ -65,6 +68,7 @@ jobs:
|
||||||
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
|
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
|
||||||
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}
|
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}
|
||||||
timeout-minutes: 1
|
timeout-minutes: 1
|
||||||
|
|
||||||
- name: Edit PR Description
|
- name: Edit PR Description
|
||||||
uses: Beakyn/gha-comment-pull-request@2167a7aee24f9e61ce76a23039f322e49a990409
|
uses: Beakyn/gha-comment-pull-request@2167a7aee24f9e61ce76a23039f322e49a990409
|
||||||
env:
|
env:
|
||||||
|
@ -74,4 +78,3 @@ jobs:
|
||||||
description-message: |
|
description-message: |
|
||||||
Preview: ${{ steps.netlify.outputs.deploy-url }}
|
Preview: ${{ steps.netlify.outputs.deploy-url }}
|
||||||
⚠️ Do you trust the author of this PR? Maybe this build will steal your keys or give you malware. Exercise caution. Use test accounts.
|
⚠️ Do you trust the author of this PR? Maybe this build will steal your keys or give you malware. Exercise caution. Use test accounts.
|
||||||
|
|
||||||
|
|
5
.github/workflows/notify-element-web.yml
vendored
5
.github/workflows/notify-element-web.yml
vendored
|
@ -2,14 +2,17 @@ name: Notify element-web
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches: [ develop ]
|
branches: [ develop ]
|
||||||
|
repository_dispatch:
|
||||||
|
types: [ upstream-sdk-notify ]
|
||||||
jobs:
|
jobs:
|
||||||
notify-element-web:
|
notify-element-web:
|
||||||
|
name: "Notify Element Web"
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
environment: develop
|
environment: develop
|
||||||
steps:
|
steps:
|
||||||
- name: Notify element-web repo that a new SDK build is on develop
|
- name: Notify element-web repo that a new SDK build is on develop
|
||||||
uses: peter-evans/repository-dispatch@v1
|
uses: peter-evans/repository-dispatch@v1
|
||||||
with:
|
with:
|
||||||
token: ${{ secrets.ELEMENT_WEB_NOTIFY_TOKEN }}
|
token: ${{ secrets.ELEMENT_BOT_TOKEN }}
|
||||||
repository: vector-im/element-web
|
repository: vector-im/element-web
|
||||||
event-type: element-web-notify
|
event-type: element-web-notify
|
||||||
|
|
88
.github/workflows/static_analysis.yaml
vendored
Normal file
88
.github/workflows/static_analysis.yaml
vendored
Normal file
|
@ -0,0 +1,88 @@
|
||||||
|
name: Static Analysis
|
||||||
|
on:
|
||||||
|
pull_request: { }
|
||||||
|
push:
|
||||||
|
branches: [ develop, master ]
|
||||||
|
repository_dispatch:
|
||||||
|
types: [ upstream-sdk-notify ]
|
||||||
|
jobs:
|
||||||
|
ts_lint:
|
||||||
|
name: "Typescript Syntax Check"
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
env:
|
||||||
|
# This must be set for fetchdep.sh to get the right branch
|
||||||
|
PR_NUMBER: ${{github.event.number}}
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
|
||||||
|
- uses: actions/setup-node@v3
|
||||||
|
with:
|
||||||
|
cache: 'yarn'
|
||||||
|
|
||||||
|
- name: Install Deps
|
||||||
|
run: "./scripts/ci/install-deps.sh --ignore-scripts"
|
||||||
|
|
||||||
|
- name: Typecheck
|
||||||
|
run: "yarn run lint:types"
|
||||||
|
|
||||||
|
- name: Switch js-sdk to release mode
|
||||||
|
run: |
|
||||||
|
scripts/ci/js-sdk-to-release.js
|
||||||
|
cd node_modules/matrix-js-sdk
|
||||||
|
yarn install
|
||||||
|
yarn run build:compile
|
||||||
|
yarn run build:types
|
||||||
|
|
||||||
|
- name: Typecheck (release mode)
|
||||||
|
run: "yarn run lint:types"
|
||||||
|
|
||||||
|
i18n_lint:
|
||||||
|
name: "i18n Diff Check"
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
|
||||||
|
- uses: actions/setup-node@v3
|
||||||
|
with:
|
||||||
|
cache: 'yarn'
|
||||||
|
|
||||||
|
# Does not need branch matching as only analyses this layer
|
||||||
|
- name: Install Deps
|
||||||
|
run: "yarn install"
|
||||||
|
|
||||||
|
- name: i18n Check
|
||||||
|
run: "yarn run diff-i18n"
|
||||||
|
|
||||||
|
js_lint:
|
||||||
|
name: "ESLint"
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
|
||||||
|
- uses: actions/setup-node@v3
|
||||||
|
with:
|
||||||
|
cache: 'yarn'
|
||||||
|
|
||||||
|
# Does not need branch matching as only analyses this layer
|
||||||
|
- name: Install Deps
|
||||||
|
run: "yarn install"
|
||||||
|
|
||||||
|
- name: Run Linter
|
||||||
|
run: "yarn run lint:js"
|
||||||
|
|
||||||
|
style_lint:
|
||||||
|
name: "Style Lint"
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
|
||||||
|
- uses: actions/setup-node@v3
|
||||||
|
with:
|
||||||
|
cache: 'yarn'
|
||||||
|
|
||||||
|
# Does not need branch matching as only analyses this layer
|
||||||
|
- name: Install Deps
|
||||||
|
run: "yarn install"
|
||||||
|
|
||||||
|
- name: Run Linter
|
||||||
|
run: "yarn run lint:style"
|
|
@ -1,10 +1,13 @@
|
||||||
name: Test coverage
|
name: Tests
|
||||||
on:
|
on:
|
||||||
pull_request: { }
|
pull_request: { }
|
||||||
push:
|
push:
|
||||||
branches: [develop, main, master]
|
branches: [ develop, master ]
|
||||||
|
repository_dispatch:
|
||||||
|
types: [ upstream-sdk-notify ]
|
||||||
jobs:
|
jobs:
|
||||||
test-coverage:
|
jest:
|
||||||
|
name: Jest with Codecov
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
env:
|
env:
|
||||||
# This must be set for fetchdep.sh to get the right branch
|
# This must be set for fetchdep.sh to get the right branch
|
||||||
|
@ -19,13 +22,15 @@ jobs:
|
||||||
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || '' }}
|
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || '' }}
|
||||||
|
|
||||||
- name: Yarn cache
|
- name: Yarn cache
|
||||||
uses: c-hive/gha-yarn-cache@v2
|
uses: actions/setup-node@v3
|
||||||
|
with:
|
||||||
|
cache: 'yarn'
|
||||||
|
|
||||||
- name: Install Deps
|
- name: Install Deps
|
||||||
run: "./scripts/ci/install-deps.sh --ignore-scripts"
|
run: "./scripts/ci/install-deps.sh --ignore-scripts"
|
||||||
|
|
||||||
- name: Run tests with coverage
|
- name: Run tests with coverage
|
||||||
run: "yarn install && yarn coverage"
|
run: "yarn coverage"
|
||||||
|
|
||||||
- name: Upload coverage
|
- name: Upload coverage
|
||||||
uses: codecov/codecov-action@v2
|
uses: codecov/codecov-action@v2
|
27
.github/workflows/typecheck.yaml
vendored
27
.github/workflows/typecheck.yaml
vendored
|
@ -1,27 +0,0 @@
|
||||||
name: Type Check
|
|
||||||
on:
|
|
||||||
pull_request:
|
|
||||||
branches: [develop]
|
|
||||||
jobs:
|
|
||||||
build:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
env:
|
|
||||||
# This must be set for fetchdep.sh to get the right branch
|
|
||||||
PR_NUMBER: ${{github.event.number}}
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v2
|
|
||||||
- uses: c-hive/gha-yarn-cache@v2
|
|
||||||
- name: Install Deps
|
|
||||||
run: "./scripts/ci/install-deps.sh --ignore-scripts"
|
|
||||||
- name: Typecheck
|
|
||||||
run: "yarn run lint:types"
|
|
||||||
- name: Switch js-sdk to release mode
|
|
||||||
run: |
|
|
||||||
scripts/ci/js-sdk-to-release.js
|
|
||||||
cd node_modules/matrix-js-sdk
|
|
||||||
yarn install
|
|
||||||
yarn run build:compile
|
|
||||||
yarn run build:types
|
|
||||||
- name: Typecheck (release mode)
|
|
||||||
run: "yarn run lint:types"
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue