image: python:3.10-slim

before_script:
  - apt-get update -q -y
  - apt-get install -y make
  - python3 -V
  - pip install -r requirements.txt
  - pip install pytest
  - pip install pyyaml

symbol_rulechecker:
  rules:
    - if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
    - changes:
      - "common/*"
      - "klc-check/*"
      - "klc-check/*symbol/*"
  script:
    - make test-klc-symbols
    - make test-comparelibs-symbols
  artifacts:
    reports:
      metrics: metrics.txt

footprint_rulechecker:
  rules:
    - if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
    - changes:
      - "common/*"
      - "klc-check/*"
      - "klc-check/*footprint.pretty/*"
  script:
    - make test-klc-footprints
  artifacts:
    reports:
      metrics: metrics.txt

check_python_code:
  rules:
    - when: always
  script:
    - pip install flake8
    - make lint
    - make style-check

check_spelling:
  rules:
    - when: always
  script:
    - apt-get -qq update && apt-get install --yes codespell
    - make spelling
