# Generated by ace_generate_ci — do not edit manually.
# Regenerate: ace_generate_ci(target="circleci")
version: 2.1

jobs:
  {% if 'python' in stack %}
  test-python:
    docker:
      - image: cimg/python:{{ python_version }}
    steps:
      - checkout
      - run:
          name: Install dependencies
          command: pip install -e ".[dev]" || pip install -r requirements.txt || true
      - run:
          name: Run tests
          command: {{ test_command }} --cov --cov-report=xml --cov-fail-under={{ coverage_threshold }}
      {% if run_quality %}
      - run:
          name: Ruff lint
          command: ruff check .
      {% endif %}
  {% endif %}

  {% if 'node' in stack %}
  test-node:
    docker:
      - image: cimg/node:{{ node_version }}
    steps:
      - checkout
      - run: npm ci
      - run: npm test
  {% endif %}

  {% if run_security %}
  security-scan:
    docker:
      - image: returntocorp/semgrep
    steps:
      - checkout
      - run:
          name: Semgrep
          command: semgrep --config=p/owasp-top-ten --error . || true
  {% endif %}

workflows:
  quality-gate:
    jobs:
      {% if 'python' in stack %}
      - test-python
      {% endif %}
      {% if 'node' in stack %}
      - test-node
      {% endif %}
      {% if run_security %}
      - security-scan
      {% endif %}
