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

Quiz assignment

Quiz assignment #34

Workflow file for this run

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 --cov-report=xml --cov-config=pyproject.toml --cov-branch
- 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
-Dsonar.coverage.exclusions=**/scripts/**,**/__init__,**/__main__,**/tests/** -X
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}