2020-04-14 16:38:09 -04:00
|
|
|
name: E2E
|
|
|
|
|
2020-12-16 14:38:55 -05:00
|
|
|
on: [push, pull_request_target]
|
2020-04-14 16:38:09 -04:00
|
|
|
|
|
|
|
jobs:
|
2020-12-16 13:45:21 -05:00
|
|
|
cypress-matrix:
|
2020-04-14 16:38:09 -04:00
|
|
|
runs-on: ubuntu-18.04
|
|
|
|
strategy:
|
2020-12-16 13:45:21 -05:00
|
|
|
# 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
|
2020-04-14 16:38:09 -04:00
|
|
|
matrix:
|
2020-12-16 13:45:21 -05:00
|
|
|
containers: [1, 2, 3]
|
2020-12-08 18:27:08 -05:00
|
|
|
browser: ["chrome"]
|
2020-04-14 16:38:09 -04:00
|
|
|
env:
|
|
|
|
FLASK_ENV: development
|
2020-08-27 12:38:12 -04:00
|
|
|
ENABLE_REACT_CRUD_VIEWS: true
|
2020-04-14 16:38:09 -04:00
|
|
|
SUPERSET_CONFIG: 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
|
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
services:
|
|
|
|
postgres:
|
|
|
|
image: postgres:10-alpine
|
|
|
|
env:
|
|
|
|
POSTGRES_USER: superset
|
|
|
|
POSTGRES_PASSWORD: superset
|
|
|
|
ports:
|
|
|
|
- 15432:5432
|
|
|
|
redis:
|
|
|
|
image: redis:5-alpine
|
|
|
|
ports:
|
|
|
|
- 16379:6379
|
|
|
|
steps:
|
2020-12-08 18:27:08 -05:00
|
|
|
- name: Cancel Previous Runs
|
|
|
|
uses: styfle/cancel-workflow-action@0.6.0
|
|
|
|
with:
|
|
|
|
access_token: ${{ github.token }}
|
2020-12-16 13:45:21 -05:00
|
|
|
- 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'
|
2020-12-08 18:27:08 -05:00
|
|
|
uses: actions/checkout@v2
|
2020-12-16 13:45:21 -05:00
|
|
|
with:
|
|
|
|
ref: 'refs/pull/${{ github.event.number }}/merge'
|
2020-12-08 18:27:08 -05:00
|
|
|
- name: Setup Python
|
|
|
|
uses: actions/setup-python@v2
|
|
|
|
with:
|
|
|
|
python-version: "3.7"
|
|
|
|
- name: OS dependencies
|
|
|
|
uses: apache-superset/cached-dependencies@b90713b
|
|
|
|
with:
|
|
|
|
run: |
|
|
|
|
apt-get-install
|
|
|
|
- name: Install python dependencies
|
|
|
|
uses: apache-superset/cached-dependencies@b90713b
|
|
|
|
with:
|
|
|
|
run: |
|
|
|
|
pip-upgrade
|
|
|
|
pip install -r requirements/testing.txt
|
|
|
|
- name: Setup postgres
|
|
|
|
uses: apache-superset/cached-dependencies@b90713b
|
|
|
|
with:
|
|
|
|
run: |
|
|
|
|
setup-postgres
|
|
|
|
- name: Import test data
|
|
|
|
uses: apache-superset/cached-dependencies@b90713b
|
|
|
|
with:
|
|
|
|
run: |
|
|
|
|
testdata
|
|
|
|
- name: Install npm dependencies
|
|
|
|
uses: apache-superset/cached-dependencies@b90713b
|
|
|
|
with:
|
|
|
|
run: |
|
|
|
|
npm-install
|
|
|
|
- name: Build javascript packages
|
|
|
|
uses: apache-superset/cached-dependencies@b90713b
|
|
|
|
with:
|
|
|
|
run: |
|
|
|
|
build-instrumented-assets
|
|
|
|
- name: Install cypress
|
|
|
|
uses: apache-superset/cached-dependencies@b90713b
|
|
|
|
with:
|
|
|
|
run: |
|
|
|
|
cypress-install
|
|
|
|
- name: Run Cypress
|
|
|
|
uses: apache-superset/cached-dependencies@b90713b
|
|
|
|
env:
|
|
|
|
CYPRESS_BROWSER: ${{ matrix.browser }}
|
|
|
|
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}
|
|
|
|
with:
|
|
|
|
run: cypress-run-all
|
|
|
|
- name: Upload Artifacts
|
|
|
|
uses: actions/upload-artifact@v2
|
|
|
|
if: failure()
|
|
|
|
with:
|
|
|
|
name: screenshots
|
|
|
|
path: ${{ github.workspace }}/superset-frontend/cypress-base/cypress/screenshots
|
2020-12-16 13:45:21 -05:00
|
|
|
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
|