default ci/cd back
Some checks failed
Linter / ruff (push) Failing after 1m15s
Linter / eslint (push) Failing after 1m39s
Tests / tests on CPU (push) Failing after 38s

This commit is contained in:
soaska 2024-05-03 20:35:23 +03:00
parent bcd760aa23
commit fed6f1af7b
3 changed files with 21 additions and 33 deletions

View File

@ -7,33 +7,27 @@ on:
jobs:
lint-python:
name: ruff
runs-on: soaska
if: gitea.event_name != 'pull_request' || gitea.event.pull_request.head.repo.full_name != gitea.event.pull_request.base.repo.full_name
runs-on: ubuntu-latest
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name
steps:
- name: Prepare env
run: apk add --no-cache nodejs git curl python3 cmake pkgconfig
- name: Checkout Code
uses: actions/checkout@v3
- uses: actions/setup-python@v4
# with:
# python-version: 3.11
with:
python-version: 3.11
# NB: there's no cache: pip here since we're not installing anything
# from the requirements.txt file(s) in the repository; it's faster
# not to have GHA download an (at the time of writing) 4 GB cache
# of PyTorch and other dependencies.
- name: create venv
run: python -m venv venv
- name: Install Ruff
run: venv/bin/pip3 install ruff==0.1.6
run: pip install ruff==0.1.6
- name: Run Ruff
run: venv/bin/ruff .
run: ruff .
lint-js:
name: eslint
runs-on: soaska
if: gitea.event_name != 'pull_request' || gitea.event.pull_request.head.repo.full_name != gitea.event.pull_request.base.repo.full_name
runs-on: ubuntu-latest
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name
steps:
- name: Prepare env
run: apk add --no-cache nodejs git curl python3 cmake
- name: Checkout Code
uses: actions/checkout@v3
- name: Install Node.js

View File

@ -10,25 +10,19 @@ env:
jobs:
test:
name: tests on CPU
runs-on: soaska
if: gitea.event_name != 'pull_request' || gitea.event.pull_request.head.repo.full_name != gitea.event.pull_request.base.repo.full_name
runs-on: ubuntu-latest
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name
steps:
- name: Prepare env
run: apk add --no-cache nodejs git curl python3 cmake pkgconfig
- name: Checkout Code
uses: actions/checkout@v3
- name: Set up Python 3.10
uses: actions/setup-python@v4
with:
# python-version: 3.10.6
python-version: 3.10.6
cache: pip
cache-dependency-path: |
**/requirements*txt
launch.py
- name: create venv
run: python -m venv venv
- name: install sentencepiece
run: curl https://github.com/google/sentencepiece/releases/download/v0.2.0/sentencepiece-0.2.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl -o sentencepiece-0.2.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl && venv/bin/pip3 install sentencepiece-0.2.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
launch.py
- name: Cache models
id: cache-models
uses: actions/cache@v3
@ -36,12 +30,12 @@ jobs:
path: models
key: "2023-12-30"
- name: Install test dependencies
run: venv/bin/pip3 install wait-for-it -r requirements-test.txt
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: venv/bin/python3 launch.py --skip-torch-cuda-test --exit
run: python launch.py --skip-torch-cuda-test --exit
env:
PIP_DISABLE_PIP_VERSION_CHECK: "1"
PIP_PROGRESS_BAR: "off"
@ -49,7 +43,7 @@ jobs:
WEBUI_LAUNCH_LIVE_OUTPUT: "1"
PYTHONUNBUFFERED: "1"
- name: Print installed packages
run: /venv/bin/pip3 freeze
run: pip freeze
- name: Download models
run: |
declare -a urls=(
@ -60,7 +54,7 @@ jobs:
if [ ! -f "$filename" ]; then
curl -Lo "$filename" "$url"
fi
done
done
# - name: Download ControlNet models
# run: |
# declare -a urls=(
@ -75,7 +69,7 @@ jobs:
# done
- name: Start test server
run: >
venv/bin/python3 -m coverage run
python -m coverage run
--data-file=.coverage.server
launch.py
--skip-prepare-environment
@ -87,11 +81,11 @@ jobs:
--always-cpu
--api-server-stop
--ckpt models/Stable-diffusion/realisticVisionV51_v51VAE.safetensors
2>&1 | tee output.txt &
2>&1 | tee output.txt &
- name: Run tests
run: |
wait-for-it --service 127.0.0.1:7860 -t 20
venv/bin/python3 -m pytest -vv --junitxml=test/results.xml --cov . --cov-report=xml --verify-base-url test
python -m pytest -vv --junitxml=test/results.xml --cov . --cov-report=xml --verify-base-url test
# TODO(huchenlei): Enable ControlNet tests. Currently it is too slow to run these tests on CPU with
# real SD model. We need to find a way to load empty SD model.
# - name: Run ControlNet tests

View File

@ -11,9 +11,9 @@ name: Pull requests can't target master branch
jobs:
check:
runs-on: soaska
runs-on: ubuntu-latest
steps:
- name: Warning marge into master
run: |
echo -e "::warning::This pull request directly merge into \"master\" branch, normally development happens on \"dev\" branch."
exit 1
exit 1