2020-04-14 16:38:09 -04:00
name : E2E
2021-01-07 03:47:00 -05:00
on :
push :
2024-01-23 23:30:53 -05:00
branches :
2024-03-06 12:23:07 -05:00
- "master"
2024-06-17 16:42:58 -04:00
- "[0-9].[0-9]*"
2021-01-07 03:47:00 -05:00
pull_request :
2021-01-21 19:10:17 -05:00
types : [ synchronize, opened, reopened, ready_for_review]
2024-06-05 14:10:40 -04:00
workflow_dispatch :
inputs :
use_dashboard :
2024-06-20 19:47:24 -04:00
description : 'Use Cypress Dashboard (true/false) [paid service - trigger manually when needed]. You MUST provide a branch and/or PR number below for this to work.'
2024-06-05 14:10:40 -04:00
required : false
default : 'false'
ref :
description : 'The branch or tag to checkout'
required : false
default : ''
pr_id :
description : 'The pull request ID to checkout'
required : false
default : ''
2020-04-14 16:38:09 -04:00
2024-01-31 02:03:25 -05:00
concurrency :
group : ${{ github.workflow }}-${{ github.event.pull_request.number || github.run_id }}
cancel-in-progress : true
2020-04-14 16:38:09 -04:00
jobs :
2021-01-15 15:18:18 -05:00
cypress-matrix :
2021-01-15 19:14:33 -05:00
runs-on : ubuntu-20.04
2023-04-14 11:23:00 -04:00
permissions :
contents : read
pull-requests : read
2020-04-14 16:38:09 -04:00
strategy :
2021-01-15 15:18:18 -05:00
# when one test fails, DO NOT cancel the other
2024-06-05 14:10:40 -04:00
# parallel_id, because this will kill Cypress processes
2021-01-15 15:18:18 -05:00
# leaving the Dashboard hanging ...
# https://github.com/cypress-io/github-action/issues/48
fail-fast : false
2020-04-14 16:38:09 -04:00
matrix :
2024-06-05 14:10:40 -04:00
parallel_id : [ 0 , 1 , 2 , 3 , 4 , 5 ]
2020-12-08 18:27:08 -05:00
browser : [ "chrome" ]
2020-04-14 16:38:09 -04:00
env :
2023-06-29 15:04:32 -04:00
SUPERSET_ENV : development
2021-07-01 11:03:07 -04:00
SUPERSET_CONFIG : tests.integration_tests.superset_test_config
2020-08-27 12:38:12 -04:00
SUPERSET__SQLALCHEMY_DATABASE_URI : postgresql+psycopg2://superset:superset@127.0.0.1:15432/superset
2020-04-14 16:38:09 -04:00
PYTHONPATH : ${{ github.workspace }}
REDIS_PORT : 16379
2023-04-14 11:23:00 -04:00
GITHUB_TOKEN : ${{ github.token }}
2024-06-26 11:34:30 -04:00
USE_DASHBOARD : ${{ github.event.inputs.use_dashboard || (github.ref == 'refs/heads/master' && 'true') || 'false' }}
2020-04-14 16:38:09 -04:00
services :
postgres :
2023-07-24 13:09:41 -04:00
image : postgres:15-alpine
2020-04-14 16:38:09 -04:00
env :
POSTGRES_USER : superset
POSTGRES_PASSWORD : superset
ports :
- 15432 : 5432
redis :
2023-01-16 10:45:32 -05:00
image : redis:7-alpine
2020-04-14 16:38:09 -04:00
ports :
- 16379 : 6379
steps :
2024-06-05 14:10:40 -04:00
# -------------------------------------------------------
# Conditional checkout based on context
- name : Checkout for push or pull_request event
if : github.event_name == 'push' || github.event_name == 'pull_request'
uses : actions/checkout@v2
2021-01-24 02:10:16 -05:00
with :
persist-credentials : false
submodules : recursive
2024-06-05 14:10:40 -04:00
- name : Checkout using ref (workflow_dispatch)
if : github.event_name == 'workflow_dispatch' && github.event.inputs.ref != ''
uses : actions/checkout@v2
2020-12-16 13:45:21 -05:00
with :
2021-01-24 02:10:16 -05:00
persist-credentials : false
2024-06-05 14:10:40 -04:00
ref : ${{ github.event.inputs.ref }}
2021-01-24 02:10:16 -05:00
submodules : recursive
2024-06-05 14:10:40 -04:00
- name : Checkout using PR ID (workflow_dispatch)
if : github.event_name == 'workflow_dispatch' && github.event.inputs.pr_id != ''
uses : actions/checkout@v2
with :
persist-credentials : false
ref : refs/pull/${{ github.event.inputs.pr_id }}/merge
submodules : recursive
# -------------------------------------------------------
2024-04-08 19:20:25 -04:00
- name : Check for file changes
2021-02-09 06:58:50 -05:00
id : check
2024-04-08 19:20:25 -04:00
uses : ./.github/actions/change-detector/
with :
token : ${{ secrets.GITHUB_TOKEN }}
2024-03-18 21:39:41 -04:00
- name : Setup Python
uses : ./.github/actions/setup-backend/
2024-04-08 19:20:25 -04:00
if : steps.check.outputs.python || steps.check.outputs.frontend
2020-12-08 18:27:08 -05:00
- name : Setup postgres
2024-04-08 19:20:25 -04:00
if : steps.check.outputs.python || steps.check.outputs.frontend
2021-01-04 07:16:07 -05:00
uses : ./.github/actions/cached-dependencies
2020-12-08 18:27:08 -05:00
with :
2021-09-25 01:26:35 -04:00
run : setup-postgres
2020-12-08 18:27:08 -05:00
- name : Import test data
2024-04-08 19:20:25 -04:00
if : steps.check.outputs.python || steps.check.outputs.frontend
2021-01-04 07:16:07 -05:00
uses : ./.github/actions/cached-dependencies
2020-12-08 18:27:08 -05:00
with :
2021-09-25 01:26:35 -04:00
run : testdata
- name : Setup Node.js
2024-04-08 19:20:25 -04:00
if : steps.check.outputs.python || steps.check.outputs.frontend
2024-02-01 10:06:48 -05:00
uses : actions/setup-node@v4
2021-09-25 01:26:35 -04:00
with :
2024-04-09 17:44:33 -04:00
node-version : "18"
2020-12-08 18:27:08 -05:00
- name : Install npm dependencies
2024-04-08 19:20:25 -04:00
if : steps.check.outputs.python || steps.check.outputs.frontend
2021-01-04 07:16:07 -05:00
uses : ./.github/actions/cached-dependencies
2020-12-08 18:27:08 -05:00
with :
2021-09-25 01:26:35 -04:00
run : npm-install
2020-12-08 18:27:08 -05:00
- name : Build javascript packages
2024-04-08 19:20:25 -04:00
if : steps.check.outputs.python || steps.check.outputs.frontend
2021-01-04 07:16:07 -05:00
uses : ./.github/actions/cached-dependencies
2020-12-08 18:27:08 -05:00
with :
2021-09-25 01:26:35 -04:00
run : build-instrumented-assets
2020-12-08 18:27:08 -05:00
- name : Install cypress
2024-04-08 19:20:25 -04:00
if : steps.check.outputs.python || steps.check.outputs.frontend
2021-01-04 07:16:07 -05:00
uses : ./.github/actions/cached-dependencies
2020-12-08 18:27:08 -05:00
with :
2021-09-25 01:26:35 -04:00
run : cypress-install
2020-12-08 18:27:08 -05:00
- name : Run Cypress
2024-04-08 19:20:25 -04:00
if : steps.check.outputs.python || steps.check.outputs.frontend
2021-01-04 07:16:07 -05:00
uses : ./.github/actions/cached-dependencies
2020-12-08 18:27:08 -05:00
env :
CYPRESS_BROWSER : ${{ matrix.browser }}
2024-06-05 14:10:40 -04:00
PARALLEL_ID : ${{ matrix.parallel_id }}
PARALLELISM : 6
2024-06-24 12:07:04 -04:00
CYPRESS_RECORD_KEY : ${{ secrets.CYPRESS_RECORD_KEY }}
2020-12-08 18:27:08 -05:00
with :
2024-06-05 14:10:40 -04:00
run : cypress-run-all ${{ env.USE_DASHBOARD }}
2020-12-08 18:27:08 -05:00
- name : Upload Artifacts
2024-01-31 17:22:01 -05:00
uses : actions/upload-artifact@v4
2024-06-05 14:10:40 -04:00
if : github.event_name == 'workflow_dispatch' && (steps.check.outputs.python || steps.check.outputs.frontend)
2020-12-08 18:27:08 -05:00
with :
path : ${{ github.workspace }}/superset-frontend/cypress-base/cypress/screenshots
2024-06-24 12:07:04 -04:00
name : cypress-artifact-${{ github.run_id }}-${{ github.job }}