2021-12-06 19:12:30 +00:00
|
|
|
kind: pipeline
|
|
|
|
type: exec
|
2021-12-06 19:11:04 +00:00
|
|
|
name: default
|
2021-12-06 19:12:30 +00:00
|
|
|
|
2021-12-06 19:11:04 +00:00
|
|
|
steps:
|
2022-09-16 07:31:51 +00:00
|
|
|
- name: Run Tests and Generate Coverage Report
|
2021-12-06 19:11:04 +00:00
|
|
|
commands:
|
2023-06-23 09:57:39 +00:00
|
|
|
- kill $(ps aux | grep 'redis-server 127.0.0.1:6389' | awk '{print $2}') || true
|
2022-12-27 04:10:14 +00:00
|
|
|
- redis-server --bind 127.0.0.1 --port 6389 >/dev/null &
|
2023-07-17 14:39:34 +00:00
|
|
|
# We do not care about persistance on CI
|
2023-07-17 16:55:16 +00:00
|
|
|
- sleep 10
|
2023-07-17 16:45:00 +00:00
|
|
|
- redis-cli -h 127.0.0.1 -p 6389 config set stop-writes-on-bgsave-error no
|
2022-01-10 20:35:00 +00:00
|
|
|
- coverage run -m pytest -q
|
|
|
|
- coverage xml
|
2022-09-16 07:31:51 +00:00
|
|
|
- sonar-scanner -Dsonar.projectKey=SelfPrivacy-REST-API -Dsonar.sources=. -Dsonar.host.url=http://analyzer.lan:9000 -Dsonar.login="$SONARQUBE_TOKEN"
|
|
|
|
environment:
|
|
|
|
SONARQUBE_TOKEN:
|
|
|
|
from_secret: SONARQUBE_TOKEN
|
2022-12-27 04:10:14 +00:00
|
|
|
USE_REDIS_PORT: 6389
|
|
|
|
|
2022-09-16 07:31:51 +00:00
|
|
|
|
|
|
|
- name: Run Bandit Checks
|
2022-01-10 20:35:00 +00:00
|
|
|
commands:
|
|
|
|
- bandit -ll -r selfprivacy_api
|
2022-09-16 07:31:51 +00:00
|
|
|
|
|
|
|
- name: Run Code Formatting Checks
|
2022-01-10 20:35:00 +00:00
|
|
|
commands:
|
|
|
|
- black --check .
|
2022-09-16 07:31:51 +00:00
|
|
|
|
|
|
|
node:
|
|
|
|
server: builder
|
2023-06-23 10:02:52 +00:00
|
|
|
|
|
|
|
trigger:
|
|
|
|
event:
|
|
|
|
- push
|