image: python:3.9 variables: pip3_CACHE_DIR: "$CI_PROJECT_DIR/.cache/pip" cache: paths: - .cache/pip3 - venv/ workflow: rules: - if: '$CI_PIPELINE_SOURCE == "merge_request_event" || $CI_PIPELINE_SOURCE == "web"' - if: $CI_MERGE_REQUEST_IID - if: $CI_COMMIT_TAG - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH before_script: - python3 --version - pip3 install virtualenv - virtualenv venv - source venv/bin/activate - pip3 install -r requirements.txt - pip3 install pylint stages: - static_analysis - tests pylint: stage: static_analysis script: # ignore C0301 -- "Line too long" pylint -d C0301 *.py > pylint_output.txt artifacts: paths: - pylint_output.txt when: always unit_tests: stage: tests script: - echo "Running unit tests" - python3 -m unittest