forked from CirQuS-UTS/QuanGuru
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
85 lines (78 loc) · 2.18 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
before_script:
- python3 --version
stages:
- Static Analysis
- UnitTest:Core
- UnitTest:Rest
- Integration Test
mypy:
stage: Static Analysis
tags:
- qsimulations
allow_failure: false
script:
- python3 -m mypy
flake8:
stage: Static Analysis
tags:
- qsimulations
allow_failure: true
script:
- python3 -m flake8 quanguru
pylint:
stage: Static Analysis
tags:
- qsimulations
allow_failure: false
script:
- mkdir ./pylint
- python3 -m pylint --rcfile=.pylintrc --output-format=text quanguru/*.py | tee pylint.txt || pylint-exit $?
- score=$(sed -n 's/^Your code has been rated at \([-0-9.]*\)\/.*/\1/p' pylint.txt)
- echo "Pylint score was $score"
- python3 -m anybadge --value=$score --file=pylint/pylint.svg pylint
artifacts:
paths:
- ./pylint/
when: always
core_test:
stage: UnitTest:Core
tags:
- qsimulations
allow_failure: false
script:
- python3 -m pytest --cov=quanguru tests/QuantumToolboxCore/test_linearAlgebra.py
- python3 -m pytest --cov=quanguru --cov-append tests/QuantumToolboxCore/test_states.py
- python3 -m pytest --cov=quanguru --cov-append tests/QuantumToolboxCore/test_operators.py
- python3 -m coverage report
artifacts:
paths:
- .coverage
unit_test:
stage: UnitTest:Rest
tags:
- qsimulations
allow_failure: false
dependencies:
- "core_test"
script:
- python3 -m coverage report
- python3 -m pytest --cov=quanguru --cov-append --ignore=tests/QuantumToolboxCore -k 'not Core and not Integration'
- python3 -m coverage report
artifacts:
paths:
- .coverage
integration_test:
stage: Integration Test
tags:
- qsimulations
allow_failure: false
dependencies:
- "unit_test"
script:
- python3 -m coverage report
- python3 -m pytest --cov=quanguru --cov-append --ignore=tests/QuantumToolboxCore -k 'QuantumToolboxIntegration or Integration'
- python3 -m coverage xml
- python3 -m coverage report
artifacts:
reports:
cobertura: coverage.xml