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

Test sonar #2

Closed
wants to merge 3 commits into from
Closed
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
16 changes: 0 additions & 16 deletions .github/workflows/docker-dry-run.yml

This file was deleted.

25 changes: 18 additions & 7 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,25 @@ jobs:
python:
name: Python
uses: ./.github/workflows/python-tests.yml

with:
cache_key: python-coverage-report-${{ github.sha }}-${{ github.run_id }}
docker:
name: Docker
uses: ./.github/workflows/docker-dry-run.yml

name: Docker Dry Run
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: gisktzh/github-actions/docker-dry-run@main
with:
image: gb3-search-api
sonarcloud:
name: SonarCloud
uses: ./.github/workflows/sonar-analysis.yml
needs: python
secrets:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: gisktzh/github-actions/sonarcloud-analysis@main
with:
sonar_token: ${{ secrets.SONAR_TOKEN }}
github_token: ${{ secrets.GITHUB_TOKEN }}
coverage_file_path: coverage.xml
coverage_cache_key: python-coverage-report-${{ github.sha }}-${{ github.run_id }}
10 changes: 8 additions & 2 deletions .github/workflows/python-tests.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
name: Tests

on: workflow_call
on:
workflow_call:
inputs:
cache_key:
description: 'Cache key for coverage report'
required: true
type: string

env:
PYTHON_VERSION: '3.10'
Expand All @@ -27,4 +33,4 @@ jobs:
uses: actions/cache@v4
with:
path: coverage.xml
key: python-coverage-report-${{ github.sha }}-${{ github.run_id }}
key: ${{inputs.cache_key}}
26 changes: 0 additions & 26 deletions .github/workflows/sonar-analysis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion indexes/search_results.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def prepare_search_result_for_gb3(index: str, search_result: ObjectApiResponse,
raise HTTPException(status_code=500, detail="Index is not properly configured")

def get_results(index: str, search_result: ObjectApiResponse,
display_string_factory: Callable[dict, str]) -> SearchResult:
display_string_factory: Callable[dict, str], unused: str = "") -> SearchResult:
matches = []
hits = search_result["hits"]["hits"]
for hit in hits:
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[tool.pytest.ini_options]
pythonpath = [
"."
]
]
Loading