diff --git a/.github/workflows/test-and-release.yml b/.github/workflows/test-and-release.yml index 22b69005..26153cbb 100644 --- a/.github/workflows/test-and-release.yml +++ b/.github/workflows/test-and-release.yml @@ -12,8 +12,8 @@ jobs: strategy: fail-fast: false matrix: - os: [ubuntu-20.04, windows-2019-npcap] - python: ['3.7', '3.8', '3.9', '3.10'] + os: [ ubuntu-20.04, windows-2019-npcap ] + python: [ '3.7', '3.8', '3.9', '3.10' ] runs-on: ${{ matrix.os }} steps: - name: Check out @@ -52,6 +52,9 @@ jobs: run: | nox --non-interactive --error-on-missing-interpreters --session test pristine --python ${{ matrix.python }} nox --non-interactive --session demo check_style docs + env: + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} + COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }} - name: Save logs uses: actions/upload-artifact@v3 diff --git a/noxfile.py b/noxfile.py index 6c8dd888..c3388903 100644 --- a/noxfile.py +++ b/noxfile.py @@ -135,12 +135,12 @@ def test(session): # Publish coverage statistics. This also has to be run from the test session to access the coverage files. if sys.platform.startswith("linux") and is_latest_python(session) and session.env.get("COVERALLS_REPO_TOKEN"): session.install("coveralls") - session.run("coveralls") + session.run("coveralls", "--service=github") else: session.log("Coveralls skipped") # Submit analysis to SonarCloud. This also has to be run from the test session to access the coverage files. - sonarcloud_token = session.env.get("SONARCLOUD_TOKEN") + sonarcloud_token = session.env.get("SONAR_TOKEN") if sys.platform.startswith("linux") and is_latest_python(session) and sonarcloud_token: session.run("coverage", "xml", "-i", "-o", str(ROOT_DIR / ".coverage.xml")) @@ -149,7 +149,7 @@ def test(session): os.environ["PATH"] = os.pathsep.join([str(sonar_scanner_bin), os.environ["PATH"]]) session.cd(ROOT_DIR) - session.run("sonar-scanner", f"-Dsonar.login={sonarcloud_token}", external=True) + session.run("sonar-scanner", f"-Dsonar.login={sonarcloud_token}", "-X", external=True) else: session.log("SonarQube scan skipped")