2024-08-07 03:32:52 +08:00
|
|
|
name: "functional-lite"
|
|
|
|
|
|
|
|
on:
|
|
|
|
pull_request:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- main
|
|
|
|
- 5.0-dev
|
|
|
|
|
|
|
|
concurrency:
|
|
|
|
group: "${{ github.event.pull_request.number }}-${{ github.ref_name }}-${{ github.workflow }}"
|
|
|
|
cancel-in-progress: true
|
|
|
|
|
2024-08-08 01:27:01 +08:00
|
|
|
permissions: {}
|
|
|
|
|
2024-08-07 03:32:52 +08:00
|
|
|
jobs:
|
|
|
|
changes:
|
2024-08-08 01:27:01 +08:00
|
|
|
permissions:
|
|
|
|
contents: read
|
|
|
|
pull-requests: read
|
2024-08-07 03:32:52 +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:
|
|
|
|
- uses: actions/checkout@v4
|
|
|
|
- uses: "gradio-app/gradio/.github/actions/changes@main"
|
|
|
|
id: changes
|
|
|
|
with:
|
|
|
|
filter: "functional"
|
|
|
|
token: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
test:
|
2024-08-08 01:27:01 +08:00
|
|
|
permissions:
|
|
|
|
contents: read
|
2024-08-07 03:32:52 +08:00
|
|
|
name: "functional-test-lite"
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
needs: changes
|
|
|
|
if: needs.changes.outputs.should_run == 'true'
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: install dependencies
|
|
|
|
id: install_deps
|
|
|
|
uses: "gradio-app/gradio/.github/actions/install-all-deps@main"
|
|
|
|
with:
|
|
|
|
build_lite: true
|
|
|
|
skip_build: true
|
|
|
|
- run: pnpm exec playwright install chromium firefox
|
|
|
|
- name: Run Lite E2E tests
|
|
|
|
run: |
|
|
|
|
. venv/bin/activate
|
2024-08-14 22:17:36 +08:00
|
|
|
pnpm --filter @gradio/lite test:browser
|
2024-08-07 03:32:52 +08:00
|
|
|
- name: Get the performance result
|
|
|
|
run: |
|
|
|
|
export LITE_APP_LOAD_TIME=$(jq -r '.app_load_time' .lite-perf.json)
|
|
|
|
echo "LITE_APP_LOAD_TIME=$LITE_APP_LOAD_TIME" >> $GITHUB_ENV
|
|
|
|
cat .lite-perf.json # For debugging
|