2024-08-05 22:27:26 +08:00
|
|
|
name: "js"
|
2024-02-01 08:46:55 +08:00
|
|
|
|
|
|
|
on:
|
2024-08-05 22:27:26 +08:00
|
|
|
pull_request:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- main
|
|
|
|
- 5.0-dev
|
2024-02-01 08:46:55 +08:00
|
|
|
|
|
|
|
env:
|
|
|
|
CI: true
|
|
|
|
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: "1"
|
|
|
|
NODE_OPTIONS: "--max-old-space-size=4096"
|
|
|
|
|
|
|
|
concurrency:
|
2024-08-05 22:27:26 +08:00
|
|
|
group: "${{ github.event.pull_request.number }}-${{ github.ref_name }}-${{ github.workflow }}"
|
2024-02-01 08:46:55 +08:00
|
|
|
cancel-in-progress: true
|
|
|
|
|
2024-08-08 01:27:01 +08:00
|
|
|
permissions: {}
|
|
|
|
|
2024-02-01 08:46:55 +08:00
|
|
|
jobs:
|
|
|
|
changes:
|
2024-08-08 01:27:01 +08:00
|
|
|
permissions:
|
|
|
|
contents: read
|
|
|
|
pull-requests: read
|
2024-02-01 08:46:55 +08:00
|
|
|
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:
|
2024-02-02 02:14:41 +08:00
|
|
|
- uses: actions/checkout@v4
|
2024-02-01 18:34:22 +08:00
|
|
|
- uses: "gradio-app/gradio/.github/actions/changes@main"
|
2024-02-01 08:46:55 +08:00
|
|
|
id: changes
|
|
|
|
with:
|
2024-08-05 22:27:26 +08:00
|
|
|
filter: "js"
|
2024-02-01 08:46:55 +08:00
|
|
|
token: ${{ secrets.GITHUB_TOKEN }}
|
2024-08-05 22:27:26 +08:00
|
|
|
test:
|
2024-08-08 01:27:01 +08:00
|
|
|
permissions:
|
|
|
|
contents: read
|
2024-08-06 18:54:11 +08:00
|
|
|
name: js-test
|
2024-08-05 22:27:26 +08:00
|
|
|
runs-on: ubuntu-22.04
|
2024-02-01 08:46:55 +08:00
|
|
|
needs: changes
|
|
|
|
if: needs.changes.outputs.should_run == 'true'
|
|
|
|
steps:
|
2024-02-02 02:14:41 +08:00
|
|
|
- uses: actions/checkout@v4
|
2024-02-01 08:46:55 +08:00
|
|
|
- name: install dependencies
|
2024-02-01 18:34:22 +08:00
|
|
|
uses: "gradio-app/gradio/.github/actions/install-frontend-deps@main"
|
2024-02-01 08:46:55 +08:00
|
|
|
- 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
|
2024-05-09 19:06:28 +08:00
|
|
|
- name: client tests
|
|
|
|
run: pnpm --filter @gradio/client test
|