Skip to content

Commit a8e5143

Browse files
azure-pipelines[bot]StefH
authored andcommitted
Set up CI with Azure Pipelines (#210)
* Set up CI with Azure Pipelines * buildProjects * buildProjects * AppVeyor.csproj * task: MSBuild@1 * remove net35 * buildProjects * buildProjects: [ * - script: | * buildProjects * buildProjects: | '' * buildProjects: **/src/System.Linq.Dynamic.Core/System.Linq.Dynamic.Core.AppVeyor.csproj * Update tests * buildProjects: '**/src/System.Linq.Dynamic.Core/System.Linq.Dynamic.Core.csproj' * . * fix yml * fix tests * fix tests * version * 3 projects * myget * coverlet * Build System.Linq.Dynamic.Core.Tests also for net452
1 parent 7a6bf6c commit a8e5143

File tree

103 files changed

+23031
-6003
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

103 files changed

+23031
-6003
lines changed

Directory.Build.props

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<Project>
2+
<PropertyGroup>
3+
<MsBuildAllProjects>$(MsBuildAllProjects);$(MsBuildThisFileFullPath)</MsBuildAllProjects>
4+
</PropertyGroup>
5+
6+
<PropertyGroup>
7+
<VersionPrefix>1.0.9.1</VersionPrefix>
8+
</PropertyGroup>
9+
10+
<Choose>
11+
<!-- The environment variable `Prerelease` is set in the azure-pipelines.yml file. -->
12+
<When Condition=" '$(Prerelease)' != '' ">
13+
<PropertyGroup>
14+
<!-- Set the version to x.x.x.x-{Prerelease}-1{Build_BuildId} (this is same buildId as defined in the azure-pipelines.yml file). -->
15+
<VersionSuffix>$(Prerelease)-1$(BUILD_BUILDID)</VersionSuffix>
16+
</PropertyGroup>
17+
</When>
18+
</Choose>
19+
</Project>

README.md

+9-6
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ This is a **.NET Core / Standard port** of the Microsoft assembly for the .Net 4
33

44
# Overview
55
With this library it's possible to write Dynamic LINQ queries (string based) on an `IQueryable`:
6-
```csharp
6+
``` c#
77
var query = db.Customers
88
.Where("City == @0 and Orders.Count >= @1", "London", 10)
99
.OrderBy("CompanyName")
@@ -24,7 +24,7 @@ There are several documentation resources:
2424
| &nbsp;&nbsp;**Issues** | [![GitHub issues](https://img.shields.io/github/issues/StefH/System.Linq.Dynamic.Core.svg)](https://github.com/StefH/System.Linq.Dynamic.Core/issues) |
2525
| | |
2626
| ***Quality*** | &nbsp; |
27-
| &nbsp;&nbsp;**Build** | [![Build status](https://ci.appveyor.com/api/projects/status/0c4v2bsvdqd57600?svg=true)](https://ci.appveyor.com/project/StefH/system-linq-dynamic-core) |
27+
| &nbsp;&nbsp;**Build Azure** | [![Build Status Azure](https://stef.visualstudio.com/System.Linq.Dynamic.Core/_apis/build/status/StefH.System.Linq.Dynamic.Core)](https://stef.visualstudio.com/System.Linq.Dynamic.Core/_build/latest?definitionId=12) |
2828
| &nbsp;&nbsp;**CodeFactor** | [![CodeFactor](https://www.codefactor.io/repository/github/stefh/system.linq.dynamic.core/badge)](https://www.codefactor.io/repository/github/stefh/system.linq.dynamic.core)
2929
| &nbsp;&nbsp;**Sonar Quality Gate** | [![Sonar Quality Gate](https://sonarcloud.io/api/project_badges/measure?project=system.linq.dynamic.core&metric=alert_status)](https://sonarcloud.io/project/issues?id=system.linq.dynamic.core) |
3030
| &nbsp;&nbsp;**Sonar Bugs** | [![Sonar Bugs](https://sonarcloud.io/api/project_badges/measure?project=system.linq.dynamic.core&metric=bugs)](https://sonarcloud.io/project/issues?id=system.linq.dynamic.core&resolved=false&types=BUG) |
@@ -34,10 +34,13 @@ There are several documentation resources:
3434
| &nbsp;&nbsp;**Coveralls** | [![Coverage Status](https://coveralls.io/repos/github/StefH/System.Linq.Dynamic.Core/badge.svg?branch=master)](https://coveralls.io/github/StefH/System.Linq.Dynamic.Core?branch=master) |
3535
| |
3636
| ***Nuget*** | &nbsp; |
37-
| &nbsp;&nbsp;**System.Linq.Dynamic.Core** | [![NuGet Badge](https://buildstats.info/nuget/System.Linq.Dynamic.Core)](https://www.nuget.org/packages/System.Linq.Dynamic.Core) |
38-
| &nbsp;&nbsp;**EntityFramework.DynamicLinq** | [![NuGet Badge](https://buildstats.info/nuget/EntityFramework.DynamicLinq)](https://www.nuget.org/packages/EntityFramework.DynamicLinq) |
39-
| &nbsp;&nbsp;**Microsoft.EntityFrameworkCore.DynamicLinq** | [![NuGet Badge](https://buildstats.info/nuget/Microsoft.EntityFrameworkCore.DynamicLinq)](https://www.nuget.org/packages/Microsoft.EntityFrameworkCore.DynamicLinq) |
40-
37+
| &nbsp;&nbsp;**System.Linq.Dynamic.Core** | [![NuGet](https://buildstats.info/nuget/System.Linq.Dynamic.Core)](https://www.nuget.org/packages/System.Linq.Dynamic.Core) |
38+
| &nbsp;&nbsp;**EntityFramework.DynamicLinq** | [![NuGet](https://buildstats.info/nuget/EntityFramework.DynamicLinq)](https://www.nuget.org/packages/EntityFramework.DynamicLinq) |
39+
| &nbsp;&nbsp;**Microsoft.EntityFrameworkCore.DynamicLinq** | [![NuGet](https://buildstats.info/nuget/Microsoft.EntityFrameworkCore.DynamicLinq)](https://www.nuget.org/packages/Microsoft.EntityFrameworkCore.DynamicLinq) |
40+
| ***MyGet (previews)*** | &nbsp; |
41+
| &nbsp;&nbsp;**System.Linq.Dynamic.Core** | [![MyGet](https://buildstats.info/myget/system-linq-dynamic-core/System.Linq.Dynamic.Core)](https://www.myget.org/feed/system-linq-dynamic-corepackage/nuget/System.Linq.Dynamic.Core) |
42+
| &nbsp;&nbsp;**EntityFramework.DynamicLinq** | [![MyGet](https://buildstats.info/myget/system-linq-dynamic-core/EntityFramework.DynamicLinq)](https://www.myget.org/feed/system-linq-dynamic-corepackage/nuget/EntityFramework.DynamicLinq) |
43+
| &nbsp;&nbsp;**Microsoft.EntityFrameworkCore.DynamicLinq** | [![MyGet](https://buildstats.info/myget/system-linq-dynamic-core/Microsoft.EntityFrameworkCore.DynamicLinq)](https://www.myget.org/feed/system-linq-dynamic-corepackage/nuget/Microsoft.EntityFrameworkCore.DynamicLinq) |
4144

4245
# Development Details
4346

System.Linq.Dynamic.Core.sln

+3-2
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,13 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
1111
ProjectSection(SolutionItems) = preProject
1212
.deployment = .deployment
1313
appveyor.yml = appveyor.yml
14+
azure-pipelines.yml = azure-pipelines.yml
1415
CHANGELOG.md = CHANGELOG.md
1516
ChangeLog.txt = ChangeLog.txt
16-
codecov-local.cmd = codecov-local.cmd
17-
codecov.yml = codecov.yml
17+
Directory.Build.props = Directory.Build.props
1818
LICENSE = LICENSE
1919
README.md = README.md
20+
report\run-coverlet-local.cmd = report\run-coverlet-local.cmd
2021
EndProjectSection
2122
EndProject
2223
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EntityFramework.DynamicLinq.Tests.net452", "test\EntityFramework.DynamicLinq.Tests.net452\EntityFramework.DynamicLinq.Tests.net452.csproj", "{6B45E89C-0788-4942-924F-EF6397114BD1}"

azure-pipelines.yml

+86
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
pool:
2+
vmImage: 'vs2017-win2016'
3+
4+
variables:
5+
Prerelease: 'ci'
6+
buildType: 'azure-pipelines-ci'
7+
buildId: "1$(Build.BuildId)"
8+
buildProjects: '**/src/**/+(System.Linq.Dynamic.Core|EntityFramework.DynamicLinq|Microsoft.EntityFrameworkCore.DynamicLinq).csproj'
9+
10+
steps:
11+
# Print buildId
12+
- script: |
13+
echo "BuildId = $(buildId)"
14+
displayName: 'Print buildId'
15+
16+
# Install SonarScanner
17+
- script: |
18+
dotnet tool install --global dotnet-sonarscanner
19+
displayName: Install SonarScanner
20+
21+
# Begin SonarScanner
22+
# See also
23+
# - https://docs.microsoft.com/en-us/dotnet/core/tools/global-tools, else you get this error: `Since you just installed the .NET Core SDK, you will need to reopen the Command Prompt window before running the tool you installed.`
24+
# - https://github.com/dotnet/cli/issues/8368
25+
# - https://github.com/Microsoft/vsts-tasks/issues/8291
26+
#
27+
- script: |
28+
%USERPROFILE%\.dotnet\tools\dotnet-sonarscanner begin /k:"system.linq.dynamic.core" /d:sonar.organization="stefh-github" /d:sonar.host.url="https://sonarcloud.io" /d:sonar.login="$(SONAR_TOKEN)" /v:"$(buildId)" /d:sonar.cs.opencover.reportsPaths="**\coverage.opencover.xml"
29+
displayName: Begin SonarScanner
30+
31+
- task: DotNetCoreCLI@2
32+
displayName: Build Projects in Debug configuration
33+
inputs:
34+
command: 'build'
35+
arguments: /p:Configuration=Debug # https://github.com/MicrosoftDocs/vsts-docs/issues/1976
36+
projects: $(buildProjects)
37+
38+
39+
# Build tests and run tests for net452 and netcoreapp2.1 (with coverage)
40+
- script: |
41+
dotnet test ./test/System.Linq.Dynamic.Core.Tests/System.Linq.Dynamic.Core.Tests.csproj --configuration Debug --framework net452
42+
dotnet test ./test/System.Linq.Dynamic.Core.Tests/System.Linq.Dynamic.Core.Tests.csproj --configuration Debug --framework netcoreapp2.1 --logger trx /p:CollectCoverage=true /p:CoverletOutputFormat=opencover
43+
displayName: 'Build tests and run tests for net452 and netcoreapp2.1 (with coverage)'
44+
45+
# End SonarScanner
46+
- script: |
47+
%USERPROFILE%\.dotnet\tools\dotnet-sonarscanner end /d:sonar.login="$(SONAR_TOKEN)"
48+
displayName: End SonarScanner
49+
50+
- task: PublishTestResults@2
51+
inputs:
52+
testRunner: VSTest
53+
testResultsFiles: '**/*.trx'
54+
55+
# Based on https://whereslou.com/2018/09/versioning-and-publishing-nuget-packages-automatically-using-azure-devops-pipelines/
56+
- task: DotNetCoreCLI@2
57+
displayName: Build Projects in Release configuration
58+
inputs:
59+
command: 'build'
60+
arguments: /p:Configuration=Release # https://github.com/MicrosoftDocs/vsts-docs/issues/1976
61+
projects: $(buildProjects)
62+
63+
- task: DotNetCoreCLI@2
64+
displayName: Pack
65+
condition: and(succeeded(), ne(variables['Build.Reason'], 'PullRequest')) # Do not run for PullRequests
66+
inputs:
67+
command: pack
68+
configuration: 'Release'
69+
packagesToPack: $(buildProjects)
70+
nobuild: true
71+
packDirectory: '$(Build.ArtifactStagingDirectory)/packages'
72+
verbosityPack: 'normal'
73+
74+
- task: PublishBuildArtifacts@1
75+
displayName: Publish Artifacts
76+
condition: and(succeeded(), ne(variables['Build.Reason'], 'PullRequest')) # Do not run for PullRequests
77+
inputs:
78+
PathtoPublish: '$(Build.ArtifactStagingDirectory)'
79+
80+
- task: DotNetCoreCLI@2
81+
displayName: Push to MyGet
82+
condition: and(succeeded(), ne(variables['Build.Reason'], 'PullRequest')) # Do not run for PullRequests
83+
inputs:
84+
command: custom
85+
custom: nuget
86+
arguments: push $(Build.ArtifactStagingDirectory)\packages\*.nupkg --source https://www.myget.org/F/system-linq-dynamic-core/api/v3/index.json --no-service-endpoint --api-key $(MyGetKey)

codecov-local.cmd

-7
This file was deleted.

report/Microsoft.EntityFrameworkCore.DynamicLinq_DynamicFunctions.htm

-30
This file was deleted.

report/Microsoft.EntityFrameworkCore.DynamicLinq_Res.htm

-30
This file was deleted.

0 commit comments

Comments
 (0)