Merge pull request #3 from Crocmagnon/add-sonar
Add SonarCloud analysis
This commit is contained in:
commit
c4d6578057
2 changed files with 35 additions and 9 deletions
37
.github/workflows/package.yml
vendored
37
.github/workflows/package.yml
vendored
|
@ -2,9 +2,6 @@ name: Test & publish
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches:
|
|
||||||
- master
|
|
||||||
pull_request:
|
|
||||||
release:
|
release:
|
||||||
types: [created]
|
types: [created]
|
||||||
|
|
||||||
|
@ -20,9 +17,9 @@ jobs:
|
||||||
os: [ubuntu-latest, windows-latest, macOS-latest]
|
os: [ubuntu-latest, windows-latest, macOS-latest]
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v1
|
- uses: actions/checkout@v2
|
||||||
- name: Set up Python ${{ matrix.python-version }}
|
- name: Set up Python ${{ matrix.python-version }}
|
||||||
uses: actions/setup-python@v1
|
uses: actions/setup-python@v1.1.1
|
||||||
with:
|
with:
|
||||||
python-version: ${{ matrix.python-version }}
|
python-version: ${{ matrix.python-version }}
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
|
@ -32,8 +29,30 @@ jobs:
|
||||||
poetry install
|
poetry install
|
||||||
- name: Test with pytest
|
- name: Test with pytest
|
||||||
run: |
|
run: |
|
||||||
poetry run coverage run --source=. -m pytest --color=yes
|
poetry run coverage run --source=ofx_processor -m pytest --color=yes
|
||||||
poetry run coverage report
|
poetry run coverage xml
|
||||||
|
- name: Coverage report upload
|
||||||
|
uses: actions/upload-artifact@v1
|
||||||
|
with:
|
||||||
|
name: coverage_${{ matrix.os }}_${{ matrix.python-version }}
|
||||||
|
path: coverage.xml
|
||||||
|
|
||||||
|
sonarCloudTrigger:
|
||||||
|
name: SonarCloud Trigger
|
||||||
|
needs: build
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
- name: Download coverage report
|
||||||
|
uses: actions/download-artifact@v1
|
||||||
|
with:
|
||||||
|
name: coverage_ubuntu-latest_3.8
|
||||||
|
path: coverage-reports
|
||||||
|
- name: SonarCloud Scan
|
||||||
|
uses: sonarsource/sonarcloud-github-action@v1.1
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
|
||||||
|
|
||||||
publish:
|
publish:
|
||||||
name: Publish to PyPI
|
name: Publish to PyPI
|
||||||
|
@ -41,9 +60,9 @@ jobs:
|
||||||
needs: build
|
needs: build
|
||||||
if: github.event_name == 'release'
|
if: github.event_name == 'release'
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v1
|
- uses: actions/checkout@v2
|
||||||
- name: Set up Python
|
- name: Set up Python
|
||||||
uses: actions/setup-python@v1
|
uses: actions/setup-python@v1.1.1
|
||||||
with:
|
with:
|
||||||
python-version: '3.8'
|
python-version: '3.8'
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
|
|
7
sonar-project.properties
Normal file
7
sonar-project.properties
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
sonar.organization=crocmagnon
|
||||||
|
sonar.projectKey=Crocmagnon_ofx-processor
|
||||||
|
|
||||||
|
# relative paths to source directories. More details and properties are described
|
||||||
|
# in https://sonarcloud.io/documentation/project-administration/narrowing-the-focus/
|
||||||
|
sonar.sources=ofx_processor
|
||||||
|
sonar.python.coverage.reportPaths=coverage-reports/coverage.xml
|
Loading…
Reference in a new issue