-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
126 lines (112 loc) · 2.89 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
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
services:
- docker:dind
variables:
DOCKER_CERT_PATH: /certs/client
DOCKER_TLS_CERTDIR: "/certs"
DOCKER_TLS_VERIFY: 1
DOCKER_HOST: "tcp://docker:2376"
stages:
- test
- publish
# More info: https://docs.gitlab.com/ee/user/application_security/sast/index.html
sast:
stage: test
variables:
SAST_EXCLUDED_ANALYZERS: brakeman, eslint, flawfinder, gosec, kubesec, nodejs-scan,
phpcs-security-audit, pmd-apex, security-code-scan, semgrep, sobelow, spotbugs
include:
- template: Security/SAST.gitlab-ci.yml
integration-test:
stage: test
image: clickable/clickable-ci
rules:
- if: $CI_MERGE_REQUEST_IID
- if: $CI_COMMIT_TAG
- if: $CI_COMMIT_BRANCH == 'dev'
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
variables:
CLICKABLE_SKIP_DOCKER_CHECKS: 1
script:
- export HOME=`pwd`/home
- mkdir -p $HOME
- pytest ./tests/integration
unit-test:
stage: test
image: clickable/clickable-ci
rules:
- if: $CI_MERGE_REQUEST_IID
- if: $CI_COMMIT_TAG
- if: $CI_COMMIT_BRANCH == 'dev'
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
script:
- pytest --cov=clickable ./tests/unit
lint:
stage: test
image: clickable/clickable-ci
rules:
- if: $CI_MERGE_REQUEST_IID
- if: $CI_COMMIT_TAG
- if: $CI_COMMIT_BRANCH
script:
- flake8
- pylint clickable
build-deb:
stage: publish
image: clickable/build-deb:focal
rules:
- if: $CI_COMMIT_BRANCH == 'dev'
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
artifacts:
expire_in: 1 week
paths:
- ../*.deb
script:
- dpkg-buildpackage
publish-pypi:
stage: publish
image: clickable/clickable-ci
rules:
- if: $CI_COMMIT_TAG
script:
- python3 setup.py sdist bdist_wheel
- python3 -m twine upload dist/*
publish-focal:
stage: publish
image: clickable/build-deb:focal
rules:
- if: $CI_COMMIT_TAG
script:
- ./scripts/setup_gpg_keys.sh
- sed -i "s/) unstable/~focal) focal/g" debian/changelog
- debuild -S
- dput ppa:bhdouglass/clickable ../clickable_*_source.changes
publish-jammy:
stage: publish
image: clickable/build-deb:focal
rules:
- if: $CI_COMMIT_TAG
script:
- ./scripts/setup_gpg_keys.sh
- sed -i "s/) unstable/~jammy) jammy/g" debian/changelog
- debuild -S
- dput ppa:bhdouglass/clickable ../clickable_*_source.changes
publish-mantic:
stage: publish
image: clickable/build-deb:focal
rules:
- if: $CI_COMMIT_TAG
script:
- ./scripts/setup_gpg_keys.sh
- sed -i "s/) unstable/~mantic) mantic/g" debian/changelog
- debuild -S
- dput ppa:bhdouglass/clickable ../clickable_*_source.changes
publish-noble:
stage: publish
image: clickable/build-deb:focal
rules:
- if: $CI_COMMIT_TAG
script:
- ./scripts/setup_gpg_keys.sh
- sed -i "s/) unstable/~noble) noble/g" debian/changelog
- debuild -S
- dput ppa:bhdouglass/clickable ../clickable_*_source.changes