File: verify-samples.yml

package info (click to toggle)
python-azure 20251014%2Bgit-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 766,472 kB
  • sloc: python: 6,314,744; ansic: 804; javascript: 287; makefile: 198; sh: 198; xml: 109
file content (25 lines) | stat: -rw-r--r-- 1,006 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
parameters:
  - name: ServiceDirectory
    type: string
    default: ''
  - name: ServiceDirectories
    type: string
    default: ''
  - name: ScriptDirectory
    type: string
    default: eng/common/scripts

steps:
  - pwsh: |
      # Take whichever parameter has been set. If set, ServiceDirectory will be a single path or
      # ServiceDirectories will be a comma separated list.
      $ServiceDirectories = '${{ coalesce(parameters.ServiceDirectory, parameters.ServiceDirectories) }}'
      $ScanPaths = @()
      foreach ($ServiceDirectory in $ServiceDirectories.Split(',')) {
        $ScanPath = [System.IO.Path]::Combine('$(Build.SourcesDirectory)', 'sdk', $ServiceDirectory)
        Write-Host "Adding $ScanPath to the scanned paths"
        $ScanPaths += $ScanPath
      }
      Get-ChildItem $ScanPaths -Filter *.md -Recurse | ${{ parameters.ScriptDirectory }}/Test-SampleMetadata.ps1 -AllowParentProducts
    displayName: Verify sample metadata
    workingDirectory: $(Build.SourcesDirectory)