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
37 changes: 37 additions & 0 deletions .github/workflows/github-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -97,3 +97,40 @@ jobs:
- name: Run tests with coverage
run: |
poetry run pytest --cov=worker_api --cov-report=xml

sonarqube:
name: SonarQube Scan
runs-on: ubuntu-latest
needs: [ buildDockerImage ]
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.12'

- name: Install Poetry
uses: snok/install-poetry@v1
with:
version: 1.7.1
virtualenvs-create: true
virtualenvs-in-project: true

- name: Install dependencies
run: |
poetry config virtualenvs.create false --local
poetry install --no-interaction --with dev

- name: Run tests with coverage
run: |
poetry run pytest --cov=worker_api --cov-report=xml

- name: SonarQube Scan
uses: SonarSource/sonarqube-scan-action@v5
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}

4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,5 @@ COPY . /app
# Expose the port that the app runs on
EXPOSE 8001

# Command to run the application
CMD ["sh", "-c", "poetry run alembic upgrade head && poetry run uvicorn worker_api.app:api --host 0.0.0.0 --port 8001 --log-level debug"]
# Command to run the application (skip alembic since migrations are managed by app-pecha-backend)
CMD ["uvicorn", "worker_api.app:api", "--host", "0.0.0.0", "--port", "8001"]
12 changes: 12 additions & 0 deletions sonar-project.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
sonar.projectKey=webuddhist_worker
sonar.organization=webuddhist
sonar.sources=worker_api
sonar.tests=tests
sonar.python.version=3.12
sonar.python.coverage.reportPaths=coverage.xml

# Exclude model files, repository files, and generated code from code coverage
sonar.coverage.exclusions=**/*_models.py,**/*_response_models.py,**/*_repository.py,**/external_clients/**

# Exclude generated code from analysis entirely
sonar.exclusions=**/external_clients/**
Empty file added tests/audio/__init__.py
Empty file.
Loading
Loading