forked from CS-SI/eodag
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
79 lines (74 loc) · 2.59 KB
/
.gitlab-ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
image: python:3.6
stages:
- build
- test
- deploy
lint:
stage: build
script:
- python -m pip install flake8
- flake8 --max-line-length=120 .
build-doc:
stage: test
script:
- apt-get update
- apt-get install -y make pandoc
- python -m pip install --upgrade pip
- python -m pip install -r requirements-docs.txt
- (cd docs && /usr/bin/make html)
rules:
- if: $CI_COMMIT_BRANCH == 'master' # Execute jobs when a new commit is pushed to master branch
- if: $CI_MERGE_REQUEST_ID # Execute jobs in merge request context
py36:unit-tests:
stage: test
script:
- python -m pip install --upgrade pip
- python -m pip install -r requirements-dev.txt
- mkdir -p test-reports
- |
nosetests -v --cover-package=eodag\
--with-xunit --xunit-file test-reports/eodag_test_report_py36.xml\
--with-coverage --cover-xml --cover-xml-file test-reports/eodag_test_coverage_report_py36.xml\
--with-doctest\
--cover-erase\
--cover-inclusive\
--ignore-files=test_end_to_end.py\
eodag tests
artifacts:
when: always
reports:
junit: test-reports/eodag_test_report_py36.xml
cobertura: test-reports/eodag_test_coverage_report_py36.xml
rules:
- if: $CI_COMMIT_BRANCH == 'master' # Execute jobs when a new commit is pushed to master branch
- if: $CI_MERGE_REQUEST_ID # Execute jobs in merge request context
pypi:deploy:
stage: deploy
script:
# Build and Deploy to PyPI
# Install sphinx to have rst2html.py utility available
- python -m pip install sphinx twine
- |
if [ "$(./get_pypi_latest_version.sh)" != "$(python setup.py --version)" ]
then
# Check that the long description is ready to be published on PyPI without errors
python setup.py --long-description | rst2html.py > /dev/null 2>error.log
if [ ! "$(cat error.log)" ]
then
# Build the distribution
python setup.py sdist bdist_wheel
TWINE_REPOSITORY_URL=$TWINE_REPOSITORY_URL TWINE_USERNAME=$TWINE_USERNAME TWINE_PASSWORD=$TWINE_PASSWORD \
twine upload dist/*
else
echo "Long description is incompatible with PyPI reST renderer. Check README.rst"
cat error.log
exit 1
fi
else
echo "Current version is the latest version uploaded to PyPI"
exit 1
fi
rules:
- if: '$CI_PIPELINE_SOURCE == "schedule"'
when: never
- if: '$CI_COMMIT_TAG =~ /^v\d+\.\d+.*/'