2020-04-14 16:38:09 -04:00
|
|
|
name: Frontend
|
|
|
|
|
2021-01-07 03:47:00 -05:00
|
|
|
on:
|
|
|
|
push:
|
2024-01-23 23:30:53 -05:00
|
|
|
branches:
|
|
|
|
- "master"
|
2024-03-06 12:23:07 -05:00
|
|
|
- "[0-9].[0-9]"
|
2024-01-23 23:30:53 -05:00
|
|
|
paths:
|
|
|
|
- "superset-frontend/**"
|
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-01-23 23:30:53 -05:00
|
|
|
paths:
|
|
|
|
- "superset-frontend/**"
|
2020-04-14 16:38:09 -04:00
|
|
|
|
2024-02-01 10:08:41 -05:00
|
|
|
# cancel previous workflow jobs for PRs
|
|
|
|
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-02-03 19:40:38 -05:00
|
|
|
frontend-build:
|
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 }} )"
|
2024-02-01 13:56:33 -05:00
|
|
|
uses: actions/checkout@v4
|
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'
|
2024-02-01 10:06:48 -05:00
|
|
|
uses: actions/setup-node@v4
|
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
|
2024-01-24 11:51:08 -05:00
|
|
|
- name: eslint
|
|
|
|
if: steps.check.outcome == 'failure'
|
|
|
|
working-directory: ./superset-frontend
|
|
|
|
run: |
|
|
|
|
npm run eslint -- . --quiet
|
|
|
|
- name: tsc
|
|
|
|
if: steps.check.outcome == 'failure'
|
|
|
|
working-directory: ./superset-frontend
|
|
|
|
run: |
|
|
|
|
npm run type
|
|
|
|
- name: prettier
|
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: |
|
|
|
|
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
|