GHA: make element-web and cypress workflows reusable (#10969)

* GHA: make `element-web` workflow reusable

... so that we can call it from the js-sdk repo

* GHA: make `cypress.yaml` a reusable workflow

... so that we can call it from js-sdk

* GHA: give cypress.yaml a `rust-crypto` parameter

* Update .github/workflows/cypress.yaml

Co-authored-by: Michael Telatynski <7t3chguy@gmail.com>

* remove workflow_dispatch

---------

Co-authored-by: Michael Telatynski <7t3chguy@gmail.com>
This commit is contained in:
Richard van der Hoff
2023-05-26 16:04:29 +01:00
committed by GitHub
parent 67313743fc
commit 3bba816b10
2 changed files with 56 additions and 4 deletions

View File

@@ -12,6 +12,20 @@ on:
branches: [develop, master]
repository_dispatch:
types: [upstream-sdk-notify]
# support triggering from other workflows
workflow_call:
inputs:
react-sdk-repository:
type: string
required: true
description: "The name of the github repository to check out and build."
matrix-js-sdk-sha:
type: string
required: false
description: "The Git SHA of matrix-js-sdk to build against. By default, will use a matching branch name if it exists, or develop."
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.event_name }}
cancel-in-progress: true
@@ -25,7 +39,10 @@ jobs:
name: "Build Element-Web"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Checkout code
uses: actions/checkout@v3
with:
repository: ${{ inputs.react-sdk-repository || github.repository }}
- uses: actions/setup-node@v3
with:
@@ -33,6 +50,9 @@ jobs:
- name: Fetch layered build
id: layered_build
env:
# tell layered.sh to check out the right sha of the JS-SDK, if we were given one
JS_SDK_GITHUB_BASE_REF: ${{ inputs.matrix-js-sdk-sha }}
run: |
scripts/ci/layered.sh
JSSDK_SHA=$(git -C matrix-js-sdk rev-parse --short=12 HEAD)
@@ -44,7 +64,6 @@ jobs:
run: cp element.io/develop/config.json config.json
working-directory: ./element-web
# After building we write the version file and the react-sdk sha so our cypress tests are from the same sha
- name: Build
env:
CI_PACKAGE: true
@@ -52,9 +71,13 @@ jobs:
run: |
yarn build
echo $VERSION > webapp/version
echo $GITHUB_SHA > webapp/sha
working-directory: ./element-web
# Record the react-sdk sha so our cypress tests are from the same sha
- name: Record react-sdk SHA
run: |
git rev-parse HEAD > element-web/webapp/sha
- name: Upload Artifact
uses: actions/upload-artifact@v3
with: