2021-10-06 08:12:09 -05:00
|
|
|
include:
|
|
|
|
- template: Code-Quality.gitlab-ci.yml
|
|
|
|
|
2021-10-06 06:10:33 -05:00
|
|
|
default:
|
2021-10-06 07:18:38 -05:00
|
|
|
image: python:3.9-alpine
|
2021-10-06 06:10:33 -05:00
|
|
|
before_script:
|
2021-10-06 06:28:03 -05:00
|
|
|
- apk add build-base
|
2021-10-06 06:22:35 -05:00
|
|
|
- apk add --no-cache postgresql-libs
|
|
|
|
- apk add --no-cache --virtual .build-deps gcc musl-dev postgresql-dev
|
2021-10-06 06:54:21 -05:00
|
|
|
- python3.9 -m pip install -r requirements.txt
|
2021-10-06 06:22:35 -05:00
|
|
|
- apk --purge del .build-deps
|
2021-10-06 05:51:28 -05:00
|
|
|
|
2021-10-06 06:49:16 -05:00
|
|
|
stages: # List of stages for jobs, and their order of execution
|
2021-10-06 07:26:21 -05:00
|
|
|
- stage-1
|
2021-10-06 08:12:09 -05:00
|
|
|
- test
|
2021-10-06 06:49:16 -05:00
|
|
|
|
2021-10-06 07:23:25 -05:00
|
|
|
build-wheel:
|
2021-10-06 07:26:21 -05:00
|
|
|
stage: stage-1
|
2021-10-06 07:23:25 -05:00
|
|
|
script:
|
|
|
|
- echo "Attempting to build distribution wheel"
|
|
|
|
- python -m build --wheel
|
|
|
|
- echo "Wheel successfully built!"
|
|
|
|
|
2021-10-06 06:49:16 -05:00
|
|
|
pylint:
|
2021-10-06 07:26:21 -05:00
|
|
|
stage: stage-1
|
2021-10-06 06:49:16 -05:00
|
|
|
script:
|
2021-10-06 06:55:36 -05:00
|
|
|
- python3.9 -m pip install pylint pylint-exit anybadge
|
2021-10-06 07:44:41 -05:00
|
|
|
- python3.9 -m pylint --output-format=text asyncdb | tee pylint.log || pylint-exit "${?}"
|
2021-10-06 07:46:42 -05:00
|
|
|
- PYLINT_SCORE="$(sed -n 's/^Your code has been rated at \([-0-9.]*\)\/.*/\1/p' pylint.log)"
|
2021-10-06 07:38:25 -05:00
|
|
|
- anybadge --label=Pylint --file=pylint.svg --value="${PYLINT_SCORE}" 2=red 4=orange 8=yellow 10=green
|
2021-10-06 07:25:18 -05:00
|
|
|
- echo "Pylint score is ${PYLINT_SCORE}"
|
2021-10-06 06:49:16 -05:00
|
|
|
artifacts:
|
|
|
|
paths:
|
2021-10-06 07:38:25 -05:00
|
|
|
- pylint.svg
|
2021-10-06 06:49:16 -05:00
|
|
|
|
2021-10-06 08:12:09 -05:00
|
|
|
code_quality:
|
2021-10-06 08:18:52 -05:00
|
|
|
inherit:
|
|
|
|
default: false
|
2021-10-06 08:12:09 -05:00
|
|
|
stage: test
|
2021-10-06 08:21:39 -05:00
|
|
|
image: docker:stable
|