Improve sonar cloud feedback speed

This commit is contained in:
Gabriel Augendre 2020-02-29 13:38:50 +01:00
parent b1e80994b4
commit 2cf722cd46
No known key found for this signature in database
GPG key ID: 1E693F4CE4AEE7B4
2 changed files with 26 additions and 25 deletions

View file

@ -6,6 +6,30 @@ on:
types: [created]
jobs:
sonarCloudTrigger:
name: SonarCloud Trigger
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v1.1.1
with:
python-version: 3.8
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install poetry
poetry install
- name: Test with pytest
run: |
poetry run coverage run --source=ofx_processor -m pytest --color=yes
poetry run coverage xml
- name: SonarCloud Scan
uses: sonarsource/sonarcloud-github-action@v1.1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
build:
name: Python ${{ matrix.python-version }} / ${{ matrix.os }}
runs-on: ${{ matrix.os }}
@ -29,30 +53,7 @@ jobs:
poetry install
- name: Test with pytest
run: |
poetry run coverage run --source=ofx_processor -m pytest --color=yes
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 }}
poetry run pytest --color=yes
publish:
name: Publish to PyPI

View file

@ -4,4 +4,4 @@ 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
sonar.python.coverage.reportPaths=coverage.xml