Async_ORM_Postgresql_Wrapper/.gitlab-ci.yml

44 lines
1.3 KiB
YAML
Raw Normal View History

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
- 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
stages: # List of stages for jobs, and their order of execution
2021-10-06 07:06:46 -05:00
- build
2021-10-06 07:07:04 -05:00
- test
2021-10-06 05:51:28 -05:00
pylint:
2021-10-06 07:07:04 -05:00
stage: test
script:
2021-10-06 06:55:36 -05:00
- 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 "${?}"
2021-10-06 07:22:11 -05:00
- 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/
2021-10-06 07:06:46 -05:00
build-job:
stage: build
script:
- echo "Attempting to build distribution wheel"
- python -m build --wheel
2021-10-06 06:59:38 -05:00
- echo "Wheel successfully built!"
2021-10-06 07:22:11 -05:00
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"