Reputation: 556
My Cypress tests are running after every commit but I want them to run every 30 minutes. Here is my YAML file - https://pastebin.pl/view/0d56bd33. How can I manage them to run every 30 minutes(or accroding to given CRON time)?
Upvotes: 0
Views: 884
Reputation: 3058
run script A after commit, but run script B after every 30 min
You can add conditions to your script. For example:
schedules:
- cron: "*/30 * * * *"
displayName: Every 30 minutes
branches:
include:
- main
always: true
trigger:
- '*'
pool:
vmImage: ubuntu-latest
steps:
- script: echo script A
displayName: 'script A'
condition: eq(variables['Build.Reason'], 'IndividualCI')
- script: echo script B
displayName: 'script B'
condition: eq(variables['Build.Reason'], 'Schedule')
In this sample:
Upvotes: 1