Skip to content
This repository has been archived by the owner on Oct 6, 2020. It is now read-only.

Commit

Permalink
feat: Adding Fake build, Codecov and AppVeyor support
Browse files Browse the repository at this point in the history
  • Loading branch information
StanleyGoldman committed Jan 20, 2019
1 parent a7fe179 commit af6a78a
Show file tree
Hide file tree
Showing 10 changed files with 78 additions and 24 deletions.
33 changes: 18 additions & 15 deletions Build.fsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,32 +46,38 @@ Target.create "Build" (fun _ ->

!! "SonOfPicasso.sln"
|> MSBuild.runRelease configuration null "Build"
|> Trace.logItems "AppBuild-Output: "
|> Trace.logItems "Build-Output: "
)

(*
Target.create "Test" (fun _ ->
List.allPairs ["BCC.Core.Tests"] ["net471" ; "netcoreapp2.1"]
|> Seq.iter (fun (proj, framework) ->
[
("SonOfPicasso.Core.Tests", "netcoreapp2.1");
("SonOfPicasso.UI.Tests", "net472");
]
|> Seq.iter (fun (proj, framework) ->
(
let projectPath = sprintf "src\\%s\\%s.csproj" proj proj
let reportFile = sprintf "%s-%s.results.trx" proj framework

let configuration: (DotNet.TestOptions -> DotNet.TestOptions)
= (fun t -> {t with
Configuration = DotNet.BuildConfiguration.Release
NoBuild = true
Framework = Some framework
Logger = Some (sprintf "trx;LogFileName=%s" reportFile)
ResultsDirectory = Some "../../reports"})
Configuration = DotNet.BuildConfiguration.Release
NoBuild = true
Framework = Some framework
Logger = Some (sprintf "trx;LogFileName=%s" reportFile)
ResultsDirectory = Some "../../reports"})

DotNet.test configuration projectPath

Trace.publish ImportData.BuildArtifact (sprintf "reports/%s" reportFile)
)
))
)

Target.create "Coverage" (fun _ ->
List.allPairs ["BCC.Core.Tests"] ["net471" ; "netcoreapp2.1"]
[
("SonOfPicasso.Core.Tests", "netcoreapp2.1");
("SonOfPicasso.UI.Tests", "net472");
]
|> Seq.iter (fun (proj, framework) ->
let dllPath = sprintf "src\\%s\\bin\\Release\\%s\\%s.dll" proj framework proj
let projectPath = sprintf "src\\%s\\%s.csproj" proj proj
Expand All @@ -91,19 +97,16 @@ Target.create "Coverage" (fun _ ->
|> ignore
)
)
*)

Target.create "Default" (fun _ ->
()
)

open Fake.Core.TargetOperators
"Clean" ==> "Build" ==> "Default"
"Clean" ==> "Build"

(*
"Build" ==> "Test" ==> "Default"
"Build" ==> "Coverage" ==> "Default"
*)

// start build
Target.runOrDefault "Default"
32 changes: 32 additions & 0 deletions codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
codecov:
notify:
require_ci_to_pass: yes

coverage:
precision: 2
round: down
range: "70...100"

status:
project: yes
patch: yes
changes: no

parsers:
gcov:
branch_detection:
conditional: yes
loop: yes
method: no
macro: no

comment:
layout: "header, diff, files"
behavior: once
require_changes: no

fixes:
- "/C/projects/son-of-picasso/::"

ignore:
- "*Tests/"
1 change: 0 additions & 1 deletion paket.dependencies
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,5 @@ group FakeBuild
nuget Fake.BuildServer.AppVeyor
nuget Fake.DotNet.Cli
nuget Fake.DotNet.MSBuild
nuget Fake.DotNet.Testing.XUnit2
nuget Fake.IO.FileSystem
nuget Fake.Tools.GitVersion
6 changes: 5 additions & 1 deletion src/SonOfPicasso.Core.Tests/SonOfPicasso.Core.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,14 @@

<PropertyGroup>
<TargetFramework>netcoreapp2.1</TargetFramework>

<IsPackable>false</IsPackable>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
</PropertyGroup>

<ItemGroup>
<Compile Include="..\common\SharedAssemblyInfo.cs" Link="Properties\SharedAssemblyInfo.cs" Condition="Exists('..\common\SharedAssemblyInfo.cs')" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Bogus" Version="25.0.3" />
<PackageReference Include="FluentAssertions" Version="5.6.0" />
Expand Down
7 changes: 6 additions & 1 deletion src/SonOfPicasso.Core/SonOfPicasso.Core.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
</PropertyGroup>

<ItemGroup>
Expand All @@ -13,6 +14,10 @@
<PackageReference Include="System.IO.Abstractions" Version="3.0.10" />
<PackageReference Include="System.Reactive" Version="4.1.2" />
</ItemGroup>

<ItemGroup>
<Compile Include="..\common\SharedAssemblyInfo.cs" Link="Properties\SharedAssemblyInfo.cs" Condition="Exists('..\common\SharedAssemblyInfo.cs')" />
</ItemGroup>

<ItemGroup>
<Reference Include="Microsoft.Extensions.Logging.Abstractions">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
</PropertyGroup>

<ItemGroup>
Expand All @@ -13,6 +14,10 @@
<PackageReference Include="Serilog.Extensions.Logging" Version="2.0.2" />
<PackageReference Include="Serilog.Sinks.XUnit" Version="1.0.7" />
</ItemGroup>

<ItemGroup>
<Compile Include="..\common\SharedAssemblyInfo.cs" Link="Properties\SharedAssemblyInfo.cs" Condition="Exists('..\common\SharedAssemblyInfo.cs')" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\SonOfPicasso.Core\SonOfPicasso.Core.csproj" />
Expand Down
4 changes: 2 additions & 2 deletions src/SonOfPicasso.UI.Tests/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@
[assembly: Guid("95cceaee-8a44-40d2-975a-defdaed35523")]

// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
// [assembly: AssemblyVersion("1.0.0.0")]
// [assembly: AssemblyFileVersion("1.0.0.0")]
7 changes: 5 additions & 2 deletions src/SonOfPicasso.UI.Tests/SonOfPicasso.UI.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -26,19 +26,22 @@
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<OutputPath>bin\Debug\net472\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<OutputPath>bin\Release\net472\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Compile Include="..\common\SharedAssemblyInfo.cs" Link="Properties\SharedAssemblyInfo.cs" Condition="Exists('..\common\SharedAssemblyInfo.cs')" />
</ItemGroup>
<ItemGroup>
<Reference Include="Bogus, Version=25.0.3.0, Culture=neutral, PublicKeyToken=fa1bb3f3f218129a, processorArchitecture=MSIL">
<HintPath>..\..\packages\Bogus.25.0.3\lib\net40\Bogus.dll</HintPath>
Expand Down
4 changes: 2 additions & 2 deletions src/SonOfPicasso.UI/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,5 +51,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
// [assembly: AssemblyVersion("1.0.0.0")]
// [assembly: AssemblyFileVersion("1.0.0.0")]
3 changes: 3 additions & 0 deletions src/SonOfPicasso.UI/SonOfPicasso.UI.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Compile Include="..\common\SharedAssemblyInfo.cs" Link="Properties\SharedAssemblyInfo.cs" Condition="Exists('..\common\SharedAssemblyInfo.cs')" />
</ItemGroup>
<ItemGroup>
<Reference Include="Akavache, Version=6.2.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\..\packages\akavache.6.2.3\lib\net461\Akavache.dll</HintPath>
Expand Down

0 comments on commit af6a78a

Please sign in to comment.