Skip to content

Commit c85bdf8

Browse files
authored
chore: setup codecov (#325)
1 parent 4649afa commit c85bdf8

1 file changed

Lines changed: 12 additions & 22 deletions

File tree

.github/workflows/python-package.yml

Lines changed: 12 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -45,13 +45,15 @@ jobs:
4545
# run ruff
4646
#----------------------------------------------
4747
- name: Linter with ruff
48+
if: matrix.python-version == 3.11
4849
run: |
4950
source .venv/bin/activate
5051
ruff .
5152
#----------------------------------------------
5253
# run black
5354
#----------------------------------------------
5455
- name: Linter with black
56+
if: matrix.python-version == 3.11
5557
run: |
5658
source .venv/bin/activate
5759
black . --check --diff
@@ -61,27 +63,15 @@ jobs:
6163
- name: Test with pytest
6264
run: |
6365
source .venv/bin/activate
64-
pytest --cov-report=xml --junitxml=xunit-results.xml
66+
pytest --cov-report=xml:coverage.xml
6567
coverage xml
66-
- name: Upload artifacts
67-
uses: actions/upload-artifact@v3
68+
- name: Upload coverage to Codecov
69+
uses: codecov/codecov-action@v3
70+
if: matrix.python-version == 3.11
6871
with:
69-
name: test-results
70-
path: |
71-
coverage.xml
72-
xunit-results.xml
73-
- name: SonarCloud Scan
74-
uses: SonarSource/sonarcloud-github-action@master
75-
env:
76-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
77-
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
78-
with:
79-
args: >
80-
-Dsonar.organization=fgmacedo
81-
-Dsonar.projectKey=fgmacedo_python-statemachine
82-
-Dsonar.python.coverage.reportPaths=coverage.xml
83-
-Dsonar.sources=statemachine/
84-
-Dsonar.test.exclusions=tests/**
85-
-Dsonar.tests=tests/
86-
-Dsonar.python.version=3
87-
-Dsonar.verbose=false
72+
directory: .
73+
env_vars: OS,PYTHON
74+
fail_ci_if_error: true
75+
flags: unittests
76+
name: codecov-umbrella
77+
verbose: true

0 commit comments

Comments
 (0)