Async_ORM_Postgresql_Wrapper/.gitlab-ci.yml
Price Hiller 2d823e674c 🙏
2021-10-06 07:22:11 -05:00

44 lines
1.3 KiB
YAML

default:
image: python:3.9-alpine
before_script:
- apk add build-base
- apk add --no-cache postgresql-libs
- apk add --no-cache --virtual .build-deps gcc musl-dev postgresql-dev
- python3.9 -m pip install -r requirements.txt
- apk --purge del .build-deps
stages: # List of stages for jobs, and their order of execution
- build
- test
pylint:
stage: test
script:
- python3.9 -m pip install pylint pylint-exit anybadge
- mkdir ./pylint
- python3.9 -m pylint --output-format=text asyncdb | tee ./pylint/pylint.log || pylint-exit "${?}"
- PYLINT_SCORE="$(sed -n 's/^Your code has been rated at \([-0-9.]*\)\/.*/\1/p' ./pylint/pylint.log)"
- anybadge --label=Pylint --file=pylint/pylint.svg --value="${PYLINT_SCORE}" 2=red 4=orange 8=yellow 10=green
- echo "Pylint score is "${PYLINT_SCORE}"
artifacts:
paths:
- ./pylint/
build-job:
stage: build
script:
- echo "Attempting to build distribution wheel"
- python -m build --wheel
- echo "Wheel successfully built!"
sudo gitlab-runner register -n \
--url https://gitlab.orion-technologies.io \
--registration-token cz2D-RzpirwRYPKuK1EA \
--executor docker \
--description "My Docker Runner" \
--docker-image "docker:19.03.12" \
--docker-privileged \
--docker-volumes "/certs/client"