stages:
 - test

before_script:
  - apt-get update --yes
  - apt-get install --yes build-essential cmake libfmt-dev pybind11-dev
  - python -m pip install --upgrade pip
  - python --version
  - pip install pytest pytest-cov
  - pip install .
  - pip show b_asic

.run-test:
  stage: test
  script:
    - pytest --cov=b_asic --cov-report xml:cov.xml --cov-report term test
  artifacts:
      reports:
        coverage_report:
          coverage_format: cobertura
          path: cov.xml

run-test-3.6:
  image: python:3.6
  extends: ".run-test"

run-test-3.7:
  image: python:3.7
  extends: ".run-test"

run-test-3.8:
  image: python:3.8
  extends: ".run-test"

run-test-3.9:
  image: python:3.9
  extends: ".run-test"

run-test-3.10:
  image: python:3.10
  extends: ".run-test"

run-test-qt:
  image: python:3.10
  extends: ".run-test"
  script:
    - apt-get install --yes xvfb python3-pyqt5
    - pip install pytest-xvfb pytest-qt
    - pytest --cov=b_asic --cov-report xml:cov.xml --cov-report term test
