2024-02-01 08:46:55 +08:00
|
|
|
name: "test / functional"
|
|
|
|
|
|
|
|
on:
|
|
|
|
workflow_run:
|
|
|
|
workflows: ["trigger"]
|
2024-02-07 15:46:54 +08:00
|
|
|
types:
|
2024-02-01 08:46:55 +08:00
|
|
|
- requested
|
|
|
|
|
|
|
|
permissions:
|
|
|
|
statuses: write
|
|
|
|
|
|
|
|
concurrency:
|
2024-02-01 18:24:15 +08:00
|
|
|
group: "${{ github.event.workflow_run.head_repository.full_name }}-${{ github.event.workflow_run.head_branch }}-${{ github.workflow_ref }}"
|
2024-02-01 08:46:55 +08:00
|
|
|
cancel-in-progress: true
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
changes:
|
|
|
|
name: "changes"
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
outputs:
|
|
|
|
should_run: ${{ steps.changes.outputs.should_run }}
|
|
|
|
sha: ${{ steps.changes.outputs.sha }}
|
|
|
|
merge_sha: ${{ steps.changes.outputs.merge_sha }}
|
|
|
|
pr_number: ${{ steps.changes.outputs.pr_number }}
|
|
|
|
source_branch: ${{ steps.changes.outputs.source_branch }}
|
|
|
|
source_repo: ${{ steps.changes.outputs.source_repo }}
|
2024-02-01 21:15:15 +08:00
|
|
|
mergeable: ${{ steps.changes.outputs.mergeable }}
|
2024-02-01 08:46:55 +08:00
|
|
|
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:
|
|
|
|
type: "functional"
|
|
|
|
token: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
|
|
|
|
test-functional:
|
|
|
|
name: "test-functional"
|
|
|
|
needs: changes
|
|
|
|
if: needs.changes.outputs.should_run == 'true'
|
|
|
|
runs-on: ubuntu-latest
|
2024-02-07 15:46:54 +08:00
|
|
|
|
2024-02-01 08:46:55 +08:00
|
|
|
steps:
|
2024-02-02 02:14:41 +08:00
|
|
|
- uses: actions/checkout@v4
|
2024-02-01 08:46:55 +08:00
|
|
|
with:
|
|
|
|
ref: ${{ needs.changes.outputs.merge_sha }}
|
2024-02-01 21:15:15 +08:00
|
|
|
repository: ${{ needs.changes.outputs.mergeable == 'true' && github.repository || needs.changes.outputs.source_repo }}
|
2024-02-01 08:46:55 +08:00
|
|
|
- name: install dependencies
|
|
|
|
id: install_deps
|
2024-02-01 18:34:22 +08:00
|
|
|
uses: "gradio-app/gradio/.github/actions/install-all-deps@main"
|
2024-02-01 08:46:55 +08:00
|
|
|
with:
|
|
|
|
always_install_pnpm: true
|
2024-03-04 22:20:30 +08:00
|
|
|
build_lite: true
|
2024-02-01 08:46:55 +08:00
|
|
|
- name: install outbreak_forecast dependencies
|
|
|
|
run: |
|
|
|
|
. venv/bin/activate
|
|
|
|
python -m pip install -r demo/outbreak_forecast/requirements.txt
|
2024-02-17 01:27:07 +08:00
|
|
|
python -m pip install -r demo/gradio_pdf_demo/requirements.txt
|
2024-02-01 08:46:55 +08:00
|
|
|
- run: pnpm exec playwright install chromium
|
|
|
|
- name: run browser tests
|
|
|
|
run: |
|
|
|
|
. venv/bin/activate
|
|
|
|
CI=1 pnpm test:browser
|
|
|
|
- name: upload screenshots
|
|
|
|
uses: actions/upload-artifact@v4
|
|
|
|
if: always()
|
|
|
|
with:
|
|
|
|
name: playwright-screenshots
|
|
|
|
path: |
|
|
|
|
./test-results
|
|
|
|
- name: run browser component tests
|
|
|
|
run: |
|
|
|
|
. venv/bin/activate
|
|
|
|
pnpm run test:ct
|
2024-03-22 03:59:53 +08:00
|
|
|
- name: run reload mode test
|
|
|
|
run: |
|
|
|
|
. venv/bin/activate
|
|
|
|
pnpm test:browser:reload
|
2024-03-04 22:03:46 +08:00
|
|
|
- name: Run Lite E2E tests
|
|
|
|
run: |
|
|
|
|
. venv/bin/activate
|
|
|
|
pnpm --filter @gradio/app test:browser:lite
|
2024-02-01 08:46:55 +08:00
|
|
|
- name: do check
|
|
|
|
if: always()
|
|
|
|
uses: "gradio-app/github/actions/commit-status@main"
|
|
|
|
with:
|
|
|
|
type: "functional"
|
|
|
|
token: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
pr: ${{ needs.changes.outputs.pr_number }}
|
|
|
|
sha: ${{ needs.changes.outputs.sha }}
|
|
|
|
name: "test / functional"
|
|
|
|
result: ${{ job.status }}
|
2024-02-02 02:14:41 +08:00
|
|
|
job_id: "test-functional"
|