Skip to content

Commit 6dee3a4

Browse files
RomanProsinRoman PROSIN
authored andcommitted
fix(CI): Восстановить CI конвейер
1 parent 7c7b5f1 commit 6dee3a4

File tree

5 files changed

+43
-36
lines changed

5 files changed

+43
-36
lines changed

.github/workflows/default.yml

Lines changed: 17 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,17 @@ on:
99
- 'hotfix/**'
1010
- 'refactoring/**'
1111
release:
12-
types:
13-
- released
12+
types:
13+
- released
1414
jobs:
1515
default:
1616
name: Default Job
1717
runs-on: ubuntu-latest
1818
env:
1919
PROJECT_KEY: 'Raiffeisen-DGTL_ViennaNET'
2020
PROJECT_NAME: 'ViennaNET.sln'
21-
21+
ARTIFACTS_DIR: '${{ github.workspace }}/artifacts'
22+
REPORTS_DIR: '${{ github.workspace }}/artifacts/reports'
2223
steps:
2324
- name: Setup GitVersion
2425
uses: gittools/actions/gitversion/[email protected]
@@ -71,42 +72,29 @@ jobs:
7172
SONAR_ORG: 'raiffeisen-dgtl'
7273
SONAR_HOST_URL: https://sonarcloud.io
7374
run: |
74-
./.sonar/scanner/dotnet-sonarscanner begin \
75-
/k:$PROJECT_KEY \
75+
./.sonar/scanner/dotnet-sonarscanner begin /k:$PROJECT_KEY \
7676
/o:$SONAR_ORG \
77-
/v:$GITVERSION_SEMVER \
78-
/n:$PROJECT_NAME \
77+
/v:$GITVERSION_FULLSEMVER \
78+
/s:"${{ github.workspace }}/SonarQube.Analysis.xml" \
7979
/d:sonar.login=$SONAR_TOKEN \
80-
/d:sonar.host.url=$SONAR_HOST_URL \
81-
/d:sonar.cs.nunit.reportsPaths="**/TestResult/TestResults*.xml" \
82-
/d:sonar.cs.opencover.reportsPaths="**/TestResult/coverage.opencover.xml"
80+
/d:sonar.host.url=$SONAR_HOST_URL
8381
8482
- name: Restore dependencies
8583
run: dotnet restore
8684

8785
- name: Build
8886
run: |
89-
dotnet build $PROJECT_NAME \
90-
-c Release \
91-
--no-restore \
92-
--nologo \
93-
/p:Company=Raiffeisenbank \
94-
/p:Product=ViennaNET \
95-
/p:AssemblyVersion=$GITVERSION_ASSEMBLYSEMVER \
96-
/p:FileVersion=$GITVERSION_ASSEMBLYSEMFILEVER \
97-
/p:InformationalVersion=$GITVERSION_INFORMATIONALVERSION
87+
dotnet build "$PROJECT_NAME" -c Release --nologo --no-restore
9888
9989
- name: Test
10090
run: |
101-
dotnet test $PROJECT_NAME \
102-
-c Release \
103-
-r '${{ github.workspace }}/reports' \
104-
--no-build \
105-
--nologo \
106-
--logger "nunit;LogFilePath=TestResult-{assembly}.xml" \
107-
/p:CollectCoverage=true \
108-
/p:CoverletOutputFormat=\"opencover\" \
109-
/p:CoverletOutput=TestResult/
91+
dotnet tool update -g dotnet-reportgenerator-globaltool;
92+
dotnet test "$PROJECT_NAME" -c Release --nologo --no-restore --no-build \
93+
--logger "nunit;LogFilePath=$REPORTS_DIR/{assembly}-nunit-tests-result.xml";
94+
reportgenerator "-reports:${{ github.workspace }}/**/*.cobertura.xml" \
95+
"-targetdir:$REPORTS_DIR/" \
96+
"-reporttypes:SonarQube;TextSummary";
97+
11098
11199
- name: End sonarscanner
112100
env:
@@ -116,7 +104,7 @@ jobs:
116104

117105
- name: Pack
118106
if: github.event_name == 'release'
119-
run: dotnet pack $PROJECT_NAME -c Release -o ./nupkgs --nologo --no-build -p:PackageVersion=$GITVERSION_NUGETVERSIONV2
107+
run: dotnet pack $PROJECT_NAME -c Release -o ./nupkgs --nologo --no-build
120108

121109
- name: Push nuget packages
122110
if: github.event_name == 'release'

SonarQube.Analysis.xml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<SonarQubeAnalysisProperties xmlns="http://www.sonarsource.com/msbuild/integration/2015/1"
2+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
3+
<Property Name="sonar.host.url">https://sonarcloud.io</Property>
4+
<Property Name="sonar.projectName">ViennaNET</Property>
5+
<Property Name="sonar.projectDescription">
6+
Библиотеки классов, предоставляющая набор API расширяющих платформы .NET и AspNetCore.
7+
Оптимизирует производительность разработки, за счёт API решающего типовые задачи.
8+
</Property>
9+
<Property Name="sonar.links.homepage">https://github.com/Raiffeisen-DGTL/ViennaNET</Property>
10+
<Property Name="sonar.exclusions">artifacts/reports/*</Property>
11+
<Property Name="sonar.cs.junit.reportsPaths">artifacts/reports/*-nunit-tests-result.xml</Property>
12+
<Property Name="sonar.coverageReportPaths">artifacts/reports/SonarQube.xml</Property>
13+
<Property Name="sonar.qualitygate.wait">true</Property>
14+
</SonarQubeAnalysisProperties>
15+

src/Directory.Build.props

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@
1515
<RepositoryBranch>$(CI_COMMIT_REF_NAME)</RepositoryBranch>
1616
<RepositoryCommit>$(CI_COMMIT_SHA)</RepositoryCommit>
1717
<PackageProjectUrl>$(CI_PROJECT_URL)</PackageProjectUrl>
18-
<PackageVersion>$(GitVersion_NuGetVersion)</PackageVersion>
19-
<AssemblyVersion>$(GitVersion_AssemblySemVer)</AssemblyVersion>
20-
<FileVersion>$(GitVersion_AssemblySemFileVer)</FileVersion>
21-
<InformationalVersion>$(GitVersion_InformationalVersion)</InformationalVersion>
18+
<PackageVersion>$(GITVERSION_NUGETVERSION)</PackageVersion>
19+
<AssemblyVersion>$(GITVERSION_ASSEMBLYSEMVER)</AssemblyVersion>
20+
<FileVersion>$(GITVERSION_ASSEMBLYSEMFILEVER)</FileVersion>
21+
<InformationalVersion>$(GITVERSION_INFORMATIONALVERSION)</InformationalVersion>
2222
</PropertyGroup>
2323
</Project>

tests/Directory.Build.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.3.2"/>
1313
<PackageReference Include="NUnit" Version="3.13.3"/>
1414
<PackageReference Include="NUnit3TestAdapter" Version="4.2.1"/>
15-
<PackageReference Include="JunitXml.TestLogger" Version="3.0.114"/>
15+
<PackageReference Include="NunitXml.TestLogger" Version="3.1.15"/>
1616
<PackageReference Include="NUnit.Analyzers" Version="3.5.0"/>
1717
<PackageReference Include="Moq" Version="4.18.2"/>
1818
<PackageReference Include="coverlet.msbuild" Version="3.1.2">

tests/ViennaNET.Extensions.Configuration.Kubernetes.Tests/ConfigMapConfigurationProviderTests.cs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
using k8s;
22
using k8s.Models;
33
using Moq;
4-
using ViennaNET.Extensions.Configuration.Kubernetes.Internals;
54

65
namespace ViennaNET.Extensions.Configuration.Kubernetes.Tests;
76

@@ -168,8 +167,13 @@ public void OnEvent_Extract_WithDefaultFileName_Returns_TestOption()
168167
[Test]
169168
public void Dispose_Throws_Nothing()
170169
{
170+
var k8sClient = Mock.Of<IKubernetes>();
171+
var k8sClientBuilder = new Mock<IKubernetesClientBuilder>();
172+
173+
k8sClientBuilder.Setup(builder => builder.Build()).Returns(k8sClient);
174+
171175
var provider =
172-
new ConfigMapConfigurationProvider(new KubernetesConfigurationSource(), new KubernetesClientBuilder());
176+
new ConfigMapConfigurationProvider(new KubernetesConfigurationSource(), k8sClientBuilder.Object);
173177

174178
Assert.That(() => provider.Dispose(), Throws.Nothing);
175179
}

0 commit comments

Comments
 (0)