Skip to content

Commit

Permalink
Sonarcloud with code coverage
Browse files Browse the repository at this point in the history
Signed-off-by: jamshale <jamiehalebc@gmail.com>
  • Loading branch information
jamshale committed May 22, 2024
1 parent d0eb39a commit 6086c50
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 6 deletions.
4 changes: 0 additions & 4 deletions .codecov.yml

This file was deleted.

1 change: 1 addition & 0 deletions .github/workflows/pr-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ jobs:
tests:
name: Tests
uses: ./.github/workflows/tests.yml
secrets: inherit
with:
python-version: "3.9"
os: "ubuntu-latest"
11 changes: 9 additions & 2 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ jobs:
runs-on: ${{ inputs.os }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Python ${{ inputs.python-version }}
uses: actions/setup-python@v5
with:
Expand All @@ -25,13 +27,18 @@ jobs:
- name: Install the project dependencies
run: |
pip install poetry
poetry install -E "askar bbs"
poetry install --all-extras
- name: Tests
run: |
poetry run pytest 2>&1 | tee pytest.log
poetry run pytest --cov --cov-report xml 2>&1 | tee pytest.log
PYTEST_EXIT_CODE=${PIPESTATUS[0]}
if grep -Eq "RuntimeWarning: coroutine .* was never awaited" pytest.log; then
echo "Failure: Detected unawaited coroutine warning in pytest output."
exit 1
fi
exit $PYTEST_EXIT_CODE
- name: SonarCloud Scan
uses: SonarSource/sonarcloud-github-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
8 changes: 8 additions & 0 deletions sonar-project.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
sonar.projectKey=hyperledger_aries-cloudagent-python
sonar.organization=hyperledger

sonar.projectName=aries-cloudagent-python

sonar.python.coverage.reportPaths=test-reports/coverage.xml

sonar.python.version=3.9

0 comments on commit 6086c50

Please sign in to comment.