add pytest

This commit is contained in:
Pritimay Sarkar
2024-01-17 15:33:40 +05:30
parent 6f4ba44e48
commit 1025a92337
3 changed files with 39 additions and 27 deletions

View File

@@ -8,6 +8,9 @@
# https://hub.docker.com/r/library/python/tags/
image: python:latest
stages:
- test
# Change pip's cache directory to be inside the project directory since we can
# only cache local items.
variables:
@@ -24,33 +27,38 @@ before_script:
- virtualenv venv
- source venv/bin/activate
test:
unit_test:
stage: test
script:
- pip install ruff tox # you can also use tox
- pip install --editable ".[test]"
- tox -e py,ruff
- pytest
run:
script:
- pip install .
# run the command here
artifacts:
paths:
- build/*
# test:
# script:
# - pip install ruff tox # you can also use tox
# - pip install --editable ".[test]"
# - tox -e py,ruff
pages:
script:
- pip install sphinx sphinx-rtd-theme
- cd doc
- make html
- mv build/html/ ../public/
artifacts:
paths:
- public
rules:
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
# run:
# script:
# - pip install .
# # run the command here
# artifacts:
# paths:
# - build/*
deploy:
stage: deploy
script: echo "Define your deployment script!"
environment: production
# pages:
# script:
# - pip install sphinx sphinx-rtd-theme
# - cd doc
# - make html
# - mv build/html/ ../public/
# artifacts:
# paths:
# - public
# rules:
# - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
# deploy:
# stage: deploy
# script: echo "Define your deployment script!"
# environment: production