Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated copyright headers, fix code coverage reports #345

Merged
merged 2 commits into from
Jun 3, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
22 changes: 22 additions & 0 deletions DeterministicBuild.targets
@@ -0,0 +1,22 @@
<!-- Workaround. Remove once we're on 3.1.300+
https://github.com/dotnet/sourcelink/issues/572 -->
<Project>
<PropertyGroup>
<TargetFrameworkMonikerAssemblyAttributesPath>$([System.IO.Path]::Combine('$(IntermediateOutputPath)','$(TargetFrameworkMoniker).AssemblyAttributes$(DefaultLanguageSourceExtension)'))</TargetFrameworkMonikerAssemblyAttributesPath>
</PropertyGroup>
<ItemGroup>
<EmbeddedFiles Include="$(GeneratedAssemblyInfoFile)"/>
</ItemGroup>
<ItemGroup>
<SourceRoot Include="$(NuGetPackageRoot)" />
</ItemGroup>

<Target Name="CoverletGetPathMap"
DependsOnTargets="InitializeSourceRootMappedPaths"
Returns="@(_LocalTopLevelSourceRoot)"
Condition="'$(DeterministicSourcePaths)' == 'true'">
<ItemGroup>
<_LocalTopLevelSourceRoot Include="@(SourceRoot)" Condition="'%(SourceRoot.NestedRoot)' == ''"/>
</ItemGroup>
</Target>
</Project>
4 changes: 4 additions & 0 deletions Directory.Build.targets
@@ -0,0 +1,4 @@
<Project>
<!-- Deterministic build workaround -->
<Import Project="$(MSBuildThisFileDirectory)DeterministicBuild.targets" />
</Project>
61 changes: 43 additions & 18 deletions azure-pipelines.yml
Expand Up @@ -28,6 +28,16 @@ jobs:
inputs:
filePath: src/Connectors/EnableGemFire.ps1
arguments: $(PivNetAPIToken)
- task: UseDotNet@2
displayName: 'Install .NET Core 2.x SDK'
inputs:
packageType: sdk
version: 2.1.806
- task: UseDotNet@2
displayName: 'Install .NET Core 3.x SDK'
inputs:
packageType: sdk
version: 3.1.300
- task: DotNetCoreCLI@2
displayName: dotnet restore
inputs:
Expand All @@ -44,7 +54,7 @@ jobs:
inputs:
command: test
projects: '**/*.Test/*.csproj'
arguments: '-c $(buildConfiguration) -maxcpucount:1 --filter "Category!=SkipOnLinux"'
arguments: '--no-build -c $(buildConfiguration) -maxcpucount:1 --filter "Category!=SkipOnLinux"'
- job: MacOS_Build_and_Test
pool:
vmImage: 'macOS-latest'
Expand All @@ -58,12 +68,12 @@ jobs:
displayName: 'Install .NET Core 2.x SDK'
inputs:
packageType: sdk
version: 2.2.300
version: 2.1.806
- task: UseDotNet@2
displayName: 'Install .NET Core 3.x SDK'
inputs:
packageType: sdk
version: 3.0.100
version: 3.1.300
- task: DotNetCoreCLI@2
displayName: dotnet restore
inputs:
Expand All @@ -80,7 +90,7 @@ jobs:
inputs:
command: test
projects: '**/*.Test/*.csproj'
arguments: '-c $(buildConfiguration) -maxcpucount:1 --filter "Category!=SkipOnMacOS"'
arguments: '--no-build -c $(buildConfiguration) -maxcpucount:1 --filter "Category!=SkipOnMacOS"'
- job: Windows_Build_Test_and_Package
timeoutInMinutes: 90
pool:
Expand All @@ -105,6 +115,16 @@ jobs:
inputs:
filePath: src/Connectors/EnableGemFire.ps1
arguments: $(PivNetAPIToken)
- task: UseDotNet@2
displayName: 'Install .NET Core 2.x SDK'
inputs:
packageType: sdk
version: 2.1.806
- task: UseDotNet@2
displayName: 'Install .NET Core 3.x SDK'
inputs:
packageType: sdk
version: 3.1.300
- task: DotNetCoreCLI@2
displayName: dotnet restore
inputs:
Expand All @@ -117,29 +137,28 @@ jobs:
organization: 'steeltoeoss'
projectKey: 'SteeltoeOSS_steeltoe'
extraProperties: |
sonar.cs.opencover.reportsPaths=$(Build.SourcesDirectory)/**/coverage.opencover.xml
sonar.cs.vstest.reportsPaths=$(Agent.TempDirectory)/*.trx
sonar.exclusions=$(Build.SourcesDirectory)/src/Management/OpenCensus, $(Build.SourcesDirectory)/src/Management/OpenCensus.*
sonar.cs.opencover.reportsPaths=$(Build.SourcesDirectory)\**\*opencover.xml
sonar.cs.vstest.reportsPaths=$(Agent.TempDirectory)\*.trx
sonar.exclusions=$(Build.SourcesDirectory)\src\Management\OpenCensus*
sonar.coverage.exclusions=**/*Test*/**/*
- task: DotNetCoreCLI@2
displayName: dotnet pack
displayName: dotnet build
inputs:
command: 'pack'
command: 'build'
feedsToUse: 'select'
arguments: '--no-restore -c $(buildConfiguration) /p:TreatWarningsAsErrors=True /p:VersionPrefix=$(VersionPrefix) /p:VersionSuffix=$(VersionSuffix)'
packagesToPack: 'src/Steeltoe.All.sln'
arguments: '--no-restore -c $(buildConfiguration) /p:VersionPrefix=$(VersionPrefix) /p:VersionSuffix=$(VersionSuffix)'
projects: 'src/Steeltoe.All.sln'
versioningScheme: 'byEnvVar'
versionEnvVar: PackageVersion
- task: DotNetCoreCLI@2
displayName: dotnet test
inputs:
command: test
projects: 'src/Steeltoe.All.sln'
arguments: '-c $(buildConfiguration) -maxcpucount:1 /p:TreatWarningsAsErrors=True /p:CopyLocalLockFileAssemblies=true --filter "Category!=Integration" /p:CollectCoverage=true /p:CoverletOutputFormat="opencover" /p:Include="[Steeltoe.*]*" /p:Exclude="[*.Test]*"'
arguments: '--no-build -c $(buildConfiguration) -maxcpucount:1 /p:CopyLocalLockFileAssemblies=true --filter "Category!=Integration" /p:CollectCoverage=true /p:CoverletOutputFormat="opencover" /p:Include="[Steeltoe.*]*" /p:Exclude="[*.Test*]*%2c[*]Microsoft.Diagnostics*"'
# Generate the report using ReportGenerator (https://github.com/danielpalme/ReportGenerator)
# First install the tool on the machine, then run it
- pwsh: |
dotnet tool install -g dotnet-reportgenerator-globaltool
reportgenerator "-reports:**\coverage.opencover.xml" "-targetdir:$(Build.SourcesDirectory)\CodeCoverage" -reporttypes:Cobertura
- pwsh: dotnet tool install -g dotnet-reportgenerator-globaltool; reportgenerator "-reports:**\*.opencover.xml" "-targetdir:$(Build.SourcesDirectory)\CodeCoverage" -reporttypes:Cobertura
displayName: Create Code coverage report
condition: always()
# Publish the code coverage result (summary and web site)
Expand All @@ -152,9 +171,7 @@ jobs:
summaryFileLocation: '$(Build.SourcesDirectory)\CodeCoverage\Cobertura.xml'
reportDirectory: '$(Build.SourcesDirectory)\CodeCoverage'
condition: always()
- pwsh: |
choco install codecov
codecov -f "$(Build.SourcesDirectory)\CodeCoverage\Cobertura.xml" -t $env:CodeCovToken
- pwsh: choco install codecov --no-progress; codecov -f "$(Build.SourcesDirectory)\CodeCoverage\Cobertura.xml" -t $env:CodeCovToken
env:
CodeCovToken: $(CodeCovToken)
displayName: Install and Run CodeCov
Expand All @@ -165,6 +182,14 @@ jobs:
- task: SonarSource.sonarcloud.38b27399-a642-40af-bb7d-9971f69712e8.SonarCloudPublish@1
displayName: Publish Quality Gate Result
condition: always()
- task: DotNetCoreCLI@2
displayName: dotnet pack
inputs:
command: 'pack'
feedsToUse: 'select'
packagesToPack: 'src/Steeltoe.All.sln'
versioningScheme: 'byEnvVar'
versionEnvVar: PackageVersion
- task: PowerShell@2
displayName: Authenticode Sign Packages
inputs:
Expand Down
4 changes: 4 additions & 0 deletions sharedtest.props
Expand Up @@ -5,6 +5,10 @@
<PropertyGroup>
<LangVersion>latest</LangVersion>
</PropertyGroup>
<PropertyGroup Condition="'$(TF_BUILD)' == 'true'">
<ContinuousIntegrationBuild>true</ContinuousIntegrationBuild>
<EmbedUntrackedSources>true</EmbedUntrackedSources>
</PropertyGroup>
<ItemGroup>
<AdditionalFiles Include="..\..\..\..\stylecop.json">
<Link>stylecop.json</Link>
Expand Down
@@ -1,16 +1,6 @@
// Copyright 2017 the original author or authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the Apache 2.0 License.
// See the LICENSE file in the project root for more information.

using System;
using System.Runtime.CompilerServices;
Expand Down
@@ -1,16 +1,6 @@
// Copyright 2017 the original author or authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the Apache 2.0 License.
// See the LICENSE file in the project root for more information.

using Microsoft.AspNetCore.Mvc;
using Steeltoe.CircuitBreaker.Hystrix.Config;
Expand Down
@@ -1,16 +1,6 @@
// Copyright 2017 the original author or authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the Apache 2.0 License.
// See the LICENSE file in the project root for more information.

using Microsoft.AspNetCore.Mvc;
using Steeltoe.CircuitBreaker.Hystrix.Metric.Consumer;
Expand Down
@@ -1,16 +1,6 @@
// Copyright 2017 the original author or authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the Apache 2.0 License.
// See the LICENSE file in the project root for more information.

using Microsoft.AspNetCore.Mvc;
using Steeltoe.CircuitBreaker.Hystrix.Metric;
Expand Down
@@ -1,16 +1,6 @@
// Copyright 2017 the original author or authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the Apache 2.0 License.
// See the LICENSE file in the project root for more information.

using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
Expand Down
@@ -1,16 +1,6 @@
// Copyright 2017 the original author or authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the Apache 2.0 License.
// See the LICENSE file in the project root for more information.

using Microsoft.AspNetCore.Mvc;
using Steeltoe.CircuitBreaker.Hystrix.Metric.Sample;
Expand Down
@@ -1,16 +1,6 @@
// Copyright 2017 the original author or authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the Apache 2.0 License.
// See the LICENSE file in the project root for more information.

using Microsoft.AspNetCore.Builder;

Expand Down
@@ -1,16 +1,6 @@
// Copyright 2017 the original author or authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the Apache 2.0 License.
// See the LICENSE file in the project root for more information.

using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
Expand Down
@@ -1,16 +1,6 @@
// Copyright 2017 the original author or authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the Apache 2.0 License.
// See the LICENSE file in the project root for more information.

using System.Reflection;
using System.Runtime.CompilerServices;
Expand Down
@@ -1,16 +1,6 @@
// Copyright 2017 the original author or authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the Apache 2.0 License.
// See the LICENSE file in the project root for more information.

using Autofac;
using Microsoft.Extensions.Configuration;
Expand Down
@@ -1,16 +1,6 @@
// Copyright 2017 the original author or authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the Apache 2.0 License.
// See the LICENSE file in the project root for more information.

using System.Reflection;
using System.Runtime.CompilerServices;
Expand Down