trigger:
    - main
    - ci-updates

pool:
    vmImage: 'windows-2019'

variables:
    buildPlatform: 'Any CPU'
    buildConfiguration: 'Release'
    buildType: 'Release'

steps:
    - task: NodeTool@0
      inputs:
          versionSpec: '10.x'

    - script: npm install --global npm

    - task: UseDotNet@2
      displayName: 'Use .NET Core sdk'
      inputs:
        packageType: 'sdk'
        version: '3.1.x'

    - task: VSBuild@1
      inputs:
          solution: 'build.proj'
          msbuildArgs: '/p:PackageOutputDir="$(build.artifactStagingDirectory)"'
          platform: '$(buildPlatform)'
          configuration: '$(buildConfiguration)'

    - task: DotNetCoreCLI@2
      inputs:
          command: 'test'
          projects: 'tests/React.Tests/React.Tests.csproj'
          arguments: '--no-build --configuration $(buildConfiguration)'

    - task: PublishBuildArtifacts@1
