mirror of
https://github.com/gradio-app/gradio.git
synced 2024-12-21 02:19:59 +08:00
f118587c25
* skip fe build in js tests * more fix * fix again
68 lines
1.7 KiB
YAML
68 lines
1.7 KiB
YAML
name: "js"
|
|
|
|
on:
|
|
pull_request:
|
|
push:
|
|
branches:
|
|
- main
|
|
- 5.0-dev
|
|
|
|
env:
|
|
CI: true
|
|
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: "1"
|
|
NODE_OPTIONS: "--max-old-space-size=4096"
|
|
|
|
concurrency:
|
|
group: "${{ github.event.pull_request.number }}-${{ github.ref_name }}-${{ github.workflow }}"
|
|
cancel-in-progress: true
|
|
|
|
permissions: {}
|
|
|
|
jobs:
|
|
changes:
|
|
permissions:
|
|
contents: read
|
|
pull-requests: read
|
|
name: "changes"
|
|
runs-on: ubuntu-latest
|
|
outputs:
|
|
should_run: ${{ steps.changes.outputs.should_run }}
|
|
sha: ${{ steps.changes.outputs.sha }}
|
|
pr_number: ${{ steps.changes.outputs.pr_number }}
|
|
source_branch: ${{ steps.changes.outputs.source_branch }}
|
|
source_repo: ${{ steps.changes.outputs.source_repo }}
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: "gradio-app/gradio/.github/actions/changes@main"
|
|
id: changes
|
|
with:
|
|
filter: "js"
|
|
token: ${{ secrets.GITHUB_TOKEN }}
|
|
test:
|
|
permissions:
|
|
contents: read
|
|
name: js-test
|
|
runs-on: ubuntu-22.04
|
|
needs: changes
|
|
if: needs.changes.outputs.should_run == 'true'
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- name: install dependencies
|
|
uses: "gradio-app/gradio/.github/actions/install-frontend-deps@main"
|
|
with:
|
|
skip_build: true
|
|
- name: build client
|
|
run: pnpm --filter @gradio/client build
|
|
- name: build the wasm module
|
|
run: pnpm --filter @gradio/wasm build
|
|
- name: format check
|
|
run: pnpm format:check
|
|
- name: lint
|
|
run: pnpm lint
|
|
- name: typecheck
|
|
run: pnpm ts:check
|
|
- name: unit tests
|
|
run: pnpm test:run
|
|
- name: client tests
|
|
run: pnpm --filter @gradio/client test
|