Search code examples
azure-devopsyaml

Yml file located in folder of ADO repo does not start unit test


I have a YAML file located in an Azure DevOps repository. This YAML file was migrated from GUI pipelines in ADO.

The idea is that this YAML file should start after we create a pull request to the branch, in order to conduct unit tests. The name of this YAML file is added to the "Build validation" in the branch that we want to test.

The file is located in the folder devops\pipeline.

Error that I have: Build not run

The most interesting thing is that if you mention the pipeline itself, which has a GUI setting, it works correctly.

started first code in yaml file

pool:
  vmImage: windows-latest
variables:
  NetVersion: '6'
  BuildConfiguration: Release

steps:

- task: UseDotNet@2
  displayName: 'Use .NET $(NetVersion).x sdk '
  inputs:
    version: $(NetVersion).x
    includePreviewVersions: true

Solution

  • Error that I have: Build not run

    I can reproduce the same if the yaml build doesn't exist:

    enter image description here

    Please make sure the build pipeline exists before you create Pull request.

    In addition, please also make sure the trigger setting is automatic on the build validation. enter image description here

    The pipeline in Pull request works now:

    enter image description here