-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
54 lines (51 loc) · 4.04 KB
/
Copy pathsonarcloud.yml
File metadata and controls
54 lines (51 loc) · 4.04 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
53
54
name: SonarCloud
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
permissions:
contents: read
jobs:
sonarcloud:
uses: reactiveui/actions-common/.github/workflows/workflow-common-sonarcloud.yml@main
with:
productNamespacePrefix: ReactiveUI
installWorkloads: true
sonarProjectKey: reactiveui_ReactiveUI
sonarOrganization: reactiveui
sonarExclusions: '**/tests/**,**/integrationtests/**,**/benchmarks/**,**/examples/**,**/TestResults/**'
# Coverage exclusions (sonar.coverage.exclusions) — code the Sonar scan cannot execute, so counting it
# would only ever report 0%. This is COVERAGE ONLY; every excluded file is still fully analysed for bugs,
# smells and duplication.
# - Shared/Platform fused Rx-replacement observables are compile-linked into every platform assembly and
# only exercisable via platform tests; the Shared/ root helpers stay measured (core test suite covers them).
# - The scan runs on windows-latest (see workflow-common-sonarcloud.yml runsOn) so it builds and runs the
# core + WPF + WinUI + WinForms tests — that platform code stays measured (e.g. CreatesWinformsCommandBinding
# sits at ~99%). What it CANNOT run is the android/apple per-OS code under ReactiveUI/Platforms/{android,
# apple-common,ios,mac,tvos,uikit-common,mobile-common}: those need an emulator/device or a mac runner, so
# their tests never execute in CI and the files always read 0%. Exclude exactly those per-OS dirs from
# coverage (Platforms/net and Platforms/netstandard2.0 stay measured — they run under the core tests).
sonarCoverageExclusions: '**/tests/**,**/integrationtests/**,**/benchmarks/**,**/examples/**,**/*Tests/**,**/*Tests.cs,**/Generated/**,**/Shared/Platform/**,**/Platforms/android/**,**/Platforms/apple-common/**,**/Platforms/ios/**,**/Platforms/mac/**,**/Platforms/tvos/**,**/Platforms/uikit-common/**,**/Platforms/mobile-common/**'
# CPD (copy/paste detection) exclusions:
# - tests/integrationtests/Benchmarks/examples are non-shipping code. The examples are
# demo apps that deliberately parallel each other (each sample reimplements the same
# view-model/driver shapes so it reads standalone), so cross-sample duplication is
# expected and not worth de-duplicating into a shared library.
# - WhenAny{Value,Change}Sink.Arity{N}.cs, WhenAnyMixin.Arity{N}.cs and
# WhenAnyObservableMixin.Arity{N}.cs are template-style arity-specific files: the
# residual duplication is the irreducible per-arity typed surface (N typed fields,
# N constructor params, N switch arms). Compressing further would need source
# generators or boxing-based erasure; suppressing CPD here keeps the metric honest
# while every other Sonar rule still runs on them. Sonar path matchers only support
# *, **, ? — use ? twice to cover 1- and 2-digit arities.
# - WhenAnyMixins.Arity{N}.Dynamic.cs and the builder instance-resolution surfaces
# BuilderMixins.Instance.cs and ReactiveUIBuilder.Build.cs are the same irreducible
# per-arity shape: after the shared scaffold is factored out, the residual is one typed
# GetService list per arity, which cannot be folded further without variadic generics
# (absent in C#) or reflection/boxing. Same treatment as the Arity{N} files above.
sonarCpdExclusions: '**/tests/**,**/integrationtests/**,**/benchmarks/**,**/examples/**,**/*.Arity?.cs,**/*.Arity??.cs,**/*.Arity?.Dynamic.cs,**/*.Arity??.Dynamic.cs,**/BuilderMixins.Instance.cs,**/ReactiveUIBuilder.Build.cs'
sonarTestExclusions: '**/tests/**,**/integrationtests/**,**/benchmarks/**'
testTimeout: '15m'
secrets:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}