2020-04-14 16:38:09 -04:00
|
|
|
name: Frontend
|
|
|
|
|
2021-01-07 03:47:00 -05:00
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches-ignore:
|
|
|
|
- "dependabot/**/docs/**"
|
|
|
|
- "dependabot/**/cypress-base/**"
|
|
|
|
pull_request:
|
2021-01-21 19:10:17 -05:00
|
|
|
types: [synchronize, opened, reopened, ready_for_review]
|
2020-04-14 16:38:09 -04:00
|
|
|
|
|
|
|
jobs:
|
2021-02-03 19:40:38 -05:00
|
|
|
frontend-build:
|
2021-01-21 19:10:17 -05:00
|
|
|
if: github.event.pull_request.draft == false
|
2021-01-15 19:14:33 -05:00
|
|
|
runs-on: ubuntu-20.04
|
2020-04-14 16:38:09 -04:00
|
|
|
steps:
|
2021-01-24 02:10:16 -05:00
|
|
|
- name: "Checkout ${{ github.ref }} ( ${{ github.sha }} )"
|
2023-04-14 11:23:00 -04:00
|
|
|
uses: actions/checkout@v3
|
2021-01-24 02:10:16 -05:00
|
|
|
with:
|
|
|
|
persist-credentials: false
|
|
|
|
submodules: recursive
|
2021-09-30 04:43:38 -04:00
|
|
|
- name: Check npm lock file version
|
|
|
|
run: ./scripts/ci_check_npm_lock_version.sh ./superset-frontend/package-lock.json
|
2021-02-05 10:40:08 -05:00
|
|
|
- name: Check if frontend changes are present
|
|
|
|
id: check
|
|
|
|
env:
|
|
|
|
GITHUB_REPO: ${{ github.repository }}
|
|
|
|
PR_NUMBER: ${{ github.event.pull_request.number }}
|
|
|
|
continue-on-error: true
|
|
|
|
run: ./scripts/ci_check_no_file_changes.sh frontend
|
2021-09-25 01:26:35 -04:00
|
|
|
- name: Setup Node.js
|
2021-10-08 02:13:01 -04:00
|
|
|
if: steps.check.outcome == 'failure'
|
2023-05-02 01:59:00 -04:00
|
|
|
uses: actions/setup-node@v3
|
2021-09-25 01:26:35 -04:00
|
|
|
with:
|
2021-10-20 20:53:52 -04:00
|
|
|
node-version: "16"
|
2020-12-08 18:27:08 -05:00
|
|
|
- name: Install dependencies
|
2021-02-05 10:40:08 -05:00
|
|
|
if: steps.check.outcome == 'failure'
|
2021-01-04 07:16:07 -05:00
|
|
|
uses: ./.github/actions/cached-dependencies
|
2020-12-08 18:27:08 -05:00
|
|
|
with:
|
|
|
|
run: npm-install
|
|
|
|
- name: lint
|
2021-02-05 10:40:08 -05:00
|
|
|
if: steps.check.outcome == 'failure'
|
2020-12-08 18:27:08 -05:00
|
|
|
working-directory: ./superset-frontend
|
|
|
|
run: |
|
2023-06-16 14:00:46 -04:00
|
|
|
npm run lint -- --quiet
|
2020-12-08 18:27:08 -05:00
|
|
|
npm run prettier-check
|
2021-11-29 19:29:57 -05:00
|
|
|
- name: Build plugins packages
|
|
|
|
if: steps.check.outcome == 'failure'
|
|
|
|
working-directory: ./superset-frontend
|
|
|
|
run: npm run plugins:build
|
|
|
|
- name: Build plugins Storybook
|
|
|
|
if: steps.check.outcome == 'failure'
|
|
|
|
working-directory: ./superset-frontend
|
|
|
|
run: npm run plugins:build-storybook
|
2022-07-20 07:56:03 -04:00
|
|
|
- name: superset-ui/core coverage
|
|
|
|
if: steps.check.outcome == 'failure'
|
|
|
|
working-directory: ./superset-frontend
|
|
|
|
run: |
|
|
|
|
npm run core:cover
|
2020-12-08 18:27:08 -05:00
|
|
|
- name: unit tests
|
2021-02-05 10:40:08 -05:00
|
|
|
if: steps.check.outcome == 'failure'
|
2020-12-08 18:27:08 -05:00
|
|
|
working-directory: ./superset-frontend
|
|
|
|
run: |
|
2023-06-16 14:00:46 -04:00
|
|
|
npm run test -- --coverage --silent
|
2021-11-29 19:29:57 -05:00
|
|
|
# todo: remove this step when fix generator as a project in root jest.config.js
|
|
|
|
- name: generator-superset unit tests
|
|
|
|
if: steps.check.outcome == 'failure'
|
|
|
|
working-directory: ./superset-frontend/packages/generator-superset
|
|
|
|
run: npx jest
|
2020-12-08 18:27:08 -05:00
|
|
|
- name: Upload code coverage
|
2021-02-05 10:40:08 -05:00
|
|
|
if: steps.check.outcome == 'failure'
|
2020-12-08 18:27:08 -05:00
|
|
|
working-directory: ./superset-frontend
|
2021-04-16 12:26:50 -04:00
|
|
|
run: ../.github/workflows/codecov.sh -c -F javascript
|