-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgitlab-ci-py3.yml
60 lines (45 loc) · 1.38 KB
/
gitlab-ci-py3.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
include:
- https://gitlab.com/GreyRook/cde/gitlab-ci-templates/raw/eea13b881d15abb97e2e1aac1d67f6f36fecf785/gitlab-ci-base.yml
image: 'greyrook/cde-dev-py37:a355037c12bd7236957a9ab2e2519ada272aac50'
before_script:
- pipenv --python `which python3`
# pipenv and pip 18.1 are not compatible:
# avoid https://github.com/pypa/pipenv/issues/2924
- pipenv run pip install pip==18.0
- pipenv install --dev
- pipenv run pip install -e .
# ensure project has follows basic patterns to avoid
# less readble error messages later
test-project:
stage: test-project
before_script: []
script:
# ensure default files are available
- ls Pipfile Pipfile.lock setup.py
- grep "pytest " Pipfile
- grep pytest-cov Pipfile
- grep mypy Pipfile
- grep pylint Pipfile
- '[ -d "tests" ]'
- '[ -d "$PYTHON_MODULE" ]'
- '[ "$CI_REGISTRY_IMAGE" == "" ] || [ -f Dockerfile ]'
.test_template: &test_def
script:
- pipenv run py.test --cov ${PYTHON_MODULE} --cov tests --cov-report=html --cov-report=term tests
pytest-python3.6:
<<: *test_def
image: 'greyrook/cde-dev-py36:6e1eef7dc9269d32d1e3b0c389050e65f36111bc'
except:
variables:
- $NO_PYTHON_36_SUPPORT == "1"
pytest-python3.7:
<<: *test_def
coverage: '/\d+\%\s*$/'
artifacts:
name: "coverage"
paths:
- htmlcov/
linting:
stage: test
script:
- pipenv run create-python-app test