-
Notifications
You must be signed in to change notification settings - Fork 23
/
azure-pipelines.yml
77 lines (66 loc) · 1.98 KB
/
azure-pipelines.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
66
67
68
69
70
71
72
73
74
75
76
77
trigger:
- master
pool:
vmImage: 'ubuntu-latest'
variables:
buildConfiguration: 'Release'
steps:
- task: UseDotNet@2
displayName: 'Install SDK'
inputs:
packageType: sdk
version: 3.1.202
- task: NuGetToolInstaller@0
inputs:
versionSpec: '4.9.2'
- task: CacheBeta@1
displayName: Cache NPM packages
inputs:
key: npm | $(Agent.OS) | test/BrowserInterop.E2ETests/package-lock.json
path: /home/vsts/.npm
restoreKeys: npm | $(Agent.OS) | test/BrowserInterop.E2ETests/package-lock.json
- task: Bash@3
displayName: 'Run Cypress Tests'
inputs:
targetType: inline
script: |
cd test/BrowserInterop.E2ETests/
npm install --save-dev start-server-and-test
npm run ci
env:
# avoid warnings about terminal
TERM: xterm
- task: PublishTestResults@2
displayName: 'Publish E2E test results'
condition: succeededOrFailed()
inputs:
searchFolder: $(System.DefaultWorkingDirectory)/test/BrowserInterop.E2ETests/
testRunTitle: LibTest
testResultsFormat: JUnit
testResultsFiles: "**/junit-*-result-*.xml"
- task: DotNetCoreCLI@2
displayName: 'Create nuget package'
inputs:
command: pack
packagesToPack: src/BrowserInterop/BrowserInterop.csproj
versioningScheme: 'off'
configuration: Release
- task: NuGetCommand@2
displayName: 'Publish nuget package'
inputs:
command: push
nuGetFeedType: external
publishFeedCredentials: 'Nuget'
condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/master'), contains(variables['Build.SourceVersionMessage'], '#nuget'))
- task: PublishPipelineArtifact@1
displayName: 'Publish Cypress videos'
inputs:
targetPath: test/BrowserInterop.E2ETests/cypress/videos/
artifact: 'Cypress videos'
condition: failed()
- task: PublishPipelineArtifact@1
displayName: 'Publish Cypress screenshot'
inputs:
targetPath: test/BrowserInterop.E2ETests/cypress/screenshots/
artifact: 'Cypress screenshot'
condition: failed()