gradio/.circleci/config.yml

79 lines
2.1 KiB
YAML
Raw Normal View History

2021-10-14 12:06:40 +08:00
version: 2.1
2021-10-14 12:05:40 +08:00
orbs:
2022-04-19 02:22:45 +08:00
codecov: codecov/codecov@3.2.2
node: circleci/node@5.0.2
2019-05-30 16:03:00 +08:00
jobs:
test:
parameters:
test-type:
type: string
python-version:
type: string
environment:
NODE_OPTIONS: --max-old-space-size=4096
2019-05-30 16:03:00 +08:00
docker:
- image: cimg/python:<< parameters.python-version >>-browsers
2019-05-30 16:03:00 +08:00
steps:
- checkout
- run: mkdir test-reports
2021-08-18 02:42:30 +08:00
- 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: Upgrade virtual environment tools
command: |
python -m pip install --upgrade pip virtualenv
2019-05-30 15:53:37 +08:00
- run:
2019-05-30 16:03:00 +08:00
name: Install Python deps in a venv
2019-05-30 15:53:37 +08:00
command: |
python -m virtualenv venv
2019-05-30 16:03:00 +08:00
. venv/bin/activate
bash scripts/install_gradio.sh
bash scripts/install_test_requirements.sh
2021-08-18 02:42:30 +08:00
- save_cache:
key: deps4-{{ .Branch }}-{{ checksum "requirements.txt" }}-<< parameters.python-version >>
2021-08-18 02:42:30 +08:00
paths:
- "venv"
2021-10-27 00:58:47 +08:00
- node/install:
node-version: "16"
- run:
name: Build frontend
command: |
2022-05-02 19:27:26 +08:00
npm i pnpm@6 -g
cd ui
pnpm i --frozen-lockfile
pnpm build
- run:
command: |
mkdir screenshots
- run:
command: |
. venv/bin/activate
bash scripts/lint_backend.sh
- run:
command: |
. venv/bin/activate
coverage run -m pytest -m "<< parameters.test-type >>"
coverage xml
2021-10-14 12:05:40 +08:00
- codecov/upload:
file: "coverage.xml"
2019-05-30 16:03:00 +08:00
- store_artifacts:
path: /home/circleci/project/test/tmp
destination: screenshots
2019-05-30 16:03:00 +08:00
- store_test_results:
2021-02-18 01:50:11 +08:00
path: test-reports/
workflows:
backend:
jobs:
- test:
matrix:
parameters:
test-type: ["not flaky", "flaky"]
python-version: ["3.9.2", "3.7.13"]