mirror of https://github.com/apache/superset.git
build(cypress): Use pull_request_target event to run cypress (#11750)
* Use pull_request_target event to run cypress in order to access repo secrets * Summary job for branch protection requirements * Restore pull_request trigger * Use merge base for e2e tests * Restore push trigger for all branches
This commit is contained in:
parent
48fb8c0b77
commit
8fe9ee04c8
|
@ -1,13 +1,18 @@
|
|||
name: E2E
|
||||
|
||||
on: [push, pull_request]
|
||||
on: [push, pull_request, pull_request_target]
|
||||
|
||||
jobs:
|
||||
Cypress:
|
||||
cypress-matrix:
|
||||
runs-on: ubuntu-18.04
|
||||
strategy:
|
||||
fail-fast: true
|
||||
# when one test fails, DO NOT cancel the other
|
||||
# containers, because this will kill Cypress processes
|
||||
# leaving the Dashboard hanging ...
|
||||
# https://github.com/cypress-io/github-action/issues/48
|
||||
fail-fast: false
|
||||
matrix:
|
||||
containers: [1, 2, 3]
|
||||
browser: ["chrome"]
|
||||
env:
|
||||
FLASK_ENV: development
|
||||
|
@ -34,8 +39,14 @@ jobs:
|
|||
uses: styfle/cancel-workflow-action@0.6.0
|
||||
with:
|
||||
access_token: ${{ github.token }}
|
||||
- name: Checkout code
|
||||
- name: Checkout code (push)
|
||||
if: github.event_name == 'push'
|
||||
uses: actions/checkout@v2
|
||||
- name: Checkout code (pull_request)
|
||||
if: github.event_name == 'pull_request' || github.event_name == 'pull_request_target'
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
ref: 'refs/pull/${{ github.event.number }}/merge'
|
||||
- name: Setup Python
|
||||
uses: actions/setup-python@v2
|
||||
with:
|
||||
|
@ -89,3 +100,12 @@ jobs:
|
|||
with:
|
||||
name: screenshots
|
||||
path: ${{ github.workspace }}/superset-frontend/cypress-base/cypress/screenshots
|
||||
Cypress:
|
||||
if: ${{ always() }}
|
||||
name: Cypress (chrome)
|
||||
runs-on: ubuntu-18.04
|
||||
needs: cypress-matrix
|
||||
steps:
|
||||
- name: Check build matrix status
|
||||
if: ${{ needs.cypress-matrix.result != 'success' }}
|
||||
run: exit 1
|
||||
|
|
Loading…
Reference in New Issue