-
Notifications
You must be signed in to change notification settings - Fork 58
94 lines (78 loc) · 2.64 KB
/
sonar-cloud.yml
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
name: SonarCloud
on:
workflow_dispatch:
push:
branches:
- "main"
pull_request:
jobs:
octopoes-tests:
uses: minvws/nl-kat-coordination/.github/workflows/octopoes-tests.yml@main
bytes-tests:
uses: minvws/nl-kat-coordination/.github/workflows/bytes-tests.yml@main
mula-tests:
uses: minvws/nl-kat-coordination/.github/workflows/mula-tests.yml@main
rocky-tests:
uses: minvws/nl-kat-coordination/.github/workflows/rocky-tests.yml@main
boefjes-tests:
uses: minvws/nl-kat-coordination/.github/workflows/boefjes-tests.yml@main
fix-coverage-reports:
runs-on: ubuntu-latest
needs:
- octopoes-tests
- mula-tests
- bytes-tests
- rocky-tests
- boefjes-tests
strategy:
matrix:
module:
- name: octopoes
prefix_path: "."
- name: mula
prefix_path: "mula/scheduler/"
- name: bytes
prefix_path: "bytes/"
- name: rocky
prefix_path: "rocky/"
- name: boefjes
prefix_path: "boefjes/"
steps:
- name: Checkout coverage file fix script
uses: actions/checkout@v4
with:
fetch-depth: 0
sparse-checkout: .github/scripts/coverage_file_fixer.py
- name: Download coverage file
uses: actions/download-artifact@v4
with:
name: ${{ matrix.module['name'] }}-coverage-unit
path: ${{ matrix.module['name'] }}-coverage-unit
- name: Fix coverage report sources
uses: Mudlet/xmlstarlet-action@master
with:
args: edit --inplace --update "coverage/sources" --value "/github/workspace/${{ matrix.module['name'] }}/" "${{ matrix.module['name'] }}-coverage-unit/coverage.xml"
- name: Fix coverage file
run: python "${{ github.workspace }}/.github/scripts/coverage_file_fixer.py" "${{ matrix.module['name'] }}-coverage-unit/coverage.xml" "${{ matrix.module['prefix_path'] }}"
- name: Upload fixed coverage file
uses: actions/upload-artifact@v4
with:
name: "${{ matrix.module['name'] }}-coverage-unit-fixed"
path: "${{ matrix.module['name'] }}-coverage-unit/coverage.xml"
sonar-cloud:
runs-on: ubuntu-latest
needs:
- fix-coverage-reports
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Download artifacts
uses: actions/download-artifact@v4
with:
pattern: "*-coverage-unit-fixed"
- name: SonarCloud
uses: SonarSource/[email protected]
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}