Skip to content
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
46 changes: 46 additions & 0 deletions .github/workflows/sonarcloud.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: SonarQube Cloud Analysis

on:
push:
branches:
- main
- master
pull_request:
types: [opened, synchronize, reopened]

permissions:
contents: read

jobs:
sonarcloud:
name: SonarQube Cloud Scan
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: "3.12"

- name: Install system dependencies
run: |
sudo apt-get update && sudo apt-get install -y libgl1 libegl1 libxkbcommon-x11-0 libasound2-dev

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -e .[test]

- name: Run tests with coverage
run: |
pytest --cov=eloquent_notes --cov-report=xml:coverage.xml --cov-report=term

- name: SonarQube Cloud Scan
uses: SonarSource/sonarqube-scan-action@v6
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -157,3 +157,6 @@ build

# Code-Reducer Lockfile
.code-reducer.lock

# SonarQube
.scannerwork/
6 changes: 6 additions & 0 deletions .sonarcloud.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
sonar.organization=arrase
sonar.projectKey=arrase_eloquent-notes
sonar.sources=eloquent_notes
sonar.tests=tests
sonar.python.version=3.10, 3.11, 3.12, 3.13, 3.14
sonar.python.coverage.reportPaths=coverage.xml
17 changes: 17 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,26 @@ dependencies = [
[project.scripts]
eloquent-notes = "eloquent_notes.main:main"

[project.optional-dependencies]
test = [
"pytest>=8.0.0",
"pytest-cov>=5.0.0",
]

[tool.setuptools.packages.find]
where = ["."]
include = ["eloquent_notes*"]

[tool.setuptools.package-data]
eloquent_notes = ["config.yaml", "prompts/*.md", "templates/*.md"]

[tool.pytest.ini_options]
testpaths = ["tests"]
python_files = ["test_*.py"]

[tool.coverage.run]
source = ["eloquent_notes"]
relative_files = true

[tool.coverage.report]
show_missing = true
6 changes: 6 additions & 0 deletions sonar-project.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
sonar.organization=arrase
sonar.projectKey=arrase_eloquent-notes
sonar.sources=eloquent_notes
sonar.tests=tests
sonar.python.version=3.10, 3.11, 3.12, 3.13, 3.14
sonar.python.coverage.reportPaths=coverage.xml
Loading