-
Notifications
You must be signed in to change notification settings - Fork 69
/
azure-pipelines.yml
100 lines (95 loc) · 3.1 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
trigger:
- "*"
variables:
- group: FC-Build-Vars
jobs:
# running tests with vscode in azure is currently broken...it has been for a while and to be honest
# I'm not sure there's a way to fix it. maybe I'll move back to gitlab eventually but for now have to skip tests
- job: Test
pool:
vmImage: "ubuntu-latest"
steps:
- task: NodeTool@0
inputs:
versionSpec: "18.x"
displayName: "Install Node.js"
- bash: |
/usr/bin/Xvfb :99 -screen 0 1024x768x24 > /dev/null 2>&1 &
echo ">>> Started xvfb"
openssl aes-256-cbc -d -in assets/server.key.enc -out assets/server.key -k $(SERVER_KEY_PASSWORD)
echo ">>> Installing SFDX CLI"
npm install -g sfdx-cli
sfdx --version
sfdx plugins --core
sfdx force:auth:jwt:grant --clientid $(SF_CONSUMER_KEY) --jwtkeyfile assets/server.key --username $(SF_USERNAME)
npm ci
echo ">>> Compiling"
npm run compile
echo ">>> Run integration test"
export SF_USERNAME=$(SF_USERNAME)
npm run test
displayName: Run Tests
env:
DISPLAY: ":99.0"
- task: PublishCodeCoverageResults@1
inputs:
codeCoverageTool: Cobertura
summaryFileLocation: "$(System.DefaultWorkingDirectory)/**/*coverage.xml"
reportDirectory: "$(System.DefaultWorkingDirectory)/**/coverage"
- job: Build
# dependsOn: Test
# condition: succeeded()
pool:
vmImage: "ubuntu-latest"
steps:
- task: NodeTool@0
inputs:
versionSpec: "18.x"
displayName: "Install Node.js"
- bash: |
/usr/bin/Xvfb :99 -screen 0 1024x768x24 > /dev/null 2>&1 &
echo ">>> Started xvfb"
displayName: Start xvfb
condition: and(succeeded(), eq(variables['Agent.OS'], 'Linux'))
- bash: |
npm ci
echo ">>> Build package"
npm run package
displayName: Build package
env:
DISPLAY: ":99.0"
# Upload vsix file
- task: CopyFiles@2
inputs:
contents: "*.vsix"
targetFolder: "$(Build.ArtifactStagingDirectory)"
- task: PublishBuildArtifacts@1
inputs:
pathToPublish: $(Build.ArtifactStagingDirectory)
artifactName: ForceCodeBuild
- job: Deploy
dependsOn: Build
condition: and(succeeded(), eq(variables['build.sourceBranch'], 'refs/heads/master'))
pool:
vmImage: "ubuntu-latest"
steps:
- task: NodeTool@0
inputs:
versionSpec: "18.x"
displayName: "Install Node.js"
- bash: |
/usr/bin/Xvfb :99 -screen 0 1024x768x24 > /dev/null 2>&1 &
echo ">>> Started xvfb"
displayName: Start xvfb
condition: and(succeeded(), eq(variables['Agent.OS'], 'Linux'))
- bash: |
npm ci
echo ">>> Build package"
npm run package
echo ">>> Download vsce"
npm i -g vsce
echo ">>> Publishing extension"
vsce publish -p $(VSC_PUBKEY)
displayName: Publish extension
env:
DISPLAY: ":99.0"