sonic-buildimage/.azure-pipelines/template-skipvstest.yml

24 lines
1.0 KiB
YAML
Raw Normal View History

steps:
- ${{ if eq(variables['Build.Reason'], 'PullRequest') }}:
- script: |
set -ex
tar_branch=origin/$(System.PullRequest.TargetBranchName)
2023-07-24 18:44:59 -05:00
# Check if k8s master entrance script is changed
K8S_MASTER_CHANGED=NO
if git diff $tar_branch..HEAD --name-only | grep -F files/image_config/kubernetes/kubernetes_master_entrance.sh; then
K8S_MASTER_CHANGED=YES
2023-07-24 18:44:59 -05:00
fi
set +x
echo "##vso[task.setvariable variable=K8S_MASTER_CHANGED;]$K8S_MASTER_CHANGED"
displayName: "Check if k8s master image build is needed."
- script: |
set -ex
tar_branch=origin/$(System.PullRequest.TargetBranchName)
git diff $tar_branch..HEAD --name-only | grep -v -f .azure-pipelines/vstest-exclude && exit 0
git diff $tar_branch..HEAD --name-only | grep -f .azure-pipelines/vstest-include && exit 0
set +x
echo "Skip vstest jobs"
echo "##vso[task.setvariable variable=SKIP_VSTEST;isOutput=true]YES"
name: SetVar
displayName: "Check if vstest is needed."