-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathazure-pipelines.yml
37 lines (37 loc) · 1.72 KB
/
azure-pipelines.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
# To configure triggers for Azure CI see
# https://docs.microsoft.com/en-us/azure/devops/pipelines/build/triggers?view=azure-devops&tabs=yaml#tags
jobs:
- job: Cypress_tests
pool:
vmImage: 'ubuntu-16.04'
# Runs tests in parallel https://docs.cypress.io/guides/guides/parallelization
# https://learn.microsoft.com/en-us/azure/devops/pipelines/process/phases?view=azure-devops&tabs=yaml
strategy:
parallel: 2
steps:
- task: NodeTool@0
# Caches dependencies using npm lock file as key
# https://docs.cypress.io/guides/continuous-integration/introduction#Caching
- task: CacheBeta@1
inputs:
key: npm | package-lock.json
path: /home/vsts/.npm
restoreKeys: npm | package-lock.json
- task: CacheBeta@1
inputs:
key: cy | package-lock.json
path: /home/vsts/.cache/Cypress
restoreKeys: cy | package-lock.json
- script: npm ci --prefer-offline
# Starts web server for E2E tests - replace with your own server invocation
# https://docs.cypress.io/guides/continuous-integration/introduction#Boot-your-server
- script: npm start &
- script: npx wait-on 'http-get://localhost:3000' # Waits for above
# Runs tests in parallel and records to Cypress Cloud
# https://docs.cypress.io/guides/cloud/projects#Set-up-a-project-to-record
# https://docs.cypress.io/guides/guides/parallelization
- script: npx cypress run --record --parallel --ci-build-id $BUILD_BUILDNUMBER
# For recording and parallelization to work you must set your CYPRESS_RECORD_KEY
# in Azure DevOps → Your Pipeline → Edit → Variables
env:
CYPRESS_RECORD_KEY: $(CYPRESS_RECORD_KEY)