Skip to content
Snippets Groups Projects
Commit d0c2232d authored by Saralegui Vallejo, Unai's avatar Saralegui Vallejo, Unai
Browse files

add pylint job for code checking

parent a59485b9
No related branches found
No related tags found
No related merge requests found
variables:
PIP_CACHE_DIR: "$CI_PROJECT_DIR/.cache/pip"
VIRTUALENV_NAME: "venv"
cache:
paths:
- .cache/pip
- $VIRTUALENV_NAME/
base:
stage: base
image: $ACR_URL/python:3.8
tags:
- docker
script:
- pip install virtualenv # install virtualenv to create a virtual environment to install required packages
- virtualenv $VIRTUALENV_NAME # create a virtualenvironment
- source $VIRTUALENV_NAME/bin/activate # activate the virtualenvironment
- python -V # print python version for debugging
\ No newline at end of file
#defines the job in Static Analysis
pylint:
stage: code_analysis
image: $ACR_URL/python:3.8
tags:
- docker
script:
- source $VIRTUALENV_NAME/bin/activate
- pip install pylint
- pylint -d C0301 $MODULE_FOLDER
variables:
PIP_CACHE_DIR: "$CI_PROJECT_DIR/.cache/pip"
VIRTUALENV_NAME: "venv"
cache:
paths:
- .cache/pip
- $VIRTUALENV_NAME/
virtualenv: virtualenv:
stage: virtualenv stage: dependencies
image: $ACR_URL/python:3.8 image: $ACR_URL/python:3.8
tags: tags:
- docker - docker
only:
refs:
# run only when new tag is published or changes pushed to master
- tags
- master
script: script:
- pip install virtualenv # install virtualenv to create a virtual environment to install required packages
- virtualenv $VIRTUALENV_NAME # create a virtualenvironment
- source $VIRTUALENV_NAME/bin/activate # activate the virtualenvironment
- python -V # print python version for debugging
- pip install -r requirements.txt --extra-index-url $ACR_PYPI_INDEX_URL # install required packages look also in artifactory - pip install -r requirements.txt --extra-index-url $ACR_PYPI_INDEX_URL # install required packages look also in artifactory
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment