Skip to content

Commit 2a55004

Browse files
authored
Adding updated Pipeline file for new PR pipeline
1 parent 868f9f0 commit 2a55004

File tree

2 files changed

+96
-0
lines changed

2 files changed

+96
-0
lines changed

build/PullRequest.yml

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
trigger:
2+
batch: 'true'
3+
branches:
4+
include:
5+
- release/*
6+
pool:
7+
vmImage: "macos-latest"
8+
9+
steps:
10+
- template: ./templates/build.yml@self
11+
parameters:
12+
publishArtifactName: drop # artifact name for publish task

build/templates/build.yml

+84
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
parameters:
2+
- name: gulpfile
3+
type: string
4+
default: "$(Build.SourcesDirectory)/gulpfile.js"
5+
- name: publishArtifactName # artifact name for publish task; enforced by OneBranch
6+
type: string
7+
8+
steps:
9+
- task: UseNode@1
10+
displayName: "Use Node 18.x"
11+
inputs:
12+
version: 18.x
13+
14+
- pwsh: |
15+
Write-Host "Installing Yarn"
16+
npm install --global [email protected]
17+
Write-Host "Installing Gulp CLI"
18+
npm install --global [email protected]
19+
Write-Host "Installing VSCE"
20+
npm install --global [email protected]
21+
displayName: Install toolchain
22+
23+
- pwsh: |
24+
yarn --frozen-lockfile
25+
displayName: "Install extension depedencies"
26+
workingDirectory: "$(Build.SourcesDirectory)"
27+
28+
- task: gulp@1
29+
displayName: Build extension
30+
inputs:
31+
targets: build
32+
gulpFile: ${{ parameters.gulpfile }}
33+
env:
34+
BUILDMACHINE: true
35+
36+
- task: gulp@1
37+
displayName: Lint code
38+
inputs:
39+
targets: lint
40+
gulpFile: ${{ parameters.gulpfile }}
41+
42+
- task: gulp@1
43+
displayName: Run tests and compute coverage
44+
inputs:
45+
targets: test:cover --log
46+
gulpFile: ${{ parameters.gulpfile }}
47+
48+
- task: PublishTestResults@2
49+
displayName: Publish test results
50+
inputs:
51+
testResultsFormat: 'JUnit'
52+
testResultsFiles: '$(Build.SourcesDirectory)/test-reports/test-results-ext.xml'
53+
condition: succeededOrFailed()
54+
55+
- task: gulp@1
56+
displayName: Process test coverage
57+
inputs:
58+
targets: cover
59+
gulpFile: ${{ parameters.gulpfile }}
60+
61+
- task: gulp@1
62+
displayName: Package (online)
63+
inputs:
64+
targets: package:online
65+
gulpFile: ${{ parameters.gulpfile }}
66+
67+
- task: gulp@1
68+
displayName: Package (offline)
69+
inputs:
70+
targets: package:offline
71+
gulpFile: ${{ parameters.gulpfile }}
72+
73+
- task: CopyFiles@2
74+
displayName: 'Copy VSIXs to clean folder'
75+
inputs:
76+
SourceFolder: '$(Build.SourcesDirectory)'
77+
Contents: '*.vsix'
78+
TargetFolder: '$(Build.ArtifactStagingDirectory)/vsix'
79+
80+
- task: PublishPipelineArtifact@1
81+
displayName: Publish artifacts
82+
inputs:
83+
targetPath: '$(Build.ArtifactStagingDirectory)/vsix'
84+
artifact: ${{ parameters.publishArtifactName }}

0 commit comments

Comments
 (0)