forked from microsoft/BotFramework-Composer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
azure-pipelines.yml
114 lines (97 loc) · 3.5 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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
variables:
YARN_CACHE_FOLDER: $(Pipeline.Workspace)/.yarn
jobs:
- job: e2e
displayName: End-to-End Tests
# re-enable once we upgrade our subscription to cypress
strategy:
parallel: "4"
pool:
vmImage: ubuntu-latest
steps:
- task: UseDotNet@2
displayName: "Use .NET Core 3.1.x"
inputs:
packageType: "runtime"
version: "3.1.x"
- task: NodeTool@0
displayName: "Use Node 14.17.0"
inputs:
versionSpec: 14.17.0
- task: Bash@3
displayName: "npm install generator-bot-empty"
inputs:
targetType: "inline"
script:
npm install -g @microsoft/generator-bot-empty
- task: Cache@2
displayName: Cache Cypress binary
inputs:
key: cypress | $(Agent.OS) | Composer/yarn-berry.lock
path: /home/vsts/.cache/Cypress
- script: yarn --immutable
displayName: yarn install
workingDirectory: Composer
- script: yarn build
displayName: yarn build
workingDirectory: Composer
- script: ./scripts/e2e-ci.sh --record --parallel --ci-build-id $(Build.BuildNumber) --group "Azure CI"
displayName: Run E2E Tests
workingDirectory: Composer/packages/integration-tests
env:
CYPRESS_RECORD_KEY: $(CYPRESS_RECORD_KEY)
CYPRESS_VIDEO: true
CYPRESS_VIDEO_UPLOAD_ON_PASSES: true
CYPRESS_SCREENSHOTS_FOLDER: $(Build.ArtifactStagingDirectory)/cypress/screenshots
CYPRESS_VIDEOS_FOLDER: $(Build.ArtifactStagingDirectory)/cypress/videos
TERM: xterm
COMPOSER_BOTS_FOLDER: $(System.DefaultWorkingDirectory)/MyBots
DEBUG: composer
- task: PublishPipelineArtifact@1
displayName: Publish Cypress Artifacts
condition: failed()
continueOnError: true
inputs:
targetPath: $(Build.ArtifactStagingDirectory)/cypress
artifactName: e2e
- script: cat e2e.log
displayName: Server Logs
condition: always()
continueOnError: true
workingDirectory: Composer
- powershell: |
cd ..
ls -R
displayName: Dir workspace
continueOnError: true
condition: succeededOrFailed()
- job: security
displayName: Security Analysis
pool:
vmImage: ubuntu-latest
steps:
- powershell: |
# Gin up imitation v1 yarn.lock files to aid Component Governance Detection analysis. The method:
# Find v3 yarn-berry.lock files. From each, generate a yarn.lock file, deleting all occurrences of 'npm:'.
# This allows CG to work with yarn v3.
$find = 'npm:';
$replace = '';
Get-ChildItem -Recurse -Path '**/yarn-berry.lock' | % {
$source = $_.FullName;
$dest = $_.DirectoryName + "/yarn.lock"
Write-Host $source;
Write-Host $dest;
Copy-Item -Path $source -Destination $dest -Force
$content = Get-Content -Raw $dest;
$content -Replace "$find", "$replace" | Set-Content $dest;
'--------------------'; get-content $dest; '====================';
}
displayName: Generate "yarn.lock" files for CG Detection
continueOnError: true
- task: ComponentGovernanceComponentDetection@0
displayName: Component Detection
inputs:
scanType: "Register"
verbosity: "Verbose"
alertWarningLevel: "High"
failOnAlert: true