File tree 7 files changed +99
-19
lines changed 7 files changed +99
-19
lines changed Original file line number Diff line number Diff line change 1
1
[run]
2
2
branch = True
3
+ relative_files = True
3
4
source = src/
4
5
omit =
5
6
.coveragerc
Original file line number Diff line number Diff line change
1
+ name : Python CI Coverage
2
+
3
+ on :
4
+ push :
5
+ branches : [ "main", "develop", "feature/*" ]
6
+ pull_request :
7
+ branches : [ "main" ]
8
+
9
+ env :
10
+ LOG_LEVEL : INFO
11
+
12
+ jobs :
13
+
14
+ build :
15
+ name : " Run CI"
16
+ strategy :
17
+ fail-fast : false
18
+ matrix :
19
+ os : ["ubuntu-latest"]
20
+ python : ['3.12']
21
+ runs-on : ${{ matrix.os }}
22
+ steps :
23
+ - uses : actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4
24
+ with :
25
+ fetch-depth : 0 # Shallow clones should be disabled for a better relevancy of analysis
26
+
27
+ - name : Setup Python
28
+ uses : actions/setup-python@master
29
+ with :
30
+ python-version : ${{ matrix.python }}
31
+
32
+ - name : Install
33
+ run : |
34
+ pip3 install -r requirements.txt
35
+
36
+ - name : Test an coverage collect
37
+ run : |
38
+ python3 -m coverage run -m pytest --verbose -o log_cli=true --log-cli-level=INFO src/
39
+
40
+ - name : Coverage Report
41
+ run : |
42
+ python3 -m coverage report
43
+
44
+ - name : Coverage lcov
45
+ run : |
46
+ python3 -m coverage lcov -o coverage/lcov.info
47
+
48
+ - name : Upload coverage reports to Codecov with GitHub Action
49
+ uses : codecov/codecov-action@v4
50
+ with :
51
+ token : ${{ secrets.CODECOV_TOKEN }} # required
52
+ verbose : true # optional (default = false)
53
+
54
+ - name : Coverage XML
55
+ run : |
56
+ python3 -m coverage xml
57
+
58
+ - name : SonarCloud Scan
59
+ uses : SonarSource/sonarcloud-github-action@master
60
+ env :
61
+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
62
+ SONAR_TOKEN : ${{ secrets.SONAR_TOKEN }}
Original file line number Diff line number Diff line change 1
- name : Python
1
+ name : Python CI Tests
2
2
3
3
on :
4
4
push :
58
58
- name : Coverage
59
59
run : |
60
60
coverage report
61
-
62
- - name : Upload coverage reports to Codecov with GitHub Action
63
- uses : codecov/codecov-action@v4
64
- with :
65
- token : ${{ secrets.CODECOV_TOKEN }} # required
66
- verbose : true # optional (default = false)
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 10
10
![ GitHub language count] ( https://img.shields.io/github/languages/count/sir-gon/algorithm-exercises-py )
11
11
![ GitHub top language] ( https://img.shields.io/github/languages/top/sir-gon/algorithm-exercises-py )
12
12
13
+ [ ![ Quality Gate Status] ( https://sonarcloud.io/api/project_badges/measure?project=sir-gon_algorithm-exercises-py&metric=alert_status )] ( https://sonarcloud.io/summary/new_code?id=sir-gon_algorithm-exercises-py )
14
+ [ ![ Coverage] ( https://sonarcloud.io/api/project_badges/measure?project=sir-gon_algorithm-exercises-py&metric=coverage )] ( https://sonarcloud.io/summary/new_code?id=sir-gon_algorithm-exercises-py )
15
+ [ ![ Bugs] ( https://sonarcloud.io/api/project_badges/measure?project=sir-gon_algorithm-exercises-py&metric=bugs )] ( https://sonarcloud.io/summary/new_code?id=sir-gon_algorithm-exercises-py )
16
+ [ ![ Code Smells] ( https://sonarcloud.io/api/project_badges/measure?project=sir-gon_algorithm-exercises-py&metric=code_smells )] ( https://sonarcloud.io/summary/new_code?id=sir-gon_algorithm-exercises-py )
17
+ [ ![ Duplicated Lines (%)] ( https://sonarcloud.io/api/project_badges/measure?project=sir-gon_algorithm-exercises-py&metric=duplicated_lines_density )] ( https://sonarcloud.io/summary/new_code?id=sir-gon_algorithm-exercises-py )
18
+
13
19
## What is this?
14
20
15
21
[ Project Euler] ( https://algorithm-exercises.net/ ) provide some algorithms and
Original file line number Diff line number Diff line change
1
+ sonar.projectKey =sir-gon_algorithm-exercises-py
2
+ sonar.organization =sir-gon
3
+
4
+ # This is the name and version displayed in the SonarCloud UI.
5
+ # sonar.projectName=algorithm-exercises-py
6
+ # sonar.projectVersion=1.0
7
+
8
+
9
+ # Path is relative to the sonar-project.properties file. Replace "\" by "/" on Windows.
10
+ # sonar.sources=src
11
+ sonar.exclusions =**/*test.py,**/__init__.py
12
+
13
+ # Encoding of the source code. Default is default system encoding
14
+ # sonar.sourceEncoding=UTF-8
15
+
16
+ sonar.python.version =3.12
17
+
18
+ # Coverage
19
+ sonar.python.coverage.reportPaths =coverage.xml
20
+
21
+ # Ignore
22
+ sonar.issue.ignore.multicriteria =e1
23
+
24
+ # python:S6792 Use the "type" parameter syntax to declare this generic class.
25
+ sonar.issue.ignore.multicriteria.e1.ruleKey =python:S6792
26
+ sonar.issue.ignore.multicriteria.e1.resourceKey =**/*.py
Original file line number Diff line number Diff line change 4
4
T = TypeVar ("T" )
5
5
6
6
7
+ # Recommended way to define Generics in python >= 3.12:
8
+ # https://peps.python.org/pep-0695/
9
+ # https://docs.python.org/3.12/whatsnew/3.12.html#pep-695-type-parameter-syntax
7
10
class BinaryNode (Generic [T ]):
8
11
def __init__ (
9
12
self ,
You can’t perform that action at this time.
0 commit comments