64 строки
1.6 KiB
YAML
64 строки
1.6 KiB
YAML
# pr:
|
|
# branches:
|
|
# include:
|
|
# - main
|
|
|
|
variables:
|
|
CI: '1'
|
|
NODE_ENV: 'test'
|
|
|
|
pool:
|
|
vmImage: 'ubuntu-latest'
|
|
|
|
steps:
|
|
- task: NodeTool@0
|
|
displayName: Use Node 12.x
|
|
inputs:
|
|
versionSpec: 12.x
|
|
|
|
- task: DockerInstaller@0
|
|
displayName: Install Docker 17.09.0-ce
|
|
|
|
- script: |
|
|
npm ci
|
|
npm run eslint
|
|
npm run build
|
|
docker-compose up --build --detach
|
|
npm run test -- --ci --coverage true --maxWorkers=4 --no-watch
|
|
|
|
- script: |
|
|
docker-compose down --rmi all
|
|
condition: always()
|
|
|
|
- task: PublishTestResults@2
|
|
displayName: Publish Test Results coverage/junit.xml
|
|
inputs:
|
|
testResultsFiles: coverage/junit.xml
|
|
condition: succeededOrFailed()
|
|
|
|
- task: PublishCodeCoverageResults@1
|
|
displayName: Publish code coverage from coverage/cobertura-coverage.xml
|
|
inputs:
|
|
codeCoverageTool: Cobertura
|
|
summaryFileLocation: coverage/cobertura-coverage.xml
|
|
condition: succeededOrFailed()
|
|
|
|
- task: ArchiveFiles@2
|
|
displayName: Zip test image snapshots
|
|
inputs:
|
|
rootFolderOrFile: $(Build.SourcesDirectory)/__tests__/__image_snapshots__/
|
|
archiveFile: $(Build.ArtifactStagingDirectory)/image-snapshots/image-snapshots.zip
|
|
condition: succeededOrFailed()
|
|
|
|
- task: cURLUploader@2
|
|
displayName: Upload test image snapshots for viewing
|
|
inputs:
|
|
files: $(Build.ArtifactStagingDirectory)/image-snapshots/image-snapshots.zip
|
|
authType: UserAndPass
|
|
url: https://webchat-curator.azurewebsites.net/upload
|
|
redirectStderr: false
|
|
condition: succeededOrFailed()
|
|
|
|
- publish: $(Build.SourcesDirectory)/packages/bundle/dist
|
|
artifact: bundle
|