Update actions/checkout action to v4 #128
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Sonar Cloud | |
on: [push, pull_request] | |
env: | |
python_version: '3.10' | |
jobs: | |
sonarcloud: | |
name: Sonar Cloud Analysis | |
runs-on: ubuntu-latest | |
container: osgeo/gdal:ubuntu-small-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis | |
- name: Install dependencies | |
run: | | |
apt -y update | |
apt install -y --fix-missing python3-pip libgl1-mesa-glx | |
python -m pip install --upgrade pip | |
pip install -r requirements.txt | |
- name: Run Tests | |
run: | | |
coverage run -m unittest discover && coverage xml -i | |
- name: SonarCloud Scan | |
uses: SonarSource/sonarcloud-github-action@master | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any | |
SONAR_TOKEN: ${{ secrets.UBIQUE_SONAR_TOKEN }} | |
with: | |
args: > | |
-Dsonar.organization=ubiqueinnovation | |
-Dsonar.projectKey=UbiqueInnovation_map-tools | |
-Dsonar.python.version=${{ env.python_version }} | |
-Dsonar.python.coverage.reportPaths=coverage.xml |