stages:
  - test
  - build

variables:
  BUILD_ENV_DOCKER_IMAGE: docker-registry.ebrains.eu/esd/tmp:latest


build-wheel:
  stage: build
  tags:
    - docker-runner
  image: python:latest
  before_script:
    - python -m pip install --upgrade pip setuptools wheel build
  script:
    - python -m build --sdist --wheel
  artifacts:
    paths:
      - dist/*.whl
      - dist/*.tar.gz
    expire_in: 1 week


testing-pytest:
  stage: test
  tags:
    - docker-runner
  image: ubuntu:22.04
  script:
    - chmod +x dedal/utils/bootstrap.sh
    - ./dedal/utils/bootstrap.sh
    - pip install .
    - pytest ./dedal/tests/ -s --junitxml=test-results.xml
  artifacts:
    when: always
    reports:
      junit: test-results.xml
    paths:
      - test-results.xml
      - .dedal.log
      - .generate_cache.log
    expire_in: 1 week

