2022-02-02 23:49:37 +08:00
|
|
|
name: gradio-ui
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
2022-03-23 23:19:12 +08:00
|
|
|
branches:
|
|
|
|
- "main"
|
2022-02-02 23:49:37 +08:00
|
|
|
pull_request:
|
|
|
|
|
|
|
|
defaults:
|
|
|
|
run:
|
2022-03-23 23:19:12 +08:00
|
|
|
working-directory: ui
|
|
|
|
|
|
|
|
env:
|
|
|
|
CI: true
|
|
|
|
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: "1"
|
2022-04-19 03:26:30 +08:00
|
|
|
NODE_OPTIONS: "--max-old-space-size=4096"
|
2022-02-02 23:49:37 +08:00
|
|
|
|
2022-02-23 20:29:39 +08:00
|
|
|
concurrency:
|
|
|
|
group: deploy-${{ github.ref }}-${{ github.event_name == 'push' || github.event.inputs.fire != null }}
|
|
|
|
cancel-in-progress: true
|
|
|
|
|
2022-02-02 23:49:37 +08:00
|
|
|
jobs:
|
2022-03-23 23:19:12 +08:00
|
|
|
quick-checks:
|
2022-02-02 23:49:37 +08:00
|
|
|
name: static checks
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2022-03-23 23:19:12 +08:00
|
|
|
- uses: actions/checkout@v3
|
|
|
|
- uses: pnpm/action-setup@v2.2.1
|
|
|
|
with:
|
2022-08-03 03:02:06 +08:00
|
|
|
version: 7
|
2022-03-23 23:19:12 +08:00
|
|
|
- uses: actions/setup-node@v3
|
2022-02-02 23:49:37 +08:00
|
|
|
with:
|
|
|
|
node-version: 16
|
2022-03-23 23:19:12 +08:00
|
|
|
cache: pnpm
|
|
|
|
cache-dependency-path: ui/pnpm-lock.yaml
|
2022-02-03 18:54:21 +08:00
|
|
|
- name: install dependencies
|
2022-02-02 23:49:37 +08:00
|
|
|
run: pnpm i --frozen-lockfile
|
2022-02-03 18:54:21 +08:00
|
|
|
- name: formatting check
|
2022-02-02 23:49:37 +08:00
|
|
|
run: pnpm format:check
|
2022-02-03 18:54:21 +08:00
|
|
|
- name: typecheck
|
2022-02-02 23:49:37 +08:00
|
|
|
run: pnpm ts:check
|
2022-02-14 23:24:04 +08:00
|
|
|
- name: unit tests
|
|
|
|
run: pnpm test:run
|
2022-03-23 23:19:12 +08:00
|
|
|
functional-test:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v3
|
|
|
|
- uses: pnpm/action-setup@v2.2.1
|
|
|
|
with:
|
2022-08-03 03:02:06 +08:00
|
|
|
version: 7
|
2022-03-23 23:19:12 +08:00
|
|
|
- uses: actions/setup-node@v3
|
|
|
|
with:
|
|
|
|
node-version: 16
|
|
|
|
cache: pnpm
|
|
|
|
cache-dependency-path: ui/pnpm-lock.yaml
|
2022-08-18 03:43:26 +08:00
|
|
|
- run: pip install -r ../requirements.txt
|
2022-03-23 23:19:12 +08:00
|
|
|
- run: pnpm install --frozen-lockfile
|
2022-08-03 03:02:06 +08:00
|
|
|
- run: pnpm exec playwright install chromium
|
2022-03-23 23:19:12 +08:00
|
|
|
- run: pnpm build
|
|
|
|
- run: pnpm test:browser
|
|
|
|
- name: Upload failed tests screenshots
|
|
|
|
if: failure()
|
|
|
|
uses: actions/upload-artifact@v3
|
|
|
|
with:
|
|
|
|
retention-days: 3
|
|
|
|
name: test-failure-${{ github.run_id }}
|
|
|
|
path: ui/packages/app/test-results
|