From a26d1b15a2e1abdfc2eed8e0bbca3149b86f9708 Mon Sep 17 00:00:00 2001 From: Pere Miquel Brull Date: Wed, 25 May 2022 14:40:07 +0200 Subject: [PATCH] Use GA for sonar (#5142) --- .github/workflows/py-tests-3_9.yml | 26 ++++---------------------- ingestion/setup.cfg | 6 +++++- 2 files changed, 9 insertions(+), 23 deletions(-) diff --git a/.github/workflows/py-tests-3_9.yml b/.github/workflows/py-tests-3_9.yml index bdaa0fbe003..af4e7cd14b2 100644 --- a/.github/workflows/py-tests-3_9.yml +++ b/.github/workflows/py-tests-3_9.yml @@ -68,28 +68,10 @@ jobs: source env/bin/activate make coverage - - name: Run PR Sonar - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - if: ${{ github.event_name == 'pull_request_target' }} - run: | - git fetch --no-tags https://github.com/open-metadata/OpenMetadata.git +refs/heads/main:refs/remotes/origin/main - - # Add PR analysis information - echo "\nsonar.pullrequest.key=${{ github.event.pull_request.number }}" >> ingestion/sonar-project.properties - echo "sonar.pullrequest.branch=${{ github.head_ref }}" >> ingestion/sonar-project.properties - echo "sonar.pullrequest.base=main" >> ingestion/sonar-project.properties - echo "sonar.pullrequest.github.repository=OpenMetadata" >> ingestion/sonar-project.properties - echo "sonar.scm.revision=${{ github.event.pull_request.head.sha }}" >> ingestion/sonar-project.properties - echo "sonar.pullrequest.provider=github" >> ingestion/sonar-project.properties - - # Validate new properties - cat ingestion/sonar-project.properties - - make token=${{ secrets.INGESTION_SONAR_SECRET }} sonar_ingestion - - name: Run Sonar + uses: sonarsource/sonarcloud-github-action@master env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - if: ${{ github.event_name == 'push' }} - run: make token=${{ secrets.INGESTION_SONAR_SECRET }} sonar_ingestion + SONAR_TOKEN: ${{ secrets.INGESTION_SONAR_SECRET }} + with: + projectBaseDir: ingestion diff --git a/ingestion/setup.cfg b/ingestion/setup.cfg index ca280fe1780..499c89a6d12 100644 --- a/ingestion/setup.cfg +++ b/ingestion/setup.cfg @@ -45,4 +45,8 @@ package_dir = [options.packages.find] where = src -include = * \ No newline at end of file +include = * + +[coverage:run] +relative_files = True +branch = True