forked from gradio-app/gradio
-
Notifications
You must be signed in to change notification settings - Fork 0
89 lines (85 loc) · 2.59 KB
/
test-functional.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
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:
name: "functional-test-SSR=${{ matrix.SSR }}"
permissions:
contents: read
runs-on: ubuntu-latest
needs: changes
strategy:
matrix:
ssr: [true, false]
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:
python_version: "3.10"
test: true
- name: install dependencies for specific tests
run: |
. venv/bin/activate
python -m pip install -r demo/outbreak_forecast/requirements.txt
python -m pip install -r demo/stream_video_out/requirements.txt
- run: pnpm exec playwright install chromium firefox
- name: build essential packages
run: pnpm --filter @gradio/utils --filter @gradio/theme package
- name: run browser tests
env:
GRADIO_SSR_MODE: ${{ matrix.ssr }}
run: |
. venv/bin/activate
CI=1 pnpm test:browser
- name: upload screenshots
uses: actions/upload-artifact@v4
if: always()
with:
name: playwright-screenshots-SSR-${{ matrix.ssr }}
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-SSR-${{ matrix.ssr }}
path: |
./test-results