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

View File

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

View File

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