-
Notifications
You must be signed in to change notification settings - Fork 1
/
.gitlab-ci.yml
36 lines (34 loc) · 1.08 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
pre-commit:
image: python:3.11
script:
- pip install pre-commit
- pre-commit install
- pre-commit run --all
test:
stage: test
image: python:3.11
script:
- pip install -e .[test]
- pytest -v --cov=peak_performance --cov-report term-missing peak_performance
# Make a wheel and check if it's OK to publish
- python setup.py bdist_wheel
- twine check dist/*
coverage: '/(?i)total.*? (100(?:\.0+)?\%|[1-9]?\d(?:\.\d+)?\%)$/'
release:
needs: ["test"]
image: python:3.11
script:
- pip install twine wheel
- python setup.py bdist_wheel && cp dist/*.whl .
# Upload to the PyPI registry of this project.
# Note: The "Packages" feature must be enabled in the project settings!
- TWINE_PASSWORD=${CI_JOB_TOKEN} TWINE_USERNAME=gitlab-ci-token python -m twine upload --verbose --repository-url ${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/pypi dist/*
artifacts:
paths:
- ./*.whl
expire_in: 30 yrs
only:
# only run on refs that are named like v1.2 or v1.2.3
- /^v(\d+\.)?(\d+\.)?(\*|\d+)$/
except:
- branches