mirror of https://github.com/vector-im/riot-web
Include cypress tests in previewbuild bundle (#10705)
parent
dde0a41ba8
commit
d791649ad3
|
@ -113,39 +113,18 @@ jobs:
|
||||||
with:
|
with:
|
||||||
run_id: ${{ github.event.workflow_run.id }}
|
run_id: ${{ github.event.workflow_run.id }}
|
||||||
name: previewbuild
|
name: previewbuild
|
||||||
path: webapp
|
|
||||||
|
|
||||||
# The workflow_run.head_sha is the sha of the head commit but the element-web was built using a simulated
|
|
||||||
# merge commit - https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#pull_request
|
|
||||||
# so use the sha from the tarball for the checkout of the cypress tests
|
|
||||||
# to make sure we get a matching set of code and tests.
|
|
||||||
- name: Grab sha from webapp
|
|
||||||
id: sha
|
|
||||||
run: |
|
|
||||||
echo "sha=$(cat webapp/sha)" >> $GITHUB_OUTPUT
|
|
||||||
|
|
||||||
- uses: actions/checkout@v3
|
|
||||||
with:
|
|
||||||
# XXX: We're checking out untrusted code in a secure context
|
|
||||||
# We need to be careful to not trust anything this code outputs/may do
|
|
||||||
# We need to check this out to access the cypress tests which are on the head branch
|
|
||||||
repository: ${{ github.event.workflow_run.head_repository.full_name }}
|
|
||||||
ref: ${{ steps.sha.outputs.sha }}
|
|
||||||
persist-credentials: false
|
|
||||||
path: matrix-react-sdk
|
|
||||||
|
|
||||||
# This is necessary as Cypress relies on eval for passing functions between processes
|
# This is necessary as Cypress relies on eval for passing functions between processes
|
||||||
- name: Allow CSP script-src unsafe-eval
|
- name: Allow CSP script-src unsafe-eval
|
||||||
run: sed -i "s/script-src /script-src 'unsafe-eval' /" ../webapp/index.html
|
run: sed -i "s/script-src /script-src 'unsafe-eval' /" webapp/index.html
|
||||||
|
|
||||||
- name: Run Cypress tests
|
- name: Run Cypress tests
|
||||||
uses: cypress-io/github-action@59c3b9b4a1a6e623c29806797d849845443487d1
|
uses: cypress-io/github-action@59c3b9b4a1a6e623c29806797d849845443487d1
|
||||||
with:
|
with:
|
||||||
working-directory: matrix-react-sdk
|
|
||||||
# The built-in Electron runner seems to grind to a halt trying
|
# The built-in Electron runner seems to grind to a halt trying
|
||||||
# to run the tests, so use chrome.
|
# to run the tests, so use chrome.
|
||||||
browser: "${{ env.BROWSER_PATH }}"
|
browser: "${{ env.BROWSER_PATH }}"
|
||||||
start: npx serve -p 8080 ../webapp
|
start: npx serve -p 8080 webapp
|
||||||
wait-on: "http://localhost:8080"
|
wait-on: "http://localhost:8080"
|
||||||
record: true
|
record: true
|
||||||
parallel: true
|
parallel: true
|
||||||
|
|
|
@ -51,13 +51,19 @@ jobs:
|
||||||
run: |
|
run: |
|
||||||
yarn build
|
yarn build
|
||||||
echo $VERSION > webapp/version
|
echo $VERSION > webapp/version
|
||||||
echo $GITHUB_SHA > webapp/sha
|
mv webapp ..
|
||||||
working-directory: ./element-web
|
working-directory: ./element-web
|
||||||
|
|
||||||
- name: Upload Artifact
|
- name: Upload Artifact
|
||||||
uses: actions/upload-artifact@v3
|
uses: actions/upload-artifact@v3
|
||||||
with:
|
with:
|
||||||
name: previewbuild
|
name: previewbuild
|
||||||
path: element-web/webapp
|
path: |
|
||||||
|
webapp
|
||||||
|
cypress
|
||||||
|
cypress.config.ts
|
||||||
|
package.json
|
||||||
|
yarn.lock
|
||||||
|
.percy.yml
|
||||||
# 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
|
||||||
|
|
Loading…
Reference in New Issue