Skip to content

Commit

Permalink
Migrate pipeline to 1ES Pipeline Template (#474)
Browse files Browse the repository at this point in the history
* Migrate pipeline to 1ES Pipeline Template

* Update agent pool for each platform
  • Loading branch information
EzioLi01 authored Jun 4, 2024
1 parent df3dea8 commit 9f74206
Show file tree
Hide file tree
Showing 2 changed files with 93 additions and 85 deletions.
47 changes: 21 additions & 26 deletions .ci/common-validation.yml
Original file line number Diff line number Diff line change
@@ -1,27 +1,22 @@
steps:
- task: NodeTool@0
displayName: "Use Node 16.x"
inputs:
versionSpec: 16.x

- bash: npm install gulp -g --force
displayName: "npm install gulp -g"

- bash: npm ci
displayName: "npm ci"

- bash: gulp
displayName: "gulp default"

- bash: "npm run test --verbose"
displayName: "Run unit tests"
env:
DISPLAY: ":99.0"

- task: PublishTestResults@2
displayName: "Publish Test Results"
inputs:
testResultsFiles: test/simulateTestReport.xml
failTaskOnFailedTests: true
testRunTitle: "$(Agent.OS) Cordova simulate unit tests - Attempt №$(System.JobAttempt)"
condition: always()
- task: NodeTool@0
displayName: "Use Node 16.x"
inputs:
versionSpec: 16.x
- bash: npm install gulp -g --force
displayName: "npm install gulp -g"
- bash: npm ci
displayName: "npm ci"
- bash: gulp
displayName: "gulp default"
- bash: "npm run test --verbose"
displayName: "Run unit tests"
env:
DISPLAY: ":99.0"
- task: PublishTestResults@2
displayName: "Publish Test Results"
inputs:
testResultsFiles: test/simulateTestReport.xml
failTaskOnFailedTests: true
testRunTitle: "$(Agent.OS) Cordova simulate unit tests - Attempt №$(System.JobAttempt)"
condition: always()
131 changes: 72 additions & 59 deletions .ci/master-pipeline.yml
Original file line number Diff line number Diff line change
@@ -1,64 +1,77 @@
trigger:
- master

- master
variables:
Codeql.Enabled: true

pr:
- none

jobs:
- job: Linux
- none
resources:
repositories:
- repository: 1ESPipelineTemplates
type: git
name: 1ESPipelineTemplates/1ESPipelineTemplates
ref: refs/tags/release
extends:
template: v1/1ES.Official.PipelineTemplate.yml@1ESPipelineTemplates
parameters:
pool:
vmImage: ubuntu-latest
timeoutInMinutes: 20
steps:
- checkout: self
clean: true
- template: common-validation.yml

- job: Windows
pool:
vmImage: windows-latest
timeoutInMinutes: 20
steps:
- checkout: self
clean: true
- template: common-validation.yml

- task: ms.vss-governance-buildtask.governance-build-task-component-detection.ComponentGovernanceComponentDetection@0
displayName: "Component Detection"

- task: Npm@1
displayName: "npm pack"
inputs:
command: custom
verbose: false
customCommand: pack

- task: msospo.ospo-extension.8d7f9abb-6896-461d-9e25-4f74ed65ddb2.notice@0
displayName: "NOTICE File Generator"
inputs:
outputfile: "ThirdPartyNotices_Generated.txt"
additionaldata: release/AdditionalAttributions.txt

- task: CopyFiles@2
displayName: "Copy Files to: $(Build.ArtifactStagingDirectory)"
inputs:
Contents: |
cordova-simulate-*.tgz
TargetFolder: "$(Build.ArtifactStagingDirectory)"

- task: PublishBuildArtifacts@1
displayName: "Publish artifacts: drop"
inputs:
ArtifactName: "drop"

- job: macOS
pool:
vmImage: macOS-latest
timeoutInMinutes: 20
steps:
- checkout: self
clean: true
- template: common-validation.yml
name: Azure-Pipelines-1ESPT-ExDShared
image: windows-2022
os: windows
customBuildTags:
- ES365AIMigrationTooling
stages:
- stage: stage
jobs:
- job: Linux
pool:
name: Azure-Pipelines-1ESPT-ExDShared
image: ubuntu-latest
os: linux
timeoutInMinutes: 20
steps:
- checkout: self
clean: true
- template: /.ci/common-validation.yml@self
- job: Windows
pool:
name: Azure-Pipelines-1ESPT-ExDShared
image: windows-latest
os: windows
timeoutInMinutes: 20
templateContext:
outputs:
- output: pipelineArtifact
displayName: 'Publish artifacts: drop'
targetPath: '$(Build.ArtifactStagingDirectory)'
artifactName: "drop"
steps:
- checkout: self
clean: true
- template: /.ci/common-validation.yml@self
- task: Npm@1
displayName: "npm pack"
inputs:
command: custom
verbose: false
customCommand: pack
- task: msospo.ospo-extension.8d7f9abb-6896-461d-9e25-4f74ed65ddb2.notice@0
displayName: "NOTICE File Generator"
inputs:
outputfile: "ThirdPartyNotices_Generated.txt"
additionaldata: release/AdditionalAttributions.txt
- task: CopyFiles@2
displayName: "Copy Files to: $(Build.ArtifactStagingDirectory)"
inputs:
Contents: |
cordova-simulate-*.tgz
TargetFolder: "$(Build.ArtifactStagingDirectory)"
- job: macOS
pool:
name: Azure Pipelines
image: macos-latest
os: macOS
timeoutInMinutes: 20
steps:
- checkout: self
clean: true
- template: /.ci/common-validation.yml@self

0 comments on commit 9f74206

Please sign in to comment.