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 }} )"
|
2020-12-08 18:27:08 -05:00
|
|
|
uses: actions/checkout@v2
|
2021-01-24 02:10:16 -05:00
|
|
|
with:
|
|
|
|
persist-credentials: false
|
|
|
|
submodules: recursive
|
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
|
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: |
|
|
|
|
npm run lint
|
|
|
|
npm run prettier-check
|
|
|
|
- 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: |
|
|
|
|
npm run test -- --coverage
|
|
|
|
- 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
|