gradio/.github/workflows/test-functional.yml

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

93 lines
2.9 KiB
YAML
Raw Normal View History

name: "test / functional"
on:
workflow_run:
workflows: ["trigger"]
types:
- 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 }}"
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 }}
mergeable: ${{ steps.changes.outputs.mergeable }}
steps:
- uses: actions/checkout@v4
- uses: "gradio-app/gradio/.github/actions/changes@main"
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
steps:
- uses: actions/checkout@v4
with:
ref: ${{ needs.changes.outputs.merge_sha }}
repository: ${{ needs.changes.outputs.mergeable == 'true' && github.repository || needs.changes.outputs.source_repo }}
- name: install dependencies
id: install_deps
uses: "gradio-app/gradio/.github/actions/install-all-deps@main"
with:
always_install_pnpm: true
2024-03-04 22:20:30 +08:00
build_lite: true
- name: install outbreak_forecast dependencies
run: |
. venv/bin/activate
python -m pip install -r demo/outbreak_forecast/requirements.txt
python -m pip install -r demo/gradio_pdf_demo/requirements.txt
- 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
- name: run reload mode test
run: |
. venv/bin/activate
pnpm test:browser:reload
fix-tests (#7345) * fix-tests * [tmp] Comment-out * Fix the URL constructor calls in `resolve_wasm_src()`, `should_proxy_wasm_src()`, and `<DownloadLink />` to handle relative URLs * Remove a circular dependency between lite/index.ts and lite/custom-element/index.ts to solve a bug that the dev app is mounted twice sometimes * Fix js/app/test/image_component_events.spec.ts * Set the `testIgnore` in `.config/playwright.config.js` * Fix the Lite dev mode only to create an app and expose the controller for Playwright, without editors etc. * add changeset * Set the mocked ruff version as 0.2.2 * Extend timeout * Fix to use the built lite files instead of the dev server * add changeset * comment out failed tests * Revert "comment out failed tests" This reverts commit 3580d7988714f49a21e221fe230b26ee86b66a68. * Fix the Gellery component to work in Wasm * Fix js/app/test/file_explorer_component_events.spec.ts to run on Wasm * Ignore queue_full_e2e_test.spec.ts * Revert "[tmp] Comment-out" This reverts commit c775c0cc298ac7e1f49545042e1dc7b6615d179d. * Revert "Extend timeout" This reverts commit 742d1e1e83fc99bd0ac6107a589b75905b7ed593. * Remove a commented out line * Refactor file_explorer_component_events.spec.ts * Revert "fix-tests", restoring the original test-functional.yml content This reverts commit 9ff2a7ddc5b00e1f41b4d7e9c4a64223934cf268. * Set CI step names * [tmp] Revert "Revert "fix-tests", restoring the original test-functional.yml content" This reverts commit de2dbe33173de39304294e6b46151ef1e07f6806. * Revert "[tmp] Revert "Revert "fix-tests", restoring the original test-functional.yml content"" This reverts commit 32154f3bb18d83bad5bce14e254d635dfbe847af. * [tmp] Revert "Revert "[tmp] Revert "Revert "fix-tests", restoring the original test-functional.yml content""" This reverts commit 204075e190eb755a99d2bb449fc339b1f1b5c29b. * Fix vite.config.js removing unnecessary code * Revert "Set the `testIgnore` in `.config/playwright.config.js`" This reverts commit 98dccc5be94ea9c77e69a58f50db577922fe2d67. * Add gallery_component_events.spec.ts * Revert js/app/test * tweak * tweak * revert workflow changes * add changeset --------- Co-authored-by: Yuichiro Tachibana (Tsuchiya) <t.yic.yt@gmail.com> Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
2024-03-04 22:03:46 +08:00
- name: Run Lite E2E tests
run: |
. venv/bin/activate
pnpm --filter @gradio/app test:browser:lite
- 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 }}
job_id: "test-functional"