-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.gitlab-ci.yml
More file actions
60 lines (55 loc) · 1.71 KB
/
.gitlab-ci.yml
File metadata and controls
60 lines (55 loc) · 1.71 KB
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
stages:
- test
- release
# =============================================================================
# Perform the unit test and build the packages
# =============================================================================
test_python_3_10:
stage: test
tags:
- docker
- x86_64
image: ${CI_DEPENDENCY_PROXY_GROUP_IMAGE_PREFIX}/python:3.10
script:
- pip install -r requirements-dev.txt
- poetry install --with dev -E websrc -E fullasync
- PYTHONPATH="${PYTHONPATH}:.:tests" poetry run pytest --junitxml=report.xml --log-cli-level=DEBUG tests
artifacts: # Collect test results
when: always
paths:
- report.xml
reports:
junit: report.xml
.build-package:
stage: release
tags:
- docker
- x86_64
image: ${CI_DEPENDENCY_PROXY_GROUP_IMAGE_PREFIX}/python:3.10
variables:
VERSION_FORMAT: "{base}.post{distance}.dev+{commit}"
script:
- pip install -r requirements-dev.txt
# Guess the version number (no versioneer needed)
- DST_VERSION=$(dunamai from git --format "${VERSION_FORMAT}")
- echo Write destination version $DST_VERSION
- poetry version "$DST_VERSION"
# Build the project
- poetry build
# Push the package
- poetry config repositories.gitlab-intern ${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/pypi
- poetry config http-basic.gitlab-intern gitlab-ci-token ${CI_JOB_TOKEN}
- poetry publish --repository gitlab-intern
build-package-main:
extends: .build-package
variables:
VERSION_FORMAT: "{base}.post{distance}+{commit}"
only:
- main
- master
build-package-development:
extends: .build-package
variables:
VERSION_FORMAT: "{base}.post{distance}.dev+{commit}"
only:
- development