diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index eb4c73e3..beb9ee7f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -26,8 +26,20 @@ jobs: - name: Install dispatcherd run: pip install -e .[pg_notify,metrics] - run: make postgres - - run: pip install pytest pytest-asyncio httpx - - run: pytest tests/unit tests/integration -vv -s + - run: pip install -r requirements_dev.txt + - run: pytest tests/unit tests/integration --cov=. --cov-report=xml:coverage.xml --cov-report=html --cov-report=json -vv -s + + - name: SonarCloud Scan + uses: SonarSource/sonarqube-scan-action@master + if: github.event_name == 'pull_request' + env: + SONAR_TOKEN: ${{ secrets.CICD_ORG_SONAR_TOKEN_CICD_BOT }} + with: + args: > + -Dsonar.scm.revision=${{ github.event.workflow_run.head_sha }} + -Dsonar.pullrequest.key=${{ env.PR_NUMBER }} + -Dsonar.pullrequest.branch=${{ env.PR_HEAD }} + -Dsonar.pullrequest.base=${{ env.PR_BASE }} black: name: Run black diff --git a/requirements_dev.txt b/requirements_dev.txt index c4916284..96ab8aab 100644 --- a/requirements_dev.txt +++ b/requirements_dev.txt @@ -1,3 +1,5 @@ pytest pytest-asyncio -pytest-benchmark \ No newline at end of file +pytest-benchmark # for benchmark tests +pytest-cov # for SonarCloud +httpx # used for the metrics server test