Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
cuteant committed Sep 13, 2020
1 parent 4d8d85c commit a22660c
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 6 deletions.
19 changes: 14 additions & 5 deletions build.fsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,20 @@ open System.Text

open Fake
open Fake.DotNetCli
open Fake.NuGet.Install

// Variables
let configuration = "Debug"
let solution = System.IO.Path.GetFullPath(string "./DotNetty.sln")

// Directories
let toolsDir = __SOURCE_DIRECTORY__ @@ "tools"
let output = __SOURCE_DIRECTORY__ @@ "bin"
let outputTests = __SOURCE_DIRECTORY__ @@ "TestResults"
let outputPerfTests = __SOURCE_DIRECTORY__ @@ "PerfResults"
let output = __SOURCE_DIRECTORY__ @@ "Artifacts"
let outputTests = output @@ "TestResults"
let outputPerfTests = output @@ "PerfResults"

let buildNumber = environVarOrDefault "BUILD_NUMBER" "0"
let hasTeamCity = (not (buildNumber = "0")) // check if we have the TeamCity environment variable for build # set
let preReleaseVersionSuffix = "beta" + (if (not (buildNumber = "0")) then (buildNumber) else DateTime.UtcNow.Ticks.ToString())

let releaseNotes =
Expand Down Expand Up @@ -53,6 +55,7 @@ Target "Clean" (fun _ ->
CleanDir outputTests
CleanDir outputPerfTests

CleanDirs !! "./**/TestResults"
CleanDirs !! "./**/bin"
CleanDirs !! "./**/obj"
)
Expand Down Expand Up @@ -220,7 +223,10 @@ Target "RunTests" (fun _ ->
rawProjects |> Seq.choose filterProjects

let runSingleProject project =
let arguments = (sprintf "test -c Debug --no-build --logger:trx --logger:\"console;verbosity=Normal\" --framework %s -- RunConfiguration.TargetPlatform=x64 --results-directory \"%s\" -- -parallel none" testNetFrameworkVersion outputTests)
let arguments =
match (hasTeamCity) with
| true -> (sprintf "test -c Debug --no-build --logger:trx --logger:\"console;verbosity=normal\" --framework %s -- RunConfiguration.TargetPlatform=x64 --results-directory \"%s\" -- -parallel none -teamcity" testNetFrameworkVersion outputTests)
| false -> (sprintf "test -c Debug --no-build --logger:trx --logger:\"console;verbosity=normal\" --framework %s -- RunConfiguration.TargetPlatform=x64 --results-directory \"%s\" -- -parallel none" testNetFrameworkVersion outputTests)

let result = ExecProcess(fun info ->
info.FileName <- "dotnet"
Expand All @@ -246,7 +252,10 @@ Target "RunTestsNetCore" (fun _ ->
rawProjects |> Seq.choose filterProjects

let runSingleProject project =
let arguments = (sprintf "test -c Debug --no-build --logger:trx --logger:\"console;verbosity=Normal\" --framework %s -- RunConfiguration.TargetPlatform=x64 --results-directory \"%s\" -- -parallel none" testNetCoreVersion outputTests)
let arguments =
match (hasTeamCity) with
| true -> (sprintf "test -c Debug --no-build --logger:trx --logger:\"console;verbosity=normal\" --framework %s -- RunConfiguration.TargetPlatform=x64 --results-directory \"%s\" -- -parallel none -teamcity" testNetCoreVersion outputTests)
| false -> (sprintf "test -c Debug --no-build --logger:trx --logger:\"console;verbosity=normal\" --framework %s -- RunConfiguration.TargetPlatform=x64 --results-directory \"%s\" -- -parallel none" testNetCoreVersion outputTests)

let result = ExecProcess(fun info ->
info.FileName <- "dotnet"
Expand Down
7 changes: 7 additions & 0 deletions build/azure-pipeline.template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,13 @@ jobs:
testResultsFiles: '**/*.trx' #TestResults folder usually
testRunTitle: ${{ parameters.name }}
mergeTestResults: true
- task: CopyFiles@2
displayName: 'Copy Build Output'
inputs:
sourceFolder: ${{ parameters.outputDirectory }}
contents: '**\*'
targetFolder: $(Build.ArtifactStagingDirectory)
continueOnError: boolean # 'true' if future steps should run even if this step fails; defaults to 'false'
- script: 'echo 1>&2'
failOnStderr: true
displayName: 'If above is partially succeeded, then fail'
Expand Down
9 changes: 8 additions & 1 deletion build/pr-validation.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,17 @@ jobs:
- task: BatchScript@1
displayName: Windows Build
inputs:
filename: build.cmd
filename: azure_build.cmd
arguments: 'Build incremental' # Run an incremental build
continueOnError: true
condition: eq( variables['Agent.OS'], 'Windows_NT' )
- task: CopyFiles@2
displayName: 'Copy Build Output'
inputs:
sourceFolder: Artifacts
contents: '*'
targetFolder: $(Build.ArtifactStagingDirectory)
continueOnError: boolean # 'true' if future steps should run even if this step fails; defaults to 'false'
- script: 'echo 1>&2'
failOnStderr: true
displayName: 'If above is partially succeeded, then fail'
Expand Down

0 comments on commit a22660c

Please sign in to comment.