-
Notifications
You must be signed in to change notification settings - Fork 5
/
Gherkin-job.yml
65 lines (57 loc) · 2.26 KB
/
Gherkin-job.yml
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
parameters:
pesterVersion: ''
specDirectory: '$(Build.SourcesDirectory)/Specs'
requiredModulesPath: RequiredModules.psd1
artifactName: ''
artifactDownloadDirectory: '$(Build.ArtifactStagingDirectory)'
additionalModulePaths: []
codeCoverageDirectory: ''
dependsOn: []
includeTag: []
excludeTag: []
cleanJob: ''
show: 'All'
strategy:
parallel: 1
pool:
vmImage: 'windows-2019'
jobs:
- job: PesterGherkin
dependsOn: ${{ parameters.dependsOn }}
${{ if ne(parameters.cleanJob, '') }}:
workspace:
clean: ${{ parameters.cleanJob }}
strategy: ${{ parameters.strategy }}
pool: ${{ parameters.pool }}
variables:
CodeCoverageDirectory: ${{ parameters.codeCoverageDirectory }}
steps:
- checkout: self # re-checkout, because we don't package tests
fetchDepth: 1 # we only need the current tests
lfs: true
- template: Install-RequiredModule-step.yml
parameters:
path: $(Build.SourcesDirectory)/${{ parameters.requiredModulesPath }}
- task: DownloadPipelineArtifact@2
displayName: 'Download Build Artifacts'
condition: ${{ ne('', parameters.artifactName)}}
inputs:
artifactName: ${{ parameters.artifactName }}
downloadPath: ${{ parameters.artifactDownloadDirectory }}
- powershell: |
$AdditionalModulePaths = @(if("${{ parameters.artifactName }}"){"${{ parameters.artifactDownloadDirectory }}"}) +
@("${{ join('", "', parameters.additionalModulePaths) }}") -join [IO.Path]::PathSeparator
Write-Host "##vso[task.setvariable variable=AdditionalModulePaths]$AdditionalModulePaths"
if(!"$(CodeCoverageDirectory)" -and "${{ parameters.artifactName }}") {
Write-Host "##vso[task.setvariable variable=CodeCoverageDirectory]${{ parameters.artifactDownloadDirectory }}"
}
displayName: 'Combine paths'
- template: Gherkin-step.yml
parameters:
pesterVersion: ${{ parameters.pesterVersion }}
specDirectory: ${{ parameters.specDirectory }}
includeTag: ${{ parameters.includeTag }}
excludeTag: ${{ parameters.excludeTag }}
additionalModulePaths: $(AdditionalModulePaths)
codeCoverageDirectory: $(CodeCoverageDirectory)
show: ${{ parameters.show }}