trigger:
- master

variables:
  buildConfiguration: 'Release'

pool:
  vmImage: 'Ubuntu-16.04'

steps:
- script: dotnet restore
  displayName: 'dotnet restore'
  workingDirectory: src

- script: dotnet build --configuration $(buildConfiguration)
  displayName: 'dotnet build $(buildConfiguration)'
  workingDirectory: src

- task: DotNetCoreCLI@2
  displayName: 'dotnet test $(buildConfiguration)'
  inputs:
    command: test
    projects: '**/*Tests/*.fsproj'
    arguments: '--configuration $(buildConfiguration) --collect "Code coverage"'

- task: DotNetCoreCLI@2
  displayName: 'dotnet publish game engine $(buildConfiguration)'
  inputs:
    command: publish
    projects: src/Morgemil.GameEngine/Morgemil.GameEngine.fsproj
    arguments: '--configuration $(BuildConfiguration) --output $(Build.ArtifactStagingDirectory)'
    zipAfterPublish: True

- task: PublishBuildArtifacts@1
  displayName: 'publish artifacts'
trigger:
- master

variables:
  buildConfiguration: 'Release'

pool:
  vmImage: 'Ubuntu-16.04'

steps:
- script: dotnet restore
  displayName: 'dotnet restore'
  workingDirectory: src

- script: dotnet build --configuration $(buildConfiguration)
  displayName: 'dotnet build $(buildConfiguration)'
  workingDirectory: src

- task: DotNetCoreCLI@2
  displayName: 'dotnet test $(buildConfiguration)'
  inputs:
    command: test
    projects: '**/*Tests/*.fsproj'
    arguments: '--configuration $(buildConfiguration) --logger "trx;LogFileName=testresults.trx"'

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

# - task: DotNetCoreCLI@2
#   displayName: 'dotnet publish game engine $(buildConfiguration)'
#   inputs:
#     command: publish
#     projects: src/Morgemil.GameEngine/Morgemil.GameEngine.fsproj
#     arguments: '--configuration $(BuildConfiguration) --output $(Build.ArtifactStagingDirectory)'
#     zipAfterPublish: True

# - task: PublishBuildArtifacts@1
#   displayName: 'publish artifacts'
Add test results to azure build pipeline
Add test results to azure build pipeline
