tasotarkistus: api endpoint (#793) #1051
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
on: | |
push: | |
branches: [master, develop] | |
pull_request_target: | |
branches: [master, develop] | |
name: Sonarcloud Scan | |
jobs: | |
sonarcloud: | |
env: | |
DATABASE_URL: 'postgis://postgres:postgres@localhost/github_actions' | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python: ["3.10"] | |
services: | |
postgres: | |
image: postgis/postgis:12-3.4 | |
env: | |
POSTGRES_USER: postgres | |
POSTGRES_PASSWORD: postgres | |
POSTGRES_DB: github_actions | |
ports: | |
- 5432:5432 | |
# needed because the postgres container does not provide a healthcheck | |
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5 | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Setup Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python }} | |
- name: Install gdal | |
run: | | |
sudo apt-get update | |
sudo apt-get install --no-install-recommends -y gdal-bin gettext | |
- name: Install pypi packages | |
run: | | |
python -m pip install --upgrade pip | |
pip install -r requirements.txt | |
pip install -r requirements-dev.txt | |
- name: Generate coverage file | |
run: | | |
python manage.py compilemessages | |
pytest --cov=. --cov-report xml:coverage.xml --migrations | |
- name: SonarCloud Scan | |
uses: sonarsource/sonarcloud-github-action@master | |
with: | |
args: > | |
-Dsonar.organization=managedcloudapplications | |
-Dsonar.projectKey=mvj | |
-Dsonar.sources=. | |
-Dsonar.host.url=https://sonarcloud.io | |
-Dsonar.python.version=3.10 | |
-Dsonar.python.coverage.reportPaths=coverage.xml | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} |