-
Notifications
You must be signed in to change notification settings - Fork 34
/
Copy path.gitlab-ci.yml
73 lines (68 loc) · 1.53 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
image: public.ecr.aws/docker/library/python:3.8
stages:
- test
- profile
- pypi
run_tests:
stage: test
resource_group: ssh-helper-tests
script:
- bash run_tests.sh
coverage: '/(?i)total.*? (100(?:\.0+)?\%|[1-9]?\d(?:\.\d+)?\%)$/'
artifacts:
when: always
reports:
junit: tests/pytest_report.xml
coverage_report:
coverage_format: cobertura
path: tests/coverage.xml
paths:
- dist/
- .pypirc
- src_diff/
- pip_freeze/
- tests/pytest_report.xml
- tests/pytest_report.html
- tests/htmlcov/
- tests/coverage.xml
- tests/.coverage
- tests/.pymon
- tests/output/
- bandit.txt
- flake8.txt
profile_tests:
stage: profile
when: manual
dependencies:
- run_tests
resource_group: ssh-helper-tests
rules:
- if: $SKIP_PROFILE_TESTS == "false"
script:
- bash profile_tests.sh
artifacts:
when: always
paths:
- tests/prof/
publish_testpypi:
stage: pypi
when: manual
dependencies:
- run_tests
script:
- ls dist/
- sed -e "s~__password__~$PyPI_Test_API_token~" .pypirc > $HOME/.pypirc
- pip install -U twine
- python -m twine upload --verbose --repository testpypi dist/*
publish_prodpypi:
stage: pypi
when: manual
dependencies:
- run_tests
rules:
- if: $PyPI_API_token != null
script:
- ls dist/
- sed -e "s~__password__~$PyPI_API_token~" .pypirc > $HOME/.pypirc
- pip install -U twine
- python -m twine upload --verbose --repository pypi dist/*