-
Notifications
You must be signed in to change notification settings - Fork 229
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1034 from microsoftgraph/nikithauc/build-pipeline…
…-main Build pipeline merge to main
- Loading branch information
Showing
8 changed files
with
26,133 additions
and
24,177 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
# 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 | ||
|
||
name: $(BuildDefinitionName)_$(SourceBranchName)_$(Date:yyyyMMdd)$(Rev:.r) | ||
|
||
trigger: | ||
branches: | ||
include: | ||
- main | ||
|
||
pr: none | ||
|
||
|
||
stages: | ||
- stage: "Test" | ||
jobs: | ||
- job: | ||
pool: | ||
vmImage: windows-latest | ||
strategy: | ||
matrix: | ||
Node 12: | ||
NODE_VERSION: '12.x' | ||
Node 14: | ||
NODE_VERSION: '14.x' | ||
Node 16: | ||
NODE_VERSION: '16.x' | ||
maxParallel: 2 | ||
steps: | ||
- template: ./common-templates/security-pre-checks.yml | ||
- task: NodeTool@0 | ||
inputs: | ||
versionSpec: $(NODE_VERSION) | ||
displayName: 'Install Node.js' | ||
|
||
- script: npm ci | ||
displayName: 'npm install for tests' | ||
- script: npm run build | ||
displayName: 'npm build for tests' | ||
- script: npm run test | ||
displayName: 'Run the node tests' | ||
- script: npm run karma | ||
displayName: 'Run karma tests' | ||
|
||
- task: PublishTestResults@2 | ||
displayName: 'Publish Unit Test Results' | ||
inputs: | ||
testResultsFormat: 'JUnit' | ||
testResultsFiles: '**/testResult.xml' | ||
failTaskOnFailedTests: true | ||
|
||
- template: ./common-templates/security-post-checks.yml | ||
|
||
- stage: "Build" | ||
jobs: | ||
- job: | ||
|
||
pool: | ||
vmImage: ubuntu-latest | ||
steps: | ||
- task: NodeTool@0 | ||
inputs: | ||
versionSpec: '16.x' | ||
displayName: 'Install Node.js' | ||
|
||
- script: | | ||
npm ci | ||
npm run build | ||
displayName: 'Build for production artifact' | ||
- task: CopyFiles@2 | ||
inputs: | ||
sourceFolder: '$(Build.SourcesDirectory)' | ||
targetFolder: $(Build.ArtifactStagingDirectory) | ||
Contents: | | ||
**/* | ||
!test/** | ||
!.azure-pipelines/** | ||
!.github/** | ||
!.git/** | ||
!.vscode/** | ||
!node_modules/** | ||
displayName: 'Copy npm package' | ||
|
||
- task: PublishBuildArtifacts@1 | ||
inputs: | ||
pathtoPublish: $(Build.ArtifactStagingDirectory) | ||
artifactName: "release-drop" | ||
displayName: 'Publish artifacts' | ||
|
||
|
53 changes: 53 additions & 0 deletions
53
.azure-pipelines/common-templates/security-post-checks.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
# Copyright (c) Microsoft Corporation. All rights reserved. | ||
# Licensed under the MIT License. | ||
steps: | ||
- task: CodesignValidation@0 | ||
|
||
- task: SdtReport@1 | ||
displayName: "Security Analysis Report" | ||
continueOnError: true | ||
condition: succeededOrFailed() | ||
inputs: | ||
AllTools: false | ||
APIScan: false | ||
BinSkim: false | ||
BinSkimBreakOn: "WarningAbove" | ||
CodesignValidation: true | ||
CodesignValidationBreakOn: "WarningAbove" | ||
CredScan: true | ||
FortifySCA: false | ||
FxCop: false | ||
ModernCop: false | ||
MSRD: false | ||
PoliCheck: true | ||
PoliCheckBreakOn: "Severity1" | ||
RoslynAnalyzers: true | ||
RoslynAnalyzersBreakOn: "WarningAbove" | ||
SDLNativeRules: false | ||
Semmle: false | ||
TSLint: false | ||
TSLintBreakOn: "WarningAbove" | ||
ToolLogsNotFoundAction: "Standard" | ||
|
||
- task: PublishSecurityAnalysisLogs@3 | ||
displayName: "Publish Security Analysis Logs" | ||
inputs: | ||
ArtifactName: "CodeAnalysisLogs" | ||
ArtifactType: "Container" | ||
AllTools: false | ||
AntiMalware: false | ||
APIScan: false | ||
BinSkim: false | ||
CodesignValidation: true | ||
CredScan: true | ||
FortifySCA: false | ||
FxCop: false | ||
ModernCop: true | ||
MSRD: false | ||
PoliCheck: true | ||
RoslynAnalyzers: true | ||
SDLNativeRules: false | ||
Semmle: false | ||
TSLint: false | ||
WebScout: false | ||
ToolLogsNotFoundAction: "Standard" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# Copyright (c) Microsoft Corporation. All rights reserved. | ||
# Licensed under the MIT License. | ||
steps: | ||
- task: CredScan@2 | ||
displayName: "Run CredScan" | ||
inputs: | ||
debugMode: false | ||
batchSize: 20 | ||
toolMajorVersion: "V2" | ||
searchersFileType: "Skype" | ||
|
||
- task: PoliCheck@1 | ||
displayName: "Run PoliCheck" | ||
condition: and(succeeded(), eq(eq(variables['Build.SourceBranch'], 'refs/heads/main'), false)) | ||
inputs: | ||
targetType: F | ||
SOMEnabled: true | ||
optionsFC: 0 | ||
optionsXS: 0 | ||
optionsHMENABLE: 0 | ||
continueOnError: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,4 +28,6 @@ test/development/secrets.ts | |
|
||
.nyc_output/* | ||
|
||
.idea/* | ||
.idea/* | ||
|
||
testResult.xml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
src/ | ||
scripts/ | ||
design/ | ||
changelogs/ | ||
changelogs/ | ||
testResult.xml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.