Skip to content
Snippets Groups Projects
This GitLab CI configuration is valid. Learn more
.gitlab-ci.yml 1.27 KiB
stages:
  - test

# Setup environment with all required tools.
# Defined as hidden job (starting with dot) + YAML anchor (for referencing)
# See https://docs.gitlab.com/ee/ci/yaml/#anchors
.prepare-env-template: &prepare-env
  before_script:
    - echo $SHELL
    - echo $PATH
    - date
    - pwd
    - ls
    - apt list --installed
    - apt-get update
    - apt-get install -q -y git
    - git --version
    - apt-get install -q -y python3-setuptools
    - python3 setup.py --requires
    - apt-get install -q -y python3-appdirs
    - apt-get install -q -y python3-pip
    - python3 -V
    - pip3 -V
    - pip3 install .[pre-commit,testing]



# precommit specific stuff
# This will check if all files are proper json and yaml
run_precommit:
  image: ubuntu:latest
  stage: test
  timeout: 5m
  <<: *prepare-env
  script:
    - pre-commit run --all-files --config=.pre-commit-config.yaml || (git status --short; git diff ; exit 1)

# test specific stuff
.tests-template: &run-tests
  stage: test
  timeout: 10m
  <<: *prepare-env
  script:
    - cd tests/ && ./run_all_cov.sh
  artifacts:
    when: always
    reports:
      junit: tests/coverage.xml

    
# Test with default python interpreter and packages of following distributions:

tests_ubuntu_2004:
  image: ubuntu:20.04
  <<: *run-tests