-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: Move sonarlint analysis to Github action for coverage and remote …
…PR support (#737)
- Loading branch information
Showing
3 changed files
with
41 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
--- | ||
name: Analysis with Sonarlint and publish to SonarCloud | ||
on: | ||
push: | ||
branches: | ||
- main | ||
# Need to do this to be able to have coverage on PR across forks. | ||
pull_request_target: | ||
|
||
# TODO this can be made better by running only coverage, it happens that today | ||
# in tox gh-actions we have configured 3.11 to run the report side in | ||
# pyproject.toml | ||
|
||
jobs: | ||
sonarcloud: | ||
name: Run Sonarlint analysis and upload to SonarCloud. | ||
runs-on: ubuntu-latest | ||
needs: [test-python] | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis | ||
- name: Setup Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: 3.11 | ||
- name: Install dependencies | ||
run: pip install tox tox-gh-actions | ||
- name: "Run pytest via tox for ${{ matrix.python }}" | ||
run: tox | ||
- name: SonarCloud Scan | ||
uses: SonarSource/sonarcloud-github-action@master | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters