Add Sonar (#14)
* Add Sonar * Fix code smells
This commit was merged in pull request #14.
This commit is contained in:
30
.github/archive/.deepsource.toml
vendored
Normal file
30
.github/archive/.deepsource.toml
vendored
Normal file
@@ -0,0 +1,30 @@
|
||||
version = 1
|
||||
|
||||
test_patterns = ["tests/**"]
|
||||
|
||||
exclude_patterns = [
|
||||
".github/workflows/**",
|
||||
".gitignore",
|
||||
"CODEOWNERS",
|
||||
"LICENSE.md",
|
||||
"README.md",
|
||||
"codecov.yml",
|
||||
"renovate.json",
|
||||
"requirements-dev.txt",
|
||||
"requirements.txt"
|
||||
]
|
||||
|
||||
[[analyzers]]
|
||||
name = "python"
|
||||
enabled = true
|
||||
|
||||
[analyzers.meta]
|
||||
runtime_version = "3.x.x"
|
||||
|
||||
[[analyzers]]
|
||||
name = "test-coverage"
|
||||
enabled = true
|
||||
|
||||
[[transformers]]
|
||||
name = "black"
|
||||
enabled = true
|
||||
2
.github/archive/codecov.yml
vendored
Normal file
2
.github/archive/codecov.yml
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
ignore:
|
||||
- "*/tests/*”
|
||||
14
.github/workflows/merge-to-main.yml
vendored
14
.github/workflows/merge-to-main.yml
vendored
@@ -18,14 +18,16 @@ jobs:
|
||||
run: pip install -r requirements.txt && pip install -r requirements-dev.txt
|
||||
- name: Run test suite
|
||||
run: |
|
||||
coverage run -m py.test -v
|
||||
coverage run -m py.test -v --junitxml=testresults.xml
|
||||
coverage xml
|
||||
- name: Report results to DeepSource
|
||||
run: |
|
||||
curl https://deepsource.io/cli | sh
|
||||
./bin/deepsource report --analyzer test-coverage --key python --value-file ./coverage.xml
|
||||
- uses: sonarsource/sonarqube-scan-action@master
|
||||
env:
|
||||
DEEPSOURCE_DSN: ${{ secrets.DEEPSOURCE_DSN }}
|
||||
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
|
||||
SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }}
|
||||
- uses: sonarsource/sonarqube-quality-gate-action@master
|
||||
timeout-minutes: 5
|
||||
env:
|
||||
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
|
||||
|
||||
build:
|
||||
needs: coverage
|
||||
|
||||
16
.github/workflows/pull-request.yml
vendored
16
.github/workflows/pull-request.yml
vendored
@@ -23,14 +23,16 @@ jobs:
|
||||
- name: Install dependencies
|
||||
run: pip install -r requirements.txt && pip install -r requirements-dev.txt
|
||||
- name: Lint
|
||||
run: pylint --recursive=yes .
|
||||
run: pylint --recursive=yes --output-format=parseable --output=lintreport.txt .
|
||||
- name: Run test suite
|
||||
run: |
|
||||
coverage run -m py.test -v
|
||||
coverage run -m py.test -v --junitxml=testresults.xml
|
||||
coverage xml
|
||||
- name: Report results to DeepSource
|
||||
run: |
|
||||
curl https://deepsource.io/cli | sh
|
||||
./bin/deepsource report --analyzer test-coverage --key python --value-file ./coverage.xml
|
||||
- uses: sonarsource/sonarqube-scan-action@master
|
||||
env:
|
||||
DEEPSOURCE_DSN: ${{ secrets.DEEPSOURCE_DSN }}
|
||||
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
|
||||
SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }}
|
||||
- uses: sonarsource/sonarqube-quality-gate-action@master
|
||||
timeout-minutes: 5
|
||||
env:
|
||||
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
|
||||
|
||||
Reference in New Issue
Block a user