-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
110 lines (95 loc) · 2.26 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
109
110
workflow:
# The rules below prevent "code-scanning-container" to spawn duplicated pipelines on MR.
rules:
- if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
- if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH'
include:
- project: 'security-guild/code-scanning-container'
file: code_scanning-gitlab-ci.yml
variables:
# -- Common settings
PIP_CACHE_DIR: "$CI_PROJECT_DIR/.cache/pip"
PIP_INDEX_URL: https://repository.engineering.redhat.com/nexus/repository/pypi.org/simple/
REQUESTS_CA_BUNDLE: /etc/pki/tls/cert.pem
# -- Settings for code_scanning
PROJECT_NAME: "stratosphere_starmap-client"
CODE_SCANNING_LANGUAGE: "Python"
CODE_SCANNING_EXCLUSIONS: "tests/**,docs/**"
.common: &common
image: quay.io/redhat-aqe/tox:latest
tags: [docker]
cache:
paths:
- .cache/pip
before_script:
# Trust the IT Root CA.
- curl https://certs.corp.redhat.com/certs/Current-IT-Root-CAs.pem > /etc/pki/ca-trust/source/anchors/Current-IT-Root-CAs.pem
- update-ca-trust
stages:
- linting
- unit-tests
- security
- docs
lint:
<<: *common
stage: linting
script:
- tox -e lint
mypy:
<<: *common
stage: linting
script:
- tox -e mypy
security:
<<: *common
stage: security
script:
- tox -e security
code_scanning:
stage: security
coverage:
<<: *common
coverage: /(?i)total.*? (100(?:\.0+)?\%|[1-9]?\d(?:\.\d+)?\%)$/
stage: unit-tests
script:
- tox -e coverage
- mkdir .coverage-reports
- cp coverage.xml .coverage-reports/
artifacts:
paths:
- .coverage-reports
python3.8:
<<: *common
stage: unit-tests
script:
- tox -e py38
python3.9:
<<: *common
stage: unit-tests
script:
- tox -e py39
python3.10:
<<: *common
stage: unit-tests
script:
- tox -e py310
python3.11:
<<: *common
stage: unit-tests
script:
- tox -e py311
# The stage below will deploy the documentation into GitLab pages whenever the main branch is updated
pages:
<<: *common
stage: docs
script:
- echo "Generating the GitLab pages..."
- tox -e docs
- mkdir public
- cp -rf docs/_build/html/* public/
- echo "The site will be deployed to $CI_PAGES_URL"
artifacts:
paths:
- public
rules:
- if: $CI_COMMIT_REF_NAME == $CI_DEFAULT_BRANCH