-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbitbucket-pipelines.yml
56 lines (50 loc) · 1.69 KB
/
bitbucket-pipelines.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
# Template python-build
# This template allows you to validate your python code.
# The workflow allows running tests and code linting on the default branch.
image: python:3.8
clone:
depth: full # SonarCloud scanner needs the full history to assign issues properly
definitions:
services:
docker:
memory: 2048
caches:
sonar: ~/.sonar/cache # Caching SonarCloud artifacts will speed up your build
steps:
- step: &build-test-sonarcloud
name: Build, test and analyze on SonarCloud
caches:
- pip
- sonar
script:
- pipe: sonarsource/sonarcloud-scan:1.2.1
- step: &check-quality-gate-sonarcloud
name: Check the Quality Gate on SonarCloud
script:
- pipe: sonarsource/sonarcloud-quality-gate:0.1.4
pipelines:
default:
- parallel:
# - step:
# name: Test
# caches:
# - pip
# script:
# - if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
# - pip install pytest
# - pytest -v tests/* --junitxml=test-reports/report.xml
- step:
name: Lint code
script:
# Enforce style consistency across Python projects https://flake8.pycqa.org/en/latest/manpage.html
- pip install pylint
- pylint ./app/tests/ | tee pylint.txt
- step: *build-test-sonarcloud
#pipelines: # More info here: https://confluence.atlassian.com/bitbucket/configure-bitbucket-pipelines-yml-792298910.html
# branches:
# master:
# - step: *build-test-sonarcloud
# - step: *check-quality-gate-sonarcloud
# pull-requests:
# '**':
# - step: *build-test-sonarcloud