sp-dev-fx-webparts/samples/react-jest-testing/devops/build/azure-pipelines-pre-build.yml

35 lines
921 B
YAML

# Node.js with gulp
# Build a Node.js project using the gulp task runner.
# Add steps that analyze code, save build artifacts, deploy, and more:
# https://docs.microsoft.com/azure/devops/pipelines/languages/javascript
pool:
vmImage: 'Ubuntu 16.04'
trigger: none # has to manually set it up. See: # https://learn.microsoft.com/azure/devops/pipelines/build/triggers?view=vsts&tabs=yaml#pull-request-validation
steps:
- task: NodeTool@0
inputs:
versionSpec: '8.x'
displayName: 'Install Node.js'
- script: |
npm install
displayName: 'npm install'
- script: |
gulp clean
gulp build --ship
displayName: 'gulp build solution'
- script: |
npm run test
displayName: 'npm run test (Jest)'
# Publish Test Results to Azure Pipelines/TFS
- task: PublishTestResults@2
inputs:
testResultsFormat: 'JUnit'
testResultsFiles: '**/summary-jest-junit.xml'
displayName: 'Publish test results'