Skip to content
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 33 additions & 11 deletions eng/pipelines/templates/jobs/archetype-sdk-client.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,12 @@ jobs:
node eng/tools/rush-runner.js pack "${{parameters.ServiceDirectory}}" --verbose
displayName: "Pack libraries"

# Unlink node_modules folders to significantly improve performance of subsequent tasks
# which need to walk the directory tree (and are hardcoded to follow symlinks).
- script: |
node eng/tools/rush-runner.js unlink
displayName: "Unlink dependencies"

# It's important for performance to pass "sdk" as "sourceFolder" rather than as a prefix in "contents".
# The task first enumerates all files under "sourceFolder", then matches them against the "contents" pattern.
- task: CopyFiles@2
Expand Down Expand Up @@ -173,6 +179,23 @@ jobs:
node eng/tools/rush-runner.js lint "${{parameters.ServiceDirectory}}"
displayName: "Lint libraries"

- script: |
node eng/tools/rush-runner.js audit "${{parameters.ServiceDirectory}}"
condition: and(succeeded(), eq(variables['RunNpmAudit'], 'true'))
displayName: "Audit libraries"

- task: ms.vss-governance-buildtask.governance-build-task-component-detection.ComponentGovernanceComponentDetection@0
# ComponentGovernance is currently unable to run on pull requests of public projects. Running on non-PR
# builds should be sufficient.
condition: and(succeededOrFailed(), ne(variables['Build.Reason'], 'PullRequest'))
displayName: "Component Detection"

# Unlink node_modules folders to significantly improve performance of subsequent tasks
# which need to walk the directory tree (and are hardcoded to follow symlinks).
- script: |
Comment thread
mikeharder marked this conversation as resolved.
node eng/tools/rush-runner.js unlink
displayName: "Unlink dependencies"

# It's important for performance to pass "sdk" as "sourceFolder" rather than as a prefix in "contents".
# The task first enumerates all files under "sourceFolder", then matches them against the "contents" pattern.
- task: CopyFiles@2
Expand All @@ -190,17 +213,6 @@ jobs:
artifactName: reports
path: $(Build.ArtifactStagingDirectory)

- script: |
node eng/tools/rush-runner.js audit "${{parameters.ServiceDirectory}}"
condition: and(succeeded(), eq(variables['RunNpmAudit'], 'true'))
displayName: "Audit libraries"

- task: ms.vss-governance-buildtask.governance-build-task-component-detection.ComponentGovernanceComponentDetection@0
# ComponentGovernance is currently unable to run on pull requests of public projects. Running on non-PR
# builds should be sufficient.
condition: and(succeededOrFailed(), ne(variables['Build.Reason'], 'PullRequest'))
displayName: "Component Detection"

# Only run tests if the matrix has entries
- ${{ if ne(parameters.RunUnitTests, false) }}:
- job: "UnitTest"
Expand Down Expand Up @@ -233,15 +245,25 @@ jobs:
node eng/tools/rush-runner.js unit-test "${{parameters.ServiceDirectory}}" --verbose
displayName: "Test libraries"

# Unlink node_modules folders to significantly improve performance of subsequent tasks
# which need to walk the directory tree (and are hardcoded to follow symlinks).
- script: |
node eng/tools/rush-runner.js unlink
displayName: "Unlink dependencies"

# It's important for performance to pass "sdk" as "searchFolder" to avoid looking under root "node_modules"
- task: PublishTestResults@2
inputs:
searchFolder: sdk
testResultsFiles: "**/test-results.xml"
testRunTitle: "$(OSName) - NodeJS - Unit Tests - [Node $(NodeVersion)]"
condition: succeededOrFailed()
displayName: "Publish NodeJS unit test results"

# It's important for performance to pass "sdk" as "searchFolder" to avoid looking under root "node_modules"
- task: PublishTestResults@2
inputs:
searchFolder: sdk
testResultsFiles: "**/test-results.browser.xml"
testRunTitle: "$(OSName) - Browser - Unit Tests - [Node $(NodeVersion)]"
condition: succeededOrFailed()
Expand Down
10 changes: 10 additions & 0 deletions eng/pipelines/templates/jobs/archetype-sdk-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -124,15 +124,25 @@ jobs:
displayName: Delete Test-Specific Azure Resources
condition: succeededOrFailed()

# Unlink node_modules folders to significantly improve performance of subsequent tasks
# which need to walk the directory tree (and are hardcoded to follow symlinks).
- script: |
node eng/tools/rush-runner.js unlink
displayName: "Unlink dependencies"

# It's important for performance to pass "sdk" as "searchFolder" to avoid looking under root "node_modules"
- task: PublishTestResults@2
inputs:
searchFolder: sdk
testResultsFiles: "**/test-results.xml"
testRunTitle: "$(OSName) - NodeJS - Integration Tests - [Node $(NodeVersion)]"
condition: and(succeededOrFailed(), eq(variables['TestType'], 'node'))
displayName: "Publish NodeJS integration test results"

# It's important for performance to pass "sdk" as "searchFolder" to avoid looking under root "node_modules"
- task: PublishTestResults@2
inputs:
searchFolder: sdk
testResultsFiles: "**/test-results.browser.xml"
testRunTitle: "$(OSName) - Browser - Integration Tests - [Node $(NodeVersion)]"
condition: and(succeededOrFailed(), eq(variables['TestType'], 'browser'))
Expand Down