-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.gitlab-ci.yml
More file actions
173 lines (148 loc) · 4.96 KB
/
.gitlab-ci.yml
File metadata and controls
173 lines (148 loc) · 4.96 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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
stages:
- analysis
- test
- build_1
- build_2
- upload
- release
variables:
# v1.24.0-debug
# https://console.cloud.google.com/artifacts/docker/kaniko-project/us/gcr.io/executor/sha256:2562c4fe551399514277ffff7dcca9a3b1628c4ea38cb017d7286dc6ea52f4cd
IMG_KANIKO: "gcr.io/kaniko-project/executor@sha256:2562c4fe551399514277ffff7dcca9a3b1628c4ea38cb017d7286dc6ea52f4cd"
# https://hub.docker.com/layers/bitnamilegacy/kubectl/1.32.4/images/sha256-1f0f5615c70c3570a8ff585f7603626b8daa46dfd905d86c6662139f189522de
IMG_KUBECTL: bitnamilegacy/kubectl:1.32.4
# debug
# https://console.cloud.google.com/artifacts/docker/go-containerregistry/us/gcr.io/crane/sha256:fbdf6d55c5ae90d9ae637b9bd9f10119496fdf18a3b5f9cd3078ae6044161c18
IMG_CRANE: "gcr.io/go-containerregistry/crane@sha256:fbdf6d55c5ae90d9ae637b9bd9f10119496fdf18a3b5f9cd3078ae6044161c18"
IMG_ARCH_LINUX: archlinux:base-20251228.0.475343
# 0.10.12-python3.14-trixie
# https://github.com/astral-sh/uv/pkgs/container/uv/746844545?tag=0.10.12-python3.14-trixie
IMG_PYTHON_UV_3_14: "ghcr.io/astral-sh/uv@sha256:5536c05ce7abeb80bf5424920d64c09da589a0a1ec4552ecf0374a1082830658"
IMG_DOC: ${CONTAINER_REGISTRY_URL}/puuid-doc:${CI_COMMIT_SHORT_SHA}
####################################################################################################
### Analysis Stage
####################################################################################################
ruff:
stage: analysis
image: $IMG_PYTHON_UV_3_14
script:
- uv sync --all-groups --locked
- uv run ruff check src tests
allow_failure: true
mypy:
stage: analysis
image: $IMG_PYTHON_UV_3_14
script:
- uv sync --all-groups --locked
- uv run mypy src tests
allow_failure: true
pyright:
stage: analysis
image: $IMG_PYTHON_UV_3_14
script:
- uv sync --all-groups --locked
- uv run basedpyright src tests
allow_failure: true
isort:
stage: analysis
image: $IMG_PYTHON_UV_3_14
script:
- uv sync --all-groups --locked
- uv run isort --check-only src tests
allow_failure: false
black:
stage: analysis
image: $IMG_PYTHON_UV_3_14
script:
- uv sync --all-groups --locked
- uv run black --check src tests
allow_failure: false
####################################################################################################
### Test Stage
####################################################################################################
pytest_3_14:
stage: test
image: $IMG_PYTHON_UV_3_14
script:
- uv sync --all-groups --locked
- uv run pytest --cov=src/puuid/ tests
coverage: '/(?i)total.*? (100(?:\.0+)?\%|[1-9]?\d(?:\.\d+)?\%)$/'
artifacts:
paths:
- .coverage
pydoctest_3_14:
stage: test
image: $IMG_PYTHON_UV_3_14
script:
- uv sync --all-groups --locked
- uv run pytest --markdown-docs --markdown-docs-syntax=superfences docs/pages
####################################################################################################
### Documentation Stage
####################################################################################################
doc_site:
stage: build_1
image: $IMG_PYTHON_UV_3_14
script:
- uv sync --all-groups --locked
- uv run coverage html
- uv run mkdocs build -f docs/mkdocs.yml
artifacts:
paths:
- docs/site
pkg_build:
stage: build_1
image: $IMG_PYTHON_UV_3_14
script:
- uv build
artifacts:
paths:
- dist
####################################################################################################
#### Stage - build
####################################################################################################
doc_image:
stage: build_2
image:
name: $IMG_KANIKO
entrypoint: [""]
script:
- >
/kaniko/executor --context ./docs --destination "${IMG_DOC}" --tarPath app_image.tar
--no-push --force
artifacts:
paths:
- app_image.tar
####################################################################################################
#### Stage - upload
####################################################################################################
doc_upload:
stage: upload
image:
name: ${IMG_CRANE}
entrypoint: [""]
script:
- crane auth login -u "${CONTAINER_REGISTRY_USER}" -p "${CONTAINER_REGISTRY_PW}" "${CONTAINER_REGISTRY_URL}"
- crane push app_image.tar ${IMG_DOC}
rules:
- if: $CI_COMMIT_REF_NAME == "main"
####################################################################################################
### Release Stage
####################################################################################################
doc_release:
stage: release
image:
name: ${IMG_KUBECTL}
entrypoint: [""]
script:
- source ci/setup_kubectl.sh
- envsubst < docs/k8s.yaml | kubectl apply -f -
rules:
- if: $CI_COMMIT_REF_NAME == "main"
pkg_release:
stage: release
image:
name: ${IMG_PYTHON_UV_3_14}
script:
- uv publish
rules:
- if: '$CI_COMMIT_TAG =~ /^\d+.\d+.\d+/'