-
Notifications
You must be signed in to change notification settings - Fork 232
Expand file tree
/
Copy pathci.yml
More file actions
91 lines (86 loc) · 2.99 KB
/
ci.yml
File metadata and controls
91 lines (86 loc) · 2.99 KB
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
# Node.js
# Build a general Node.js project with npm.
# Add steps that analyze code, save build artifacts, deploy, and more:
# https://docs.microsoft.com/azure/devops/pipelines/languages/javascript
trigger:
branches:
include:
- main
- feature/*
- release/*
- hotfix/*
paths:
include:
- tools/sdk-testgen
pr:
branches:
include:
- main
- feature/*
- release/*
- hotfix/*
paths:
include:
- tools/sdk-testgen
variables:
NugetSecurityAnalysisWarningLevel: "none"
extends:
template: /eng/pipelines/templates/stages/archetype-sdk-publish-js.yml
parameters:
BuildStageName: build
ArtifactName: testmodeler
PackageJsonPath: $(Build.SourcesDirectory)/tools/sdk-testgen
BuildStages:
- stage: build
displayName: "Build, Lint and Test"
jobs:
- job: BuildTestModeler
displayName: "Build autorest/testmodeler"
pool:
name: azsdk-pool-mms-ubuntu-2204-general
vmImage: ubuntu-22.04
os: linux
steps:
- template: /eng/common/pipelines/templates/steps/verify-path-length.yml
parameters:
SourceDirectory: 'tools/sdk-testgen'
- task: NodeTool@0
inputs:
versionSpec: "18.x"
displayName: "Install Node.js"
- task: GoTool@0
inputs:
version: '1.22.1'
displayName: "Install Go"
- script: |
npm ci
displayName: "Install dependencies"
workingDirectory: $(Build.SourcesDirectory)/tools/sdk-testgen
- script: |
npm rebuild -v
displayName: "Build code"
workingDirectory: $(Build.SourcesDirectory)/tools/sdk-testgen
- script: |
npm lint -v
displayName: "Lint code"
workingDirectory: $(Build.SourcesDirectory)/tools/sdk-testgen
- script: |
export PATH=$PATH:$HOME/go/bin
npm test -v
displayName: "Test code"
workingDirectory: $(Build.SourcesDirectory)/tools/sdk-testgen
- script: |
commitId=$(git rev-parse --short HEAD)
npm version prerelease --preid="ci.$commitId"
displayName: Bump versions
workingDirectory: $(Build.SourcesDirectory)/tools/sdk-testgen
- script: |
mkdir -p ./artifacts/packages
npm pack
mv *.tgz ./artifacts/packages/
displayName: "Pack packages"
workingDirectory: $(Build.SourcesDirectory)/tools/sdk-testgen
- task: 1ES.PublishPipelineArtifact@1
inputs:
targetPath: $(Build.SourcesDirectory)/tools/sdk-testgen/artifacts/packages/
artifactName: testmodeler