-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.gitlab-ci.yml
More file actions
128 lines (112 loc) · 2.44 KB
/
Copy path.gitlab-ci.yml
File metadata and controls
128 lines (112 loc) · 2.44 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
stages:
- build
- check
- docs
- test
- check_coverage
- deploy_coverage
- deploy_docs
variables:
HATCH_DATA_DIR: ".hatch"
before_script:
- bash ./scripts/pyproject_ssh_to_https.sh
- uv venv --seed --python 3.11
- source .venv/bin/activate
- uv sync --all-groups
.zenith:
tags: [ubuntu, zenith]
build-job:
extends: [.zenith]
stage: build
script:
- uv run python -c "import chathpc.app; print(chathpc.app.__doc__)"
check_format-job:
extends: [.zenith]
stage: check
needs: []
script:
- (uv run hatch fmt | tee fmt.out && echo "lint_errors 0" > metrics.txt) || (cat fmt.out | grep -e 'Found .* errors' | sed 's/Found \(.*\) errors.*/lint_errors \1/' > metrics.txt)
- cat metrics.txt
- grep -q "lint_errors 0" metrics.txt
artifacts:
paths:
- fmt.out
- metrics.txt
reports:
metrics: metrics.txt
allow_failure:
exit_codes:
- 1
check_type-job:
extends: [.zenith]
stage: check
needs: []
script:
- uv run --all-groups ty check
allow_failure:
exit_codes:
- 1
docs-job:
tags: [devdocs]
stage: docs
needs: []
script:
- uv run hatch run docs:build
artifacts:
paths:
- site
test-job:
extends: [.zenith]
stage: test
needs: [build-job]
script:
- uv run hatch run test
test-scripts:
extends: [.zenith]
stage: test
script:
- scripts/test_commands.sh
coverage-job:
extends: [.zenith]
stage: check_coverage
needs: [build-job]
script:
- uv run hatch run cov-html
coverage: '/(?i)total.*? (100(?:\.0+)?\%|[1-9]?\d(?:\.\d+)?\%)$/'
artifacts:
paths:
- coverage_html_report
reports:
coverage_report:
coverage_format: cobertura
path: coverage.xml
.deploy_coverage_common:
tags: [devdocs]
stage: deploy_coverage
needs: [coverage-job]
script:
- rsync -a --delete coverage_html_report/ ~/www/ChatHPC/ChatHPC-app/coverage
deploy_coverage-job:
extends: .deploy_coverage_common
only:
- main@ChatHPC/ChatHPC-app
deploy_coverage_manual-job:
extends: .deploy_coverage_common
when: manual
only:
- branches@ChatHPC/ChatHPC-app
.deploy_docs_common:
tags: [devdocs]
stage: deploy_docs
needs: [docs-job]
script:
- rsync -a --delete site/ ~/www/ChatHPC/ChatHPC-app
deploy_docs-job:
extends: .deploy_docs_common
only:
- main@ChatHPC/ChatHPC-app
deploy_docs_manual-job:
extends: .deploy_docs_common
when: manual
only:
- branches@ChatHPC/ChatHPC-app