AUTOMATIC1111/stable-diffusion-webui

3 workflows · maturity 17% · 0 patterns · GitHub ↗

Security 0/100

Practices

○ Matrix○ Permissions○ Security scan○ AI review✓ Cache○ Concurrency○ Reusable workflows

Security dimensions

permissions
0
security scan
0
supply chain
0
secret handling
0
harden runner
0

Workflows (3)

on_pull_request .github/workflows/on_pull_request.yaml
Triggers
push, pull_request
Runs on
ubuntu-latest, ubuntu-latest
Jobs
lint-python, lint-js
Commands
  • pip install ruff==0.3.3
  • ruff .
  • npm i --ci
  • npm run lint
View raw YAML
name: Linter

on:
  - push
  - pull_request

jobs:
  lint-python:
    name: ruff
    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: Checkout Code
        uses: actions/checkout@v4
      - uses: actions/setup-python@v5
        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: Install Ruff
        run: pip install ruff==0.3.3
      - name: Run Ruff
        run: ruff .
  lint-js:
    name: eslint
    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: Checkout Code
        uses: actions/checkout@v4
      - name: Install Node.js
        uses: actions/setup-node@v4
        with:
          node-version: 18
      - run: npm i --ci
      - run: npm run lint
run_tests .github/workflows/run_tests.yaml
Triggers
push, pull_request
Runs on
ubuntu-latest
Jobs
test
Commands
  • pip install wait-for-it -r requirements-test.txt
  • python launch.py --skip-torch-cuda-test --exit
  • pip freeze
  • python -m coverage run --data-file=.coverage.server launch.py --skip-prepare-environment --skip-torch-cuda-test --test-server --do-not-download-clip --no-half --disable-opt-split-attention --use-cpu all --api-server-stop 2>&1 | tee output.txt &
  • wait-for-it --service 127.0.0.1:7860 -t 20 python -m pytest -vv --junitxml=test/results.xml --cov . --cov-report=xml --verify-base-url test
  • curl -vv -XPOST http://127.0.0.1:7860/sdapi/v1/server-stop && sleep 10
  • python -m coverage combine .coverage* python -m coverage report -i python -m coverage html -i
View raw YAML
name: Tests

on:
  - push
  - pull_request

jobs:
  test:
    name: tests on CPU with empty model
    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: Checkout Code
        uses: actions/checkout@v4
      - name: Set up Python 3.10
        uses: actions/setup-python@v5
        with:
          python-version: 3.10.6
          cache: pip
          cache-dependency-path: |
            **/requirements*txt
            launch.py
      - name: Cache models
        id: cache-models
        uses: actions/cache@v4
        with:
          path: models
          key: "2023-12-30"
      - 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
        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"
          PYTHONUNBUFFERED: "1"
      - name: Print installed packages
        run: pip freeze
      - name: Start test server
        run: >
          python -m coverage run
          --data-file=.coverage.server
          launch.py
          --skip-prepare-environment
          --skip-torch-cuda-test
          --test-server
          --do-not-download-clip
          --no-half
          --disable-opt-split-attention
          --use-cpu all
          --api-server-stop
          2>&1 | tee output.txt &
      - name: Run tests
        run: |
          wait-for-it --service 127.0.0.1:7860 -t 20
          python -m pytest -vv --junitxml=test/results.xml --cov . --cov-report=xml --verify-base-url test
      - name: Kill test server
        if: always()
        run: curl -vv -XPOST http://127.0.0.1:7860/sdapi/v1/server-stop && sleep 10
      - 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@v4
        if: always()
        with:
          name: output
          path: output.txt
      - name: Upload coverage HTML
        uses: actions/upload-artifact@v4
        if: always()
        with:
          name: htmlcov
          path: htmlcov
warns_merge_master .github/workflows/warns_merge_master.yml
Triggers
pull_request
Runs on
ubuntu-latest
Jobs
check
Commands
  • echo -e "::warning::This pull request directly merge into \"master\" branch, normally development happens on \"dev\" branch." exit 1
View raw YAML
name: Pull requests can't target master branch

"on":
  pull_request:
    types:
      - opened
      - synchronize
      - reopened
    branches:
      - master

jobs:
  check:
    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