From 2e9cb069372b46be8ee162ac810fa5714cccaae9 Mon Sep 17 00:00:00 2001 From: Fernando Macedo Date: Tue, 17 Jan 2023 22:20:07 -0300 Subject: [PATCH] chore: setup codecov --- .github/workflows/python-package.yml | 34 ++++++++++------------------ 1 file changed, 12 insertions(+), 22 deletions(-) diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index 507f5914..1f3f0cd6 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -45,6 +45,7 @@ jobs: # run ruff #---------------------------------------------- - name: Linter with ruff + if: matrix.python-version == 3.11 run: | source .venv/bin/activate ruff . @@ -52,6 +53,7 @@ jobs: # run black #---------------------------------------------- - name: Linter with black + if: matrix.python-version == 3.11 run: | source .venv/bin/activate black . --check --diff @@ -61,27 +63,15 @@ jobs: - name: Test with pytest run: | source .venv/bin/activate - pytest --cov-report=xml --junitxml=xunit-results.xml + pytest --cov-report=xml:coverage.xml coverage xml - - name: Upload artifacts - uses: actions/upload-artifact@v3 + - name: Upload coverage to Codecov + uses: codecov/codecov-action@v3 + if: matrix.python-version == 3.11 with: - name: test-results - path: | - coverage.xml - xunit-results.xml - - name: SonarCloud Scan - uses: SonarSource/sonarcloud-github-action@master - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any - SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} - with: - args: > - -Dsonar.organization=fgmacedo - -Dsonar.projectKey=fgmacedo_python-statemachine - -Dsonar.python.coverage.reportPaths=coverage.xml - -Dsonar.sources=statemachine/ - -Dsonar.test.exclusions=tests/** - -Dsonar.tests=tests/ - -Dsonar.python.version=3 - -Dsonar.verbose=false + directory: . + env_vars: OS,PYTHON + fail_ci_if_error: true + flags: unittests + name: codecov-umbrella + verbose: true