-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
108 lines (95 loc) · 3.37 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
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
#################################################################
# #
# Copyright (c) 2020-2021 Peter Goss All rights reserved. #
# #
# Copyright (c) 2020-2023 YottaDB LLC and/or its subsidiaries. #
# All rights reserved. #
# #
# This source code contains the intellectual property #
# of its copyright holder(s), and is made available #
# under a license. If you do not know the terms of #
# the license, please stop and do not read further. #
# #
#################################################################
stages:
- formating-checks
- test
.ubuntu:
image: yottadb/yottadb-base:latest-master
before_script:
- apt update
- apt install -y python3-setuptools python3-dev libffi-dev python3-pip pkg-config
- source $(pkg-config --variable=prefix yottadb)/ydb_env_set
- python3 -m pip install pytest-runner
- python3 setup.py install --user
.rocky:
image: yottadb/yottadb-rocky-base:latest-master
before_script:
- yum install -y python3 gcc python3-devel libffi-devel pkg-config
- source $(pkg-config --variable=prefix yottadb)/ydb_env_set
- python3 setup.py install --user
# https://stackoverflow.com/questions/692000/how-do-i-write-standard-error-to-a-file-while-using-tee-with-a-pipe
.test_ubuntu:
script:
- python3 -m pip install --user pytest pytest-order psutil requests
- mkdir artifacts
- python3 -m pytest tests/ -vs 1> artifacts/pytest.out 2> artifacts/pytest.err
artifacts:
paths:
- ./artifacts
when: always
.test_rocky:
script:
- python3 -m pip install --user pytest pytest-order psutil requests
- mkdir artifacts
- python3 -m pytest tests/ -vs 1> artifacts/pytest.out 2> artifacts/pytest.err
artifacts:
paths:
- ./artifacts
when: always
.debug:
script:
# Enable Debug build be uncommenting undef_macros compiler line in setup.py
- sed -i 's/# undef_macros/undef_macros/' setup.py
test_ubuntu:
stage: test
extends:
- .ubuntu
- .test_ubuntu
test_rocky:
stage: test
extends:
- .rocky
- .test_rocky
test_ubuntu_debug:
stage: test
extends:
- .ubuntu
- .debug
- .test_ubuntu
commit-verify:
image: ubuntu:22.04
stage: formating-checks
before_script:
- apt update -qq && apt-get install -y -qq git wget gnupg
script:
# Copy commit gpg key verify script to build directory and execute
- wget https://gitlab.com/YottaDB/DB/YDB/-/raw/master/ci/commit_verify.sh
- chmod +x commit_verify.sh
- chmod +x ./tools/ci/needs_copyright.sh
- ./commit_verify.sh ./tools/ci/needs_copyright.sh https://gitlab.com/YottaDB/Lang/YDBPython
code-format-check:
stage: formating-checks
extends:
- .ubuntu
artifacts:
paths:
- temp_warnings.txt
- clang_tidy_warnings.txt
- sorted_warnings.txt
when: always
script:
- apt update -qq && apt-get install -y -qq git wget gnupg pkg-config clang-format-11 python3-pip clang-tidy-11
- source $(pkg-config --variable=prefix yottadb)/ydb_env_set
- python3 -m pip install black
- LC_ALL=C.UTF-8 bash ./tools/ci/check_code_format.sh