mirror of
https://github.com/gradio-app/gradio.git
synced 2025-04-06 12:30:29 +08:00
* Add python-3.7 tests * Format components * Use latest images * Use python instead of python3 * Force reset cache * Reset cache * Use Ipython 7 for python 3.7 support * Install chrome * Add two text files * Reset cache * Use Literal from typing extensions * Update cache key * Linting * Fix requests tests * Exit if running from wrong python version * Use one requirements file * Fix comment * Fix comment * Use python 3.7.13 * empty commit * Delete chrome driver to see if it works * Test no chrome with new cache * Remove chrome driver install entirely
83 lines
2.3 KiB
YAML
83 lines
2.3 KiB
YAML
version: 2.1
|
|
orbs:
|
|
codecov: codecov/codecov@3.2.2
|
|
node: circleci/node@5.0.2
|
|
|
|
jobs:
|
|
test:
|
|
parameters:
|
|
test-type:
|
|
type: string
|
|
python-version:
|
|
type: string
|
|
environment:
|
|
NODE_OPTIONS: --max-old-space-size=4096
|
|
docker:
|
|
- image: cimg/python:<< parameters.python-version >>-browsers
|
|
steps:
|
|
- checkout
|
|
- run: mkdir test-reports
|
|
- restore_cache:
|
|
key: deps4-{{ .Branch }}-{{ checksum "requirements.txt" }}-<< parameters.python-version >>
|
|
- run:
|
|
name: Install ffmpeg
|
|
command: |
|
|
sudo apt update
|
|
sudo apt install ffmpeg -y
|
|
- run:
|
|
name: Install Python deps in a venv
|
|
command: |
|
|
python -m venv venv
|
|
. venv/bin/activate
|
|
bash scripts/install_gradio.sh
|
|
bash scripts/install_test_requirements.sh
|
|
- save_cache:
|
|
key: deps4-{{ .Branch }}-{{ checksum "requirements.txt" }}-<< parameters.python-version >>
|
|
paths:
|
|
- "venv"
|
|
- node/install:
|
|
node-version: "16"
|
|
- run:
|
|
name: Build frontend
|
|
command: |
|
|
npm i pnpm@6 -g
|
|
cd ui
|
|
pnpm i --frozen-lockfile
|
|
pnpm build
|
|
- run:
|
|
command: |
|
|
mkdir screenshots
|
|
- run:
|
|
command: |
|
|
. venv/bin/activate
|
|
python -m black --check gradio test
|
|
- run:
|
|
command: |
|
|
. venv/bin/activate
|
|
python -m isort --profile=black --check-only gradio test
|
|
- run:
|
|
command: |
|
|
. venv/bin/activate
|
|
python -m flake8 --ignore=E731,E501,E722,W503,E126,F401,E203,F403 gradio test
|
|
- run:
|
|
command: |
|
|
. venv/bin/activate
|
|
coverage run -m pytest -m "<< parameters.test-type >>"
|
|
coverage xml
|
|
- codecov/upload:
|
|
file: "coverage.xml"
|
|
- store_artifacts:
|
|
path: /home/circleci/project/test/tmp
|
|
destination: screenshots
|
|
- store_test_results:
|
|
path: test-reports/
|
|
|
|
workflows:
|
|
backend:
|
|
jobs:
|
|
- test:
|
|
matrix:
|
|
parameters:
|
|
test-type: ["not flaky", "flaky"]
|
|
python-version: ["3.9.2", "3.7.13"]
|