resources:

- repo: self

phases:

- phase: Phase_1

  displayName: Agent job



  condition: succeeded()

  queue:

    name: SPTAGBuild

  steps:

  - script: |  
       mkdir build
       cd build
       cmake ..
       make
       cd ../Release
       ./test 

    displayName: 'Command Line Script'





- phase: Phase_2

  displayName: Agent job



  condition: succeeded()

  queue:

    name: Hosted

    demands: 

   - msbuild

   - visualstudio



  steps:

  - task: NuGetToolInstaller@0

    displayName: 'Use NuGet 4.3.0'





  - task: NuGetCommand@2

    displayName: 'NuGet restore'

    inputs:

      restoreSolution: SPTAG.sln



      vstsFeed: 'bae5097f-8d64-4f8f-913e-24a4eb8302c3'





  - task: VSBuild@1

    displayName: 'Build solution SPTAG.sln'

    inputs:

      solution: SPTAG.sln



      vsVersion: 14.0



      platform: x64



      configuration: debug



      msbuildArchitecture: x64



      createLogFile: true





  - script: '.\x64\Debug\Test.exe' 

    displayName: 'Command Line Script'



  - task: CopyFiles@2

    displayName: 'Copy Files to: $(Build.ArtifactStagingDirectory)'

    inputs:

      SourceFolder: x64/Debug/



      Contents: '*'



      TargetFolder: '$(Build.ArtifactStagingDirectory)'





  - task: PublishBuildArtifacts@1

    displayName: 'Publish Artifact: drop'





  - task: securedevelopmentteam.vss-secure-development-tools.build-task-binskim.BinSkim@3

    displayName: 'Run BinSkim '

    inputs:

      InputType: Basic





  - task: securedevelopmentteam.vss-secure-development-tools.build-task-credscan.CredScan@2

    displayName: 'Run CredScan'

    inputs:

      scanFolder: AnnService



      suppressAsError: true



      verboseOutput: true



      debugMode: false





  - task: securedevelopmentteam.vss-secure-development-tools.build-task-autoapplicability.AutoApplicability@1

    displayName: 'Run AutoApplicability'

    inputs:

      IsSoftware: true





  - task: securedevelopmentteam.vss-secure-development-tools.build-task-publishsecurityanalysislogs.PublishSecurityAnalysisLogs@2

    displayName: 'Publish Security Analysis Logs'





  - task: securedevelopmentteam.vss-secure-development-tools.build-task-report.SdtReport@1

    displayName: 'Create Security Analysis Report'

    inputs:

      AllTools: true





  - task: securedevelopmentteam.vss-secure-development-tools.build-task-postanalysis.PostAnalysis@1

    displayName: 'Post Analysis'

    inputs:

      AllTools: true





  - task: ms.vss-governance-buildtask.governance-build-task-component-detection.ComponentGovernanceComponentDetection@0

    displayName: 'Component Detection'

