2022-11-19 19:15:10 +08:00
|
|
|
name: Run basic features tests on CPU with empty SD model
|
2022-11-14 18:39:22 +08:00
|
|
|
|
|
|
|
on:
|
|
|
|
- push
|
|
|
|
- pull_request
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
test:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: Checkout Code
|
|
|
|
uses: actions/checkout@v3
|
|
|
|
- name: Set up Python 3.10
|
2022-11-19 05:56:08 +08:00
|
|
|
uses: actions/setup-python@v4
|
2022-11-14 18:39:22 +08:00
|
|
|
with:
|
|
|
|
python-version: 3.10.6
|
2023-01-07 17:34:02 +08:00
|
|
|
cache: pip
|
|
|
|
cache-dependency-path: |
|
|
|
|
**/requirements*txt
|
2023-05-11 15:51:52 +08:00
|
|
|
launch.py
|
2023-05-12 02:57:43 +08:00
|
|
|
- name: Install test dependencies
|
|
|
|
run: pip install wait-for-it -r requirements-test.txt
|
|
|
|
env:
|
|
|
|
PIP_DISABLE_PIP_VERSION_CHECK: "1"
|
|
|
|
PIP_PROGRESS_BAR: "off"
|
|
|
|
- name: Setup environment
|
|
|
|
run: python launch.py --skip-torch-cuda-test --exit
|
2023-05-11 15:36:10 +08:00
|
|
|
env:
|
|
|
|
PIP_DISABLE_PIP_VERSION_CHECK: "1"
|
|
|
|
PIP_PROGRESS_BAR: "off"
|
|
|
|
TORCH_INDEX_URL: https://download.pytorch.org/whl/cpu
|
|
|
|
WEBUI_LAUNCH_LIVE_OUTPUT: "1"
|
2023-05-12 02:57:43 +08:00
|
|
|
PYTHONUNBUFFERED: "1"
|
|
|
|
- name: Start test server
|
|
|
|
run: >
|
|
|
|
python -m coverage run
|
|
|
|
--data-file=.coverage.server
|
|
|
|
launch.py
|
|
|
|
--skip-prepare-environment
|
|
|
|
--skip-torch-cuda-test
|
|
|
|
--test-server
|
|
|
|
--no-half
|
|
|
|
--disable-opt-split-attention
|
|
|
|
--use-cpu all
|
|
|
|
--add-stop-route
|
|
|
|
2>&1 | tee output.txt &
|
|
|
|
- name: Run tests
|
|
|
|
run: |
|
|
|
|
wait-for-it --service 127.0.0.1:7860 -t 600
|
|
|
|
python -m pytest -vv --junitxml=test/results.xml --cov . --cov-report=xml --verify-base-url test
|
|
|
|
- name: Kill test server
|
|
|
|
if: always()
|
2023-06-14 18:53:08 +08:00
|
|
|
run: curl -vv -XPOST http://127.0.0.1:7860/sdapi/v1/server-stop && sleep 10
|
2023-05-12 02:57:43 +08:00
|
|
|
- name: Show coverage
|
|
|
|
run: |
|
|
|
|
python -m coverage combine .coverage*
|
|
|
|
python -m coverage report -i
|
|
|
|
python -m coverage html -i
|
|
|
|
- name: Upload main app output
|
|
|
|
uses: actions/upload-artifact@v3
|
|
|
|
if: always()
|
|
|
|
with:
|
|
|
|
name: output
|
|
|
|
path: output.txt
|
|
|
|
- name: Upload coverage HTML
|
2022-11-14 23:40:15 +08:00
|
|
|
uses: actions/upload-artifact@v3
|
|
|
|
if: always()
|
|
|
|
with:
|
2023-05-12 02:57:43 +08:00
|
|
|
name: htmlcov
|
|
|
|
path: htmlcov
|