-
Notifications
You must be signed in to change notification settings - Fork 76
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
214c989
commit 3a19919
Showing
4 changed files
with
64 additions
and
0 deletions.
There are no files selected for viewing
30 changes: 30 additions & 0 deletions
30
{{cookiecutter.project_slug}}/.github/workflows/quality.yml
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,30 @@ | ||
name: quality | ||
on: | ||
push: | ||
pull_request: | ||
types: [opened, synchronize, reopened] | ||
jobs: | ||
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: Set up Python | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: 3.8 | ||
- name: Install dependencies | ||
run: python -m pip install .[dev] | ||
- name: Check style against standards using prospector | ||
run: prospector --zero-exit -o grouped -o pylint:pylint-report.txt | ||
- name: Run unit tests with coverage | ||
run: pytest --cov --cov-report term --cov-report xml --junitxml=xunit-result.xml tests/ | ||
- name: Correct coverage paths | ||
run: sed -i "s+$PWD/++g" coverage.xml | ||
- name: SonarCloud Scan | ||
uses: SonarSource/sonarcloud-github-action@v2 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any | ||
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
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,12 @@ | ||
sonar.organization={{ cookiecutter.github_organization }} | ||
sonar.projectKey={{ cookiecutter.github_organization }}_{{ cookiecutter.project_slug }} | ||
sonar.host.url=https://sonarcloud.io | ||
sonar.sources={{ cookiecutter.project_slug.lower().replace(" ", "_").replace("-", "_")}}/ | ||
sonar.tests=tests/ | ||
sonar.links.homepage=https://github.com/{{ cookiecutter.github_organization }}/{{ cookiecutter.project_slug }} | ||
sonar.links.scm=https://github.com/{{ cookiecutter.github_organization }}/{{ cookiecutter.project_slug }} | ||
sonar.links.issue=https://github.com/{{ cookiecutter.github_organization }}/{{ cookiecutter.project_slug }}/issues | ||
sonar.links.ci=https://github.com/{{ cookiecutter.github_organization }}/{{ cookiecutter.project_slug }}/actions | ||
sonar.python.coverage.reportPaths=coverage.xml | ||
sonar.python.xunit.reportPath=xunit-result.xml | ||
sonar.python.pylint.reportPaths=pylint-report.txt |