-
Notifications
You must be signed in to change notification settings - Fork 10
52 lines (41 loc) · 1.21 KB
/
sonar.yml
File metadata and controls
52 lines (41 loc) · 1.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
# SPDX-FileCopyrightText: Contributors to the Power Grid Model project <powergridmodel@lfenergy.org>
#
# SPDX-License-Identifier: MPL-2.0
name: Sonar Cloud
on:
push:
branches:
- main
pull_request:
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@v5
- name: Install uv
uses: astral-sh/setup-uv@v7
if: ${{ always() }}
with:
activate-environment: true
enable-cache: true
- name: install poe
run: uv tool install poethepoet
- name: Install dependencies
if: ${{ always() }}
run: uv sync --frozen --dev
- name: Test and Coverage
run: |
poe coverage
uv run coverage xml
- name: SonarCloud Scan
if: ${{ (github.event_name == 'push') || (github.event.pull_request.head.repo.owner.login == 'PowerGridModel') }}
uses: SonarSource/sonarqube-scan-action@v7
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}