Skip to content

Commit

Permalink
added sonarqube scan (#5)
Browse files Browse the repository at this point in the history
* added sonarqube scan

---------

Co-authored-by: Sergio Castineyras <[email protected]>
  • Loading branch information
scastineyras and sercasti authored Oct 16, 2024
1 parent 458e74b commit b71f766
Showing 1 changed file with 25 additions and 3 deletions.
28 changes: 25 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
needs: lint
strategy:
matrix:
ckan-version: ["2.11", "2.10", 2.9]
ckan-version: ["2.11", "2.10", "2.9"]
fail-fast: false

name: CKAN ${{ matrix.ckan-version }}
Expand Down Expand Up @@ -45,8 +45,18 @@ jobs:

steps:
- uses: actions/checkout@v4
- name: Install requirements
- name: Install requirements for CKAN 2.9
if: matrix.ckan-version == '2.9'
run: |
pip install --upgrade setuptools==70.0.0 wheel twine
pip install -r dev-requirements.txt
pip install -e .
# Replace default path to CKAN core config file with the one on the container
sed -i -e 's/use = config:.*/use = config:\/srv\/app\/src\/ckan\/test-core.ini/' test.ini
- name: Install requirements for other CKAN versions
if: matrix.ckan-version != '2.9'
run: |
pip install --upgrade setuptools wheel twine
pip install -r dev-requirements.txt
pip install -e .
# Replace default path to CKAN core config file with the one on the container
Expand All @@ -55,4 +65,16 @@ jobs:
run: |
ckan -c test.ini db init
- name: Run tests
run: pytest --ckan-ini=test.ini --disable-warnings ckanext/geoview/tests
run: pytest --ckan-ini=test.ini --cov-report xml:coverage.xml --disable-warnings ckanext/geoview/tests
- name: SonarQube Scan
uses: sonarsource/sonarqube-scan-action@master
with:
args: >
-Dsonar.projectKey=ckanext-geoview
-Dsonar.sources=ckanext/geoview
-Dsonar.tests=ckanext/geoview/tests
-Dsonar.exclusions=ckanext/geoview/tests/**
-Dsonar.python.coverage.reportPaths=coverage.xml
env:
SONAR_TOKEN: ${{ secrets.SONAR_API_TOKEN }}
SONAR_HOST_URL: ${{ secrets.SONAR_EXTERNAL_URL }}

0 comments on commit b71f766

Please sign in to comment.