Skip to content

Simplify and fix pre-release downloads (#74) #21

Simplify and fix pre-release downloads (#74)

Simplify and fix pre-release downloads (#74) #21

Workflow file for this run

# SPDX-FileCopyrightText: Contributors to the Power Grid Model project <[email protected]>
#
# SPDX-License-Identifier: MPL-2.0
name: Sonar Cloud
on:
# run pipeline on push event of main branch
push:
branches:
- main
# run pipeline on pull request
pull_request:
# run pipeline on merge queue
merge_group:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-sonar
cancel-in-progress: true
jobs:
sonar-cloud:
permissions:
contents: write
runs-on: ubuntu-latest
steps:
- name: Checkout source code
uses: actions/checkout@v4
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
- name: Setup Python 3.11
uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Install in develop mode
run: |
pip install -e .[dev]
- name: Test and Coverage
run: |
coverage run -m pytest
coverage xml
coverage report --fail-under=80
- name: SonarCloud Scan
if: ${{ (github.event_name == 'push') || (github.event.pull_request.head.repo.owner.login == 'PowerGridModel') }}
uses: SonarSource/sonarqube-scan-action@v5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}