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 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125
|
jobs:
# Check that commit title matches code style guidelines
- job: commit_title
displayName: commit title
pool:
name: MLNX
demands:
- ucx_docker -equals yes
steps:
- checkout: self
clean: true
fetchDepth: 100
retryCountOnTaskFailure: 5
- bash: |
set -eE
source ./buildlib/tools/codestyle.sh
BASE_SOURCEVERSION=$(git rev-parse HEAD^)
range="$BASE_SOURCEVERSION..$(Build.SourceVersion)"
codestyle_check_commit_title "$range"
if [[ $? -ne 0 ]]
then
url="https://github.com/openucx/ucx/wiki/Guidance-for-contributors#general-guidelines"
echo "##vso[task.logissue type=error]Bad commit title(s), see $url for more info."
echo "##vso[task.complete result=Failed;]"
fi
condition: eq(variables['Build.Reason'], 'PullRequest')
# Check that the code is formatted according to the code style guidelines
- job: format
displayName: format code
pool:
name: MLNX
demands:
- ucx_docker -equals yes
container: fedora
steps:
- checkout: self
clean: true
fetchDepth: 100
retryCountOnTaskFailure: 5
- bash: |
source ./buildlib/az-helpers.sh
set -x
git log -1 HEAD
git log -1 HEAD^
BASE_SOURCEVERSION=$(git rev-parse HEAD^)
echo "Checking code format on diff ${BASE_SOURCEVERSION}..${BUILD_SOURCEVERSION}"
git-clang-format --diff ${BASE_SOURCEVERSION} ${BUILD_SOURCEVERSION} > format.patch
echo "Generated patch file:"
cat format.patch
if [ "`cat format.patch`" = "no modified files to format" ]; then
exit
fi
git apply format.patch
if ! git diff --quiet --exit-code
then
url="https://github.com/openucx/ucx/wiki/Code-style-checking"
azure_complete_with_issues "Code is not formatted according to the code style, see $url for more info."
fi
condition: eq(variables['Build.Reason'], 'PullRequest')
- job: author
displayName: AUTHORS file update check
pool:
name: MLNX
demands:
- ucx_docker -equals yes
container: fedora
steps:
- checkout: self
clean: true
fetchDepth: 100
retryCountOnTaskFailure: 5
- bash: |
set -eEx
BASE_SOURCEVERSION=$(git rev-parse HEAD^)
range="$BASE_SOURCEVERSION..$(Build.SourceVersion)"
echo "Looking for missing AUTHORS on commit range ${range}"
./contrib/authors_update.sh "$range"
git diff --exit-code
displayName: AUTHORS file check
- job: codespell
displayName: codespell check
pool:
name: MLNX
demands:
- ucx_docker -equals yes
container: fedora
steps:
- checkout: self
clean: true
fetchDepth: 100
retryCountOnTaskFailure: 5
- bash: |
set -eE
source ./buildlib/tools/codestyle.sh
codestyle_check_spell
displayName: codespell test
- job: ctags_generation
displayName: ctags check
pool:
name: MLNX
demands:
- ucx_docker -equals yes
container: fedora
steps:
- checkout: self
clean: true
fetchDepth: 100
retryCountOnTaskFailure: 5
- bash: |
./buildlib/tools/test_ctags.sh
displayName: ctags generation test
|