mirror of
https://gitlab.com/prpl-foundation/prplmesh/topologyviewer.git
synced 2025-12-20 00:51:07 +08:00
Bump to 3.12 in python:latest causes some distutils dependency issues that are yet to be resolved in the upstream image. See: https://github.com/pypa/setuptools/issues/3661 for more information. Signed-off-by: Tucker Polomik <t.polomik@cablelabs.com>
47 lines
847 B
YAML
47 lines
847 B
YAML
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
|
|
|
|
|