File tree Expand file tree Collapse file tree 2 files changed +56
-37
lines changed Expand file tree Collapse file tree 2 files changed +56
-37
lines changed Original file line number Diff line number Diff line change 33# SPDX-License-Identifier: MPL-2.0
44
55
6- name : Build, Test, Sonar
6+ name : Build and Test
77
88on :
99 # run pipeline from another workflow
6464 name : power-grid-model-io
6565 path : wheelhouse/
6666
67- sonar-cloud :
68- permissions :
69- contents : write
70- runs-on : ubuntu-latest
71- steps :
72-
73- - name : Checkout source code
74- uses : actions/checkout@v4
75- with :
76- fetch-depth : 0 # Shallow clones should be disabled for a better relevancy of analysis
77-
78- - name : Setup Python 3.11
79- uses : actions/setup-python@v5
80- with :
81- python-version : " 3.11"
82-
83- - name : Install in develop mode
84- run : |
85- pip install -e .[dev]
86-
87- - name : Test and Coverage
88- run : |
89- pytest
90-
91- # Fix relative paths in coverage file
92- # Known bug: https://community.sonarsource.com/t/sonar-on-github-actions-with-python-coverage-source-issue/36057
93- sed -i 's@/home/runner/work/power-grid-model-io/power-grid-model-io@/github/workspace@g' python_coverage.xml
94-
95- - name : SonarCloud Scan
96- if : ${{ (github.event_name == 'push') || (github.event.pull_request.head.repo.owner.login == 'PowerGridModel') }}
97- uses : SonarSource/sonarqube-scan-action@master
98- env :
99- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
100- SONAR_TOKEN : ${{ secrets.SONAR_TOKEN }}
101-
10267 unit-tests :
10368 needs : build-python
10469 strategy :
@@ -176,7 +141,6 @@ jobs:
176141 - build-python
177142 - unit-tests
178143 - validation-tests
179- - sonar-cloud
180144 permissions :
181145 contents : write
182146 runs-on : ubuntu-latest
Original file line number Diff line number Diff line change 1+ # SPDX-FileCopyrightText: Contributors to the Power Grid Model project <[email protected] >2+ #
3+ # SPDX-License-Identifier: MPL-2.0
4+
5+ name : Sonar Cloud
6+
7+ on :
8+ # run pipeline on push event of main branch
9+ push :
10+ branches :
11+ - main
12+ # run pipeline on pull request
13+ pull_request :
14+ # run pipeline on merge queue
15+ merge_group :
16+
17+ concurrency :
18+ group : ${{ github.workflow }}-${{ github.ref }}-sonar
19+ cancel-in-progress : true
20+
21+ jobs :
22+ sonar-cloud :
23+ permissions :
24+ contents : write
25+ runs-on : ubuntu-latest
26+ steps :
27+
28+ - name : Checkout source code
29+ uses : actions/checkout@v4
30+ with :
31+ fetch-depth : 0 # Shallow clones should be disabled for a better relevancy of analysis
32+
33+ - name : Setup Python 3.11
34+ uses : actions/setup-python@v5
35+ with :
36+ python-version : " 3.11"
37+
38+ - name : Install in develop mode
39+ run : |
40+ pip install -e .[dev]
41+
42+ - name : Test and Coverage
43+ run : |
44+ pytest
45+
46+ # Fix relative paths in coverage file
47+ # Known bug: https://community.sonarsource.com/t/sonar-on-github-actions-with-python-coverage-source-issue/36057
48+ sed -i 's@/home/runner/work/power-grid-model-io/power-grid-model-io@/github/workspace@g' python_coverage.xml
49+
50+ - name : SonarCloud Scan
51+ if : ${{ (github.event_name == 'push') || (github.event.pull_request.head.repo.owner.login == 'PowerGridModel') }}
52+ uses : SonarSource/sonarqube-scan-action@master
53+ env :
54+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
55+ SONAR_TOKEN : ${{ secrets.SONAR_TOKEN }}
You can’t perform that action at this time.
0 commit comments