Skip to content
This repository was archived by the owner on Jul 2, 2024. It is now read-only.

Feature/coverage #105

Merged
merged 6 commits into from
Sep 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 53 additions & 0 deletions .github/workflows/sonarcloud.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: Collect coverage report for SonarCloud

on:
push:
branches:
- master
pull_request:
types:
- opened
- synchronize
- reopened
branches:
- master
- devel

jobs:
sonarcloud:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
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.9"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pytest pytest-cov
- name: Install source packages
run: |
pip install -e .
- name: Collect coverage
run: |
pytest --cov=src --quiet
coverage xml
- name: Upload coverage report
uses: actions/upload-artifact@v2
with:
name: coverage
path: ./coverage.xml
- name: SonarCloud Scan
uses: SonarSource/sonarcloud-github-action@master
with:
args:
-Dsonar.projectKey=edu-python-course_problem-sets
-Dsonar.organization=edu-python-course
-Dsonar.python.coverage.reportPaths=coverage.xml -X
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ __pycache__
# coverage reports
*.coverage.db
*.coverage
coverage.*

# local databases
pgdata/
Expand Down