Repository navigation
74 lines (62 loc) · 2.6 KB
/
Copy pathCodeQuality.yml
File metadata and controls
74 lines (62 loc) · 2.6 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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
name: Build & Test & SonarQube
on:
push:
pull_request:
types: [opened, synchronize, reopened]
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6.0.2
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
- name: Set up JDK 17
uses: actions/setup-java@v5.2.0
with:
distribution: 'temurin'
java-version: '17'
overwrite-settings: false
- name: Setup dotnet
uses: actions/setup-dotnet@v5.1.0
with:
dotnet-version: '10.0.x'
- name: Restore dependencies
run: dotnet restore ArgusTransfer.sln
- name: Sonarqube Begin
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
SONAR_SCANNER_OPTS: "-Xmx4096m"
run: |
dotnet tool install --global dotnet-sonarscanner
dotnet tool install --global dotnet-coverage
dotnet sonarscanner begin /k:"samgerene_ArgusTransfer" /o:"samgerene" /d:sonar.token="$SONAR_TOKEN" /d:sonar.host.url="https://sonarcloud.io" /d:sonar.cs.vscoveragexml.reportsPaths=coverage.xml
- name: Build
run: dotnet build --no-restore --no-incremental /p:ContinuousIntegrationBuild=true
- name: Run Tests and Compute Coverage
run: dotnet-coverage collect "dotnet test ArgusTransfer.sln --no-restore --no-build --verbosity normal" -f xml -o "coverage.xml"
- name: Sonarqube end
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: dotnet sonarscanner end /d:sonar.token="$SONAR_TOKEN"
# Checks the rules of .editorconfig: whitespace, line endings, encoding, using order, the file header and code style.
# Last, so that a violation does not stop the analysis above.
- name: Verify formatting
run: dotnet format ArgusTransfer.sln --no-restore --verify-no-changes
# Named pipes behave differently on Windows (unbuffered pipe instances instead of Unix domain sockets), and some
# tests only run there ([Platform("Win")]). Analysis and coverage stay in the Linux job above.
test-windows:
name: Test (Windows)
runs-on: windows-latest
steps:
- uses: actions/checkout@v6.0.2
- name: Setup dotnet
uses: actions/setup-dotnet@v5.1.0
with:
dotnet-version: '10.0.x'
- name: Restore dependencies
run: dotnet restore ArgusTransfer.sln
- name: Build
run: dotnet build ArgusTransfer.sln --no-restore
- name: Run Tests
run: dotnet test ArgusTransfer.sln --no-restore --no-build --verbosity normal