Skip to content

Commit 30e384f

Browse files
authored
Merge branch 'main' into josh/remove-legacy-voice-job-modes
2 parents 4e25a81 + aa576f7 commit 30e384f

4 files changed

Lines changed: 81 additions & 4 deletions

File tree

‎.github/workflows/ci.yml‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,5 @@ jobs:
2020

2121
test:
2222
uses: ./.github/workflows/test.yml
23+
secrets:
24+
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}

‎.github/workflows/test.yml‎

Lines changed: 48 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
name: Test
22

33
on:
4-
workflow_call
4+
workflow_call:
5+
secrets:
6+
SONAR_TOKEN:
7+
required: false
58

69
jobs:
710
test:
@@ -31,7 +34,51 @@ jobs:
3134
run: uv sync --all-extras
3235

3336
- name: Run tests
37+
if: "!(matrix.os == 'ubuntu-latest' && matrix.python-version == '3.13')"
3438
run: uv run pytest
3539

40+
- name: Run tests with coverage
41+
if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.13'
42+
run: uv run pytest --cov-report=xml --cov-report=html --tb=short
43+
44+
- name: Upload coverage HTML report
45+
if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.13' && always()
46+
uses: actions/upload-artifact@v4
47+
with:
48+
name: coverage-html-report
49+
path: htmlcov/
50+
retention-days: 30
51+
52+
- name: Upload coverage XML report
53+
if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.13' && always()
54+
uses: actions/upload-artifact@v4
55+
with:
56+
name: coverage-xml-report
57+
path: coverage.xml
58+
retention-days: 30
59+
3660
continue-on-error: true
3761

62+
sonarcloud:
63+
name: SonarCloud
64+
needs: test
65+
runs-on: ubuntu-latest
66+
if: always() && needs.test.result != 'failure'
67+
permissions:
68+
contents: read
69+
steps:
70+
- name: Checkout
71+
uses: actions/checkout@v4
72+
with:
73+
fetch-depth: 0
74+
75+
- name: Download coverage
76+
uses: actions/download-artifact@v4
77+
continue-on-error: true
78+
with:
79+
name: coverage-xml-report
80+
81+
- name: SonarCloud Scan
82+
uses: SonarSource/sonarqube-scan-action@2f77a1ec69fb1d595b06f35ab27e97605bdef703 # v5
83+
env:
84+
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}

‎pyproject.toml‎

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -95,11 +95,26 @@ addopts = "-ra -q --cov=src/uipath --cov-report=term-missing"
9595
asyncio_default_fixture_loop_scope = "function"
9696
asyncio_mode = "auto"
9797

98+
[tool.coverage.run]
99+
source = ["src/uipath"]
100+
relative_files = true
101+
omit = [
102+
"*/tests/*",
103+
"*/__pycache__/*",
104+
"*/site-packages/*",
105+
"*/conftest.py",
106+
]
107+
98108
[tool.coverage.report]
99109
show_missing = true
100-
101-
[tool.coverage.run]
102-
source = ["src"]
110+
precision = 2
111+
exclude_lines = [
112+
"pragma: no cover",
113+
"def __repr__",
114+
"raise NotImplementedError",
115+
"if TYPE_CHECKING:",
116+
"@(abc\\.)?abstractmethod",
117+
]
103118

104119
[[tool.uv.index]]
105120
name = "testpypi"

‎sonar-project.properties‎

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
sonar.projectKey=UiPath_uipath-runtime-python
2+
sonar.organization=ui
3+
sonar.host.url=https://sonarcloud.io
4+
5+
sonar.sources=src/uipath
6+
sonar.tests=tests
7+
8+
sonar.python.version=3.11,3.12,3.13
9+
sonar.python.coverage.reportPaths=coverage.xml
10+
11+
sonar.exclusions=**/samples/**,**/testcases/**
12+
13+
sonar.sourceEncoding=UTF-8

0 commit comments

Comments
 (0)