Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ci] Support to skip vstest using include/exclude config file. #11086

Merged
merged 5 commits into from
Jun 17, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .azure-pipelines/azure-pipelines-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ jobs:
platform_rpc: nephos

buildSteps:
- template: template-skipvstest.yml
- bash: |
set -ex
if [ $(GROUP_NAME) == vs ]; then
Expand Down
12 changes: 12 additions & 0 deletions .azure-pipelines/template-skipvstest.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
steps:
- ${{ if eq(variables['Build.Reason'], 'PullRequest') }}:
- script: |
set -ex
tar_branch=origin/$(System.PullRequest.TargetBranch)
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
liushilongbuaa marked this conversation as resolved.
Show resolved Hide resolved
displayName: "Check if vstest is needed."
3 changes: 3 additions & 0 deletions .azure-pipelines/vstest-exclude
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
^platform
^.azure-pipelines
^files/build/versions
2 changes: 2 additions & 0 deletions .azure-pipelines/vstest-include
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
^platform/vs
^.azure-pipelines/run-test-template.yml
1 change: 1 addition & 0 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ stages:

- stage: Test
dependsOn: BuildVS
condition: and(ne(stageDependencies.BuildVS.outputs['vs.SetVar.SKIP_VSTEST'], 'YES'), succeeded())
variables:
- name: inventory
value: veos_vtb
Expand Down