Commit b13b9778 authored by Daniel Scheffler's avatar Daniel Scheffler
Browse files

Added .gitlab-ci.yml


Signed-off-by: Daniel Scheffler's avatarDaniel Scheffler <danschef@gfz-potsdam.de>
parent 345d8096
Pipeline #4545 passed with stages
in 3 minutes and 30 seconds
before_script:
- git lfs pull
stages:
- test
- deploy
test_pyrsr:
stage: test
script:
- source /root/miniconda3/bin/activate
- source activate ci_env
- export GDAL_DATA=/root/miniconda3/envs/ci_env/share/gdal
- export PYTHONPATH=$PYTHONPATH:/root # /root <- directory needed later
- make nosetests
# create the docs
- pip install sphinx_rtd_theme # Read-the-docs theme for SPHINX documentation
- pip install sphinx-autodoc-typehints
- make docs
artifacts:
paths:
- htmlcov/
- docs/_build/html/
- nosetests.html
- nosetests.xml
when: always
test_styles:
stage: test
script:
- source /root/miniconda3/bin/activate
- source activate ci_env
- export GDAL_DATA=/root/miniconda3/envs/ci_env/share/gdal
- export PYTHONPATH=$PYTHONPATH:/root # /root <- directory needed later
- make lint
artifacts:
paths:
- tests/linting/flake8.log
- tests/linting/pycodestyle.log
- tests/linting/pydocstyle.log
when: always
test_pyrsr_install:
stage: test
script:
- source /root/miniconda3/bin/activate
- conda create -y -q --name pyrsr_testinstall python=3
- source activate pyrsr_testinstall
# resolve some requirements with conda
- conda install --yes -q -c conda-forge numpy matplotlib pandas
# run installer
- python setup.py install
# test if its importable
- cd ..
- pwd
- ls
- python -c "import pyrsr; print(pyrsr)"
- python -c "from pyrsr import RSR"
only:
- master
pages: # this job must be called 'pages' to advise GitLab to upload content to GitLab Pages
stage: deploy
dependencies:
- test_pyrsr
script:
# Create the public directory
- rm -rf public
- mkdir public
- mkdir -p public/doc
- mkdir -p public/coverage
- mkdir -p public/nosetests_reports
# Copy over the docs
- cp -r docs/_build/html/* public/doc/
# Copy over the coverage reports
- cp -r htmlcov/* public/coverage/
# Copy over the nosetests reports
- cp nosetests.* public/nosetests_reports/
# Check if everything is working great
- ls -al public
- ls -al public/doc
- ls -al public/coverage
- ls -al public/nosetests_reports
artifacts:
paths:
- public
expire_in: 30 days
only:
- master
- enhancement/improve_docs
deploy_pypi:
stage: deploy
dependencies:
- test_pyrsr
script:
- source /root/miniconda3/bin/activate
- source activate ci_env
- pip install -U twine
- python setup.py sdist
- twine upload dist/* # requires creds as environment variables
only:
- /^v\d+\.\d+\.\d+([abc]\d*)?$/ # PEP-440 compliant version (tags)
except:
- dev
......@@ -26,6 +26,6 @@ sudo docker exec -it ${gitlab_runner} /bin/bash -c "export RUNNER_EXECUTOR=docke
--registration-token '${token}' \
--run-untagged=true \
--locked=true \
--tag-list pyrsr_client \
--tag-list pyrsr_client \
--description '${runner_name}' \
--docker-image '${tag}' "
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment