mirror of
https://github.com/gradio-app/gradio.git
synced 2024-12-21 02:19:59 +08:00
4a85559219
* always install pnpm * clean upo
80 lines
2.2 KiB
YAML
80 lines
2.2 KiB
YAML
name: "functional"
|
|
|
|
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
|
|
|
|
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: "functional"
|
|
token: ${{ secrets.GITHUB_TOKEN }}
|
|
test:
|
|
permissions:
|
|
contents: read
|
|
name: "functional-test"
|
|
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"
|
|
- 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 firefox
|
|
- 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
|
|
- name: upload reload mode screenshots
|
|
uses: actions/upload-artifact@v4
|
|
if: always()
|
|
with:
|
|
name: reload-mode-playwright-screenshots
|
|
path: |
|
|
./test-results
|