Skip to content

Commit

Permalink
Set up CI with Azure Pipelines (#210)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
azure-pipelines[bot] authored and StefH committed Oct 27, 2018
1 parent 7a6bf6c commit a8e5143
Show file tree
Hide file tree
Showing 103 changed files with 23,031 additions and 6,003 deletions.
19 changes: 19 additions & 0 deletions Directory.Build.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<Project>
<PropertyGroup>
<MsBuildAllProjects>$(MsBuildAllProjects);$(MsBuildThisFileFullPath)</MsBuildAllProjects>
</PropertyGroup>

<PropertyGroup>
<VersionPrefix>1.0.9.1</VersionPrefix>
</PropertyGroup>

<Choose>
<!-- The environment variable `Prerelease` is set in the azure-pipelines.yml file. -->
<When Condition=" '$(Prerelease)' != '' ">
<PropertyGroup>
<!-- Set the version to x.x.x.x-{Prerelease}-1{Build_BuildId} (this is same buildId as defined in the azure-pipelines.yml file). -->
<VersionSuffix>$(Prerelease)-1$(BUILD_BUILDID)</VersionSuffix>
</PropertyGroup>
</When>
</Choose>
</Project>
15 changes: 9 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ This is a **.NET Core / Standard port** of the Microsoft assembly for the .Net 4

# Overview
With this library it's possible to write Dynamic LINQ queries (string based) on an `IQueryable`:
```csharp
``` c#
var query = db.Customers
.Where("City == @0 and Orders.Count >= @1", "London", 10)
.OrderBy("CompanyName")
Expand All @@ -24,7 +24,7 @@ There are several documentation resources:
| &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) |
| | |
| ***Quality*** | &nbsp; |
| &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) |
| &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) |
| &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)
| &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) |
| &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) |
Expand All @@ -34,10 +34,13 @@ There are several documentation resources:
| &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) |
| |
| ***Nuget*** | &nbsp; |
| &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) |
| &nbsp;&nbsp;**EntityFramework.DynamicLinq** | [![NuGet Badge](https://buildstats.info/nuget/EntityFramework.DynamicLinq)](https://www.nuget.org/packages/EntityFramework.DynamicLinq) |
| &nbsp;&nbsp;**Microsoft.EntityFrameworkCore.DynamicLinq** | [![NuGet Badge](https://buildstats.info/nuget/Microsoft.EntityFrameworkCore.DynamicLinq)](https://www.nuget.org/packages/Microsoft.EntityFrameworkCore.DynamicLinq) |

| &nbsp;&nbsp;**System.Linq.Dynamic.Core** | [![NuGet](https://buildstats.info/nuget/System.Linq.Dynamic.Core)](https://www.nuget.org/packages/System.Linq.Dynamic.Core) |
| &nbsp;&nbsp;**EntityFramework.DynamicLinq** | [![NuGet](https://buildstats.info/nuget/EntityFramework.DynamicLinq)](https://www.nuget.org/packages/EntityFramework.DynamicLinq) |
| &nbsp;&nbsp;**Microsoft.EntityFrameworkCore.DynamicLinq** | [![NuGet](https://buildstats.info/nuget/Microsoft.EntityFrameworkCore.DynamicLinq)](https://www.nuget.org/packages/Microsoft.EntityFrameworkCore.DynamicLinq) |
| ***MyGet (previews)*** | &nbsp; |
| &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) |
| &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) |
| &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) |

# Development Details

Expand Down
5 changes: 3 additions & 2 deletions System.Linq.Dynamic.Core.sln
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,13 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
ProjectSection(SolutionItems) = preProject
.deployment = .deployment
appveyor.yml = appveyor.yml
azure-pipelines.yml = azure-pipelines.yml
CHANGELOG.md = CHANGELOG.md
ChangeLog.txt = ChangeLog.txt
codecov-local.cmd = codecov-local.cmd
codecov.yml = codecov.yml
Directory.Build.props = Directory.Build.props
LICENSE = LICENSE
README.md = README.md
report\run-coverlet-local.cmd = report\run-coverlet-local.cmd
EndProjectSection
EndProject
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}"
Expand Down
86 changes: 86 additions & 0 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
pool:
vmImage: 'vs2017-win2016'

variables:
Prerelease: 'ci'
buildType: 'azure-pipelines-ci'
buildId: "1$(Build.BuildId)"
buildProjects: '**/src/**/+(System.Linq.Dynamic.Core|EntityFramework.DynamicLinq|Microsoft.EntityFrameworkCore.DynamicLinq).csproj'

steps:
# Print buildId
- script: |
echo "BuildId = $(buildId)"
displayName: 'Print buildId'

# Install SonarScanner
- script: |
dotnet tool install --global dotnet-sonarscanner
displayName: Install SonarScanner

# Begin SonarScanner
# See also
# - 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.`
# - https://github.com/dotnet/cli/issues/8368
# - https://github.com/Microsoft/vsts-tasks/issues/8291
#
- script: |
%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"
displayName: Begin SonarScanner

- task: DotNetCoreCLI@2
displayName: Build Projects in Debug configuration
inputs:
command: 'build'
arguments: /p:Configuration=Debug # https://github.com/MicrosoftDocs/vsts-docs/issues/1976
projects: $(buildProjects)


# Build tests and run tests for net452 and netcoreapp2.1 (with coverage)
- script: |
dotnet test ./test/System.Linq.Dynamic.Core.Tests/System.Linq.Dynamic.Core.Tests.csproj --configuration Debug --framework net452
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
displayName: 'Build tests and run tests for net452 and netcoreapp2.1 (with coverage)'

# End SonarScanner
- script: |
%USERPROFILE%\.dotnet\tools\dotnet-sonarscanner end /d:sonar.login="$(SONAR_TOKEN)"
displayName: End SonarScanner

- task: PublishTestResults@2
inputs:
testRunner: VSTest
testResultsFiles: '**/*.trx'

# Based on https://whereslou.com/2018/09/versioning-and-publishing-nuget-packages-automatically-using-azure-devops-pipelines/
- task: DotNetCoreCLI@2
displayName: Build Projects in Release configuration
inputs:
command: 'build'
arguments: /p:Configuration=Release # https://github.com/MicrosoftDocs/vsts-docs/issues/1976
projects: $(buildProjects)

- task: DotNetCoreCLI@2
displayName: Pack
condition: and(succeeded(), ne(variables['Build.Reason'], 'PullRequest')) # Do not run for PullRequests
inputs:
command: pack
configuration: 'Release'
packagesToPack: $(buildProjects)
nobuild: true
packDirectory: '$(Build.ArtifactStagingDirectory)/packages'
verbosityPack: 'normal'

- task: PublishBuildArtifacts@1
displayName: Publish Artifacts
condition: and(succeeded(), ne(variables['Build.Reason'], 'PullRequest')) # Do not run for PullRequests
inputs:
PathtoPublish: '$(Build.ArtifactStagingDirectory)'

- task: DotNetCoreCLI@2
displayName: Push to MyGet
condition: and(succeeded(), ne(variables['Build.Reason'], 'PullRequest')) # Do not run for PullRequests
inputs:
command: custom
custom: nuget
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)
7 changes: 0 additions & 7 deletions codecov-local.cmd

This file was deleted.

This file was deleted.

30 changes: 0 additions & 30 deletions report/Microsoft.EntityFrameworkCore.DynamicLinq_Res.htm

This file was deleted.

Loading

0 comments on commit a8e5143

Please sign in to comment.