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

stages:
  - test
  - security

{% if 'python' in stack %}
test:python:
  stage: test
  image: python:{{ python_version }}-slim
  before_script:
    - pip install -e ".[dev]" || pip install -r requirements.txt || true
  script:
    - {{ test_command }} --cov --cov-report=xml --cov-fail-under={{ coverage_threshold }}
    {% if run_quality %}
    - ruff check .
    {% endif %}
  coverage: '/TOTAL.*\s(\d+%)$/'
  artifacts:
    reports:
      coverage_report:
        coverage_format: cobertura
        path: coverage.xml
{% endif %}

{% if 'node' in stack %}
test:node:
  stage: test
  image: node:{{ node_version }}-slim
  before_script:
    - npm ci
  script:
    - npm test
{% endif %}

{% if run_security %}
security:semgrep:
  stage: security
  image: returntocorp/semgrep
  script:
    - semgrep --config=p/owasp-top-ten --error .
  allow_failure: true
{% endif %}

{% if run_deps and 'python' in stack %}
security:deps:
  stage: security
  image: python:{{ python_version }}-slim
  script:
    - pip install pip-audit && pip-audit || true
  allow_failure: true
{% endif %}
