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
|
2022-04-27 09:05:50 +08:00
|
|
|
node: circleci/node@5.0.2
|
2022-07-12 01:20:11 +08:00
|
|
|
|
2019-05-30 16:03:00 +08:00
|
|
|
jobs:
|
2022-07-12 01:20:11 +08:00
|
|
|
test:
|
|
|
|
parameters:
|
|
|
|
test-type:
|
|
|
|
type: string
|
2022-07-19 22:48:46 +08:00
|
|
|
python-version:
|
|
|
|
type: string
|
2022-04-27 09:05:50 +08:00
|
|
|
environment:
|
|
|
|
NODE_OPTIONS: --max-old-space-size=4096
|
2019-05-30 16:03:00 +08:00
|
|
|
docker:
|
2022-07-19 22:48:46 +08:00
|
|
|
- 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:
|
2022-07-19 22:48:46 +08:00
|
|
|
key: deps4-{{ .Branch }}-{{ checksum "requirements.txt" }}-<< parameters.python-version >>
|
2022-04-06 04:48:32 +08:00
|
|
|
- run:
|
|
|
|
name: Install ffmpeg
|
|
|
|
command: |
|
|
|
|
sudo apt update
|
|
|
|
sudo apt install ffmpeg -y
|
2022-09-15 05:39:46 +08:00
|
|
|
- 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: |
|
2022-09-15 05:39:46 +08:00
|
|
|
python -m virtualenv venv
|
2019-05-30 16:03:00 +08:00
|
|
|
. venv/bin/activate
|
2022-07-04 21:57:12 +08:00
|
|
|
bash scripts/install_gradio.sh
|
2022-02-04 20:23:11 +08:00
|
|
|
bash scripts/install_test_requirements.sh
|
2021-08-18 02:42:30 +08:00
|
|
|
- save_cache:
|
2022-07-19 22:48:46 +08:00
|
|
|
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:
|
2022-04-27 09:05:50 +08:00
|
|
|
node-version: "16"
|
2021-10-26 04:41:03 +08:00
|
|
|
- run:
|
|
|
|
name: Build frontend
|
|
|
|
command: |
|
2022-05-02 19:27:26 +08:00
|
|
|
npm i pnpm@6 -g
|
2022-02-11 03:22:22 +08:00
|
|
|
cd ui
|
|
|
|
pnpm i --frozen-lockfile
|
|
|
|
pnpm build
|
2020-10-23 22:28:30 +08:00
|
|
|
- run:
|
|
|
|
command: |
|
|
|
|
mkdir screenshots
|
2022-02-09 16:08:01 +08:00
|
|
|
- run:
|
|
|
|
command: |
|
2022-02-09 18:37:25 +08:00
|
|
|
. venv/bin/activate
|
2022-10-28 22:56:18 +08:00
|
|
|
bash scripts/lint_backend.sh
|
2022-03-30 00:18:27 +08:00
|
|
|
- run:
|
|
|
|
command: |
|
|
|
|
. venv/bin/activate
|
2022-07-12 01:20:11 +08:00
|
|
|
coverage run -m pytest -m "<< parameters.test-type >>"
|
2022-03-30 00:18:27 +08:00
|
|
|
coverage xml
|
2021-10-14 12:05:40 +08:00
|
|
|
- codecov/upload:
|
2022-04-27 09:05:50 +08:00
|
|
|
file: "coverage.xml"
|
2019-05-30 16:03:00 +08:00
|
|
|
- store_artifacts:
|
2020-10-23 22:28:30 +08:00
|
|
|
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/
|
2022-07-12 01:20:11 +08:00
|
|
|
|
|
|
|
workflows:
|
|
|
|
backend:
|
|
|
|
jobs:
|
|
|
|
- test:
|
|
|
|
matrix:
|
|
|
|
parameters:
|
|
|
|
test-type: ["not flaky", "flaky"]
|
2022-07-19 22:48:46 +08:00
|
|
|
python-version: ["3.9.2", "3.7.13"]
|