Repository navigation
Expand file tree
/
Copy path.gitlab-ci.yml
More file actions
82 lines (65 loc) · 1.63 KB
/
Copy path.gitlab-ci.yml
File metadata and controls
82 lines (65 loc) · 1.63 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
# SPDX-FileCopyrightText: Copyright 2024 Siemens AG
#
# SPDX-License-Identifier: Apache-2.0
image: python:3.11.2
variables:
http_proxy: "$CODE_PROXY"
https_proxy: "$CODE_PROXY"
no_proxy: "$CODE_NO_PROXY"
before_script:
- pip install uv
- uv sync
- uv sync --all-extras
stages:
- Unit tests
- Code style
- Static analysis
# Check code style, formatting, import sort order, etc.
basics:
stage: Code style
script:
- ruff check
tags:
- LINUX-DOCKER
# Check for license headers in each file
license-check:
stage: Code style
script:
- reuse lint
tags:
- LINUX-DOCKER
# Check Robot Framework code style
robot-framework:
stage: Code style
before_script:
- pip install robotframework-robocop==5.4.0
script:
- robocop --report rules_by_error_type
allow_failure: true
tags:
- LINUX-DOCKER
# A more thorough analysis of the code
pylint:
stage: Static analysis
script:
- pylint --fail-under=9.38 resources
tags:
- LINUX-DOCKER
unit-tests:
stage: Unit tests
script:
- PYTHONPATH=./resources python -m unittest discover -s unit_tests
tags:
- LINUX-DOCKER
pyright:
stage: Static analysis
before_script:
- pip install pyright==1.1.385
script:
# update 73 after fixing the current issues; for now we just try to make
# sure we won't be adding new ones
- export ERRORS=$(PYTHONPATH=./resources pyright ./resources | tail -n 1 | grep -o '^[0-9]*')
- '[ -z "$ERRORS" ] && ERRORS=0' # Set ERRORS to 0 if it is empty
- '[ "$ERRORS" -lt 85 ] 2>/dev/null && echo "Success." || (echo "Failure. Error count:" && exit 1)'
tags:
- LINUX-DOCKER