From cb96ae71a91962fcf2d2a9b0d4c7126dff86dc36 Mon Sep 17 00:00:00 2001 From: Chris Butler Date: Thu, 7 Oct 2021 17:35:27 +1100 Subject: [PATCH 1/6] chore: replace codecov Signed-off-by: Chris Butler --- .github/workflows/python-test.yml | 11 ++++++----- README.md | 2 +- setup.cfg | 1 + 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/.github/workflows/python-test.yml b/.github/workflows/python-test.yml index eb77ad005..10627b895 100644 --- a/.github/workflows/python-test.yml +++ b/.github/workflows/python-test.yml @@ -130,10 +130,11 @@ jobs: if: ${{ matrix.os == 'ubuntu-latest' && matrix.python-version == '3.7' }} run: | make test-cov - - name: Push code-cov + - name: Run coveralls if: ${{ matrix.os == 'ubuntu-latest' && matrix.python-version == '3.7' }} - uses: codecov/codecov-action@v1 - with: - token: ${{ secrets.CODECOV_TOKEN }} - file: ./coverage.xml + env: + GITHUB_TOKEN: ${{ secrets.ADMIN_PAT }} + run: | + coveralls --service=github + \ No newline at end of file diff --git a/README.md b/README.md index e8a0e5482..49872383d 100644 --- a/README.md +++ b/README.md @@ -102,7 +102,7 @@ Consult [contributors](https://github.com/IBM/compliance-trestle/graphs/contribu ``` [coverage]: https://codecov.io/gh/IBM/compliance-trestle -[coverage-badge]: https://codecov.io/gh/IBM/compliance-trestle/branch/develop/graph/badge.svg?token=1AUXDAF3OB +[coverage-badge]: https://img.shields.io/coveralls/github/IBM/compliance-trestle [platform-badge]: https://img.shields.io/badge/platform-osx%20%7C%20linux-orange.svg [pre-commit]: https://github.com/pre-commit/pre-commit [pre-commit-badge]: https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit&logoColor=white diff --git a/setup.cfg b/setup.cfg index 2c66a8af8..f272714a6 100644 --- a/setup.cfg +++ b/setup.cfg @@ -75,6 +75,7 @@ dev = livereload ## Constrain system pylint + coveralls From edae60cc3e5d23a3a578dbfb05b58bfe759a60f4 Mon Sep 17 00:00:00 2001 From: Chris Butler Date: Fri, 8 Oct 2021 07:58:58 +1100 Subject: [PATCH 2/6] chore: Force clean coveralls install. Signed-off-by: Chris Butler --- .github/workflows/python-test.yml | 2 ++ setup.cfg | 1 - 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/python-test.yml b/.github/workflows/python-test.yml index 10627b895..b38f76555 100644 --- a/.github/workflows/python-test.yml +++ b/.github/workflows/python-test.yml @@ -135,6 +135,8 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.ADMIN_PAT }} run: | + pip uninstall python-coveralls + pip install coveralls coveralls --service=github \ No newline at end of file diff --git a/setup.cfg b/setup.cfg index f272714a6..2c66a8af8 100644 --- a/setup.cfg +++ b/setup.cfg @@ -75,7 +75,6 @@ dev = livereload ## Constrain system pylint - coveralls From b02638eb13e1133d7cf3ccdaaa9934bfbe57f6a6 Mon Sep 17 00:00:00 2001 From: Chris Butler Date: Fri, 8 Oct 2021 09:29:19 +1100 Subject: [PATCH 3/6] chore: Force clean coveralls install. Signed-off-by: Chris Butler --- .github/workflows/python-test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/python-test.yml b/.github/workflows/python-test.yml index b38f76555..6a05f6535 100644 --- a/.github/workflows/python-test.yml +++ b/.github/workflows/python-test.yml @@ -137,6 +137,6 @@ jobs: run: | pip uninstall python-coveralls pip install coveralls - coveralls --service=github + coveralls --service=github-actions \ No newline at end of file From 169d88fefd000a13f7f8d868d037906c8ede2dda Mon Sep 17 00:00:00 2001 From: Chris Butler Date: Fri, 8 Oct 2021 10:24:52 +1100 Subject: [PATCH 4/6] fix: Correcting tokens Signed-off-by: Chris Butler --- .github/workflows/python-test.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/python-test.yml b/.github/workflows/python-test.yml index 6a05f6535..3a55066fc 100644 --- a/.github/workflows/python-test.yml +++ b/.github/workflows/python-test.yml @@ -133,10 +133,10 @@ jobs: - name: Run coveralls if: ${{ matrix.os == 'ubuntu-latest' && matrix.python-version == '3.7' }} env: - GITHUB_TOKEN: ${{ secrets.ADMIN_PAT }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | pip uninstall python-coveralls pip install coveralls - coveralls --service=github-actions + coveralls --service=github \ No newline at end of file From a106011ae96245214c46e1e21dea2fe27ce93558 Mon Sep 17 00:00:00 2001 From: Chris Butler Date: Fri, 8 Oct 2021 12:49:53 +1100 Subject: [PATCH 5/6] fix: Testing sonarcloud Signed-off-by: Chris Butler --- .github/workflows/python-test.yml | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/.github/workflows/python-test.yml b/.github/workflows/python-test.yml index 3a55066fc..8d50cba95 100644 --- a/.github/workflows/python-test.yml +++ b/.github/workflows/python-test.yml @@ -130,13 +130,21 @@ jobs: if: ${{ matrix.os == 'ubuntu-latest' && matrix.python-version == '3.7' }} run: | make test-cov - - name: Run coveralls + - name: Coveralls Python if: ${{ matrix.os == 'ubuntu-latest' && matrix.python-version == '3.7' }} - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: | - pip uninstall python-coveralls - pip install coveralls - coveralls --service=github - + uses: AndreMiras/coveralls-python-action@v20201129 + + sonarcloud: + name: SonarCloud + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis + - 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 }} + \ No newline at end of file From 95b089441274a6518119a97d3fe3be6832cc279f Mon Sep 17 00:00:00 2001 From: Chris Butler Date: Fri, 8 Oct 2021 12:57:29 +1100 Subject: [PATCH 6/6] fix:Update for SONAR to use coverage.xml Signed-off-by: Chris Butler --- .github/workflows/python-test.yml | 26 ++++++++++++++------------ setup.cfg | 3 +++ 2 files changed, 17 insertions(+), 12 deletions(-) diff --git a/.github/workflows/python-test.yml b/.github/workflows/python-test.yml index 8d50cba95..c23d723f2 100644 --- a/.github/workflows/python-test.yml +++ b/.github/workflows/python-test.yml @@ -108,6 +108,7 @@ jobs: git config --global core.autocrlf false - uses: actions/checkout@v2 with: + fetch-depth: 0 submodules: true - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v2 @@ -133,18 +134,19 @@ jobs: - name: Coveralls Python if: ${{ matrix.os == 'ubuntu-latest' && matrix.python-version == '3.7' }} uses: AndreMiras/coveralls-python-action@v20201129 + - name: SonarCloud Scan + if: ${{ matrix.os == 'ubuntu-latest' && matrix.python-version == '3.7' }} + 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.python.coverage.reportPaths=coverage.xml + -Dsonar.tests=tests/ + -Dsonar.verbose=true + -Dsonar.test.exclusions=tests/** + - sonarcloud: - name: SonarCloud - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - with: - fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis - - 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 }} \ No newline at end of file diff --git a/setup.cfg b/setup.cfg index 2c66a8af8..6214a597d 100644 --- a/setup.cfg +++ b/setup.cfg @@ -114,3 +114,6 @@ init_forbid_extra = True init_typed = True warn_required_dynamic_aliases = True warn_untyped_fields = True + +[coverage:run] +relative_files = True \ No newline at end of file