Async_ORM_Postgresql_Wrapper/.gitlab-ci.yml

42 lines
1.4 KiB
YAML
Raw Normal View History

2021-10-06 06:10:33 -05:00
default:
2021-10-06 06:28:03 -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:11:17 -05:00
- python3 -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
- build
- test
build-job: # This job runs in the build stage, which runs first.
stage: build
script:
2021-10-06 06:31:14 -05:00
- echo "Attempting to build distribution wheel"
2021-10-06 06:17:35 -05:00
- python -m build --wheel
2021-10-06 06:31:14 -05:00
- echo "Wheel successfully built!"
2021-10-06 05:51:28 -05:00
# unit-test-job: # This job runs in the test stage.
# stage: test # It only starts when the job in the build stage completes successfully.
# script:
# - echo "Running unit tests... This will take about 60 seconds."
# - sleep 60
# - echo "Code coverage is 90%"
lint-test-job: # This job also runs in the test stage.
2021-10-06 06:36:41 -05:00
stage: test
before_script:
- pip install pylint pylint-exit anybadge
2021-10-06 05:51:28 -05:00
script:
2021-10-06 06:36:41 -05:00
- mkdir ./pylint
- pylint --output-format=text . | 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/
2021-10-06 05:51:28 -05:00