diff --git a/CI/azure/check_README_BUILD.sh b/CI/azure/check_README_BUILD.sh new file mode 100755 index 000000000..1d680f433 --- /dev/null +++ b/CI/azure/check_README_BUILD.sh @@ -0,0 +1,34 @@ +#!/bin/sh + +# Check the project CMake for options, which are not described in the README_BUILD.md file +# At the same time, check to make sure the defaults are described properly. + +error=0 + +options() { + for file in $(find ./ -not \( -path ./deps -prune \) -name CMakeLists.txt) + do + grep option[[:space:]]*\( "${file}" | \ + sed -e "s/^[[:space:]]*//g" -e "s/(/ /g" | \ + awk '{print $2}' + done | sort | uniq +} + +for opt in $(options) +do + default=$(for file in $(find ./ -not \( -path ./deps -prune \) -name CMakeLists.txt) + do + grep "option[[:space:]]*(${opt} " "${file}" | \ + sed -e "s/^[[:space:]]*//g" -e "s/)[[:space:]]*$//" | \ + awk '{print $NF}' + done) + if ! grep -q "${opt}.*${default}" README_BUILD.md ; then + echo "no match with ${opt} set with ${default}" + grep -R "${opt}" ./* + error=1 + fi +done + +if [ "${error}" -eq "1" ] ; then + exit 1 +fi diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 0c07f00e4..bb3c5d8b2 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -67,6 +67,9 @@ stages: - script: ./CI/azure/check_kernel.sh displayName: 'Kernel check' condition: and(eq(variables['artifactName'], 'Linux-Ubuntu-22.04'), eq(variables['Build.Reason'], 'PullRequest')) + - script: ./CI/azure/check_README_BUILD.sh + displayName: 'README_BUILD check' + condition: and(eq(variables['artifactName'], 'Linux-Ubuntu-22.04'), eq(variables['Build.Reason'], 'PullRequest')) - task: PublishPipelineArtifact@1 inputs: targetPath: '$(Build.ArtifactStagingDirectory)'