diff options
author | Jerome Forissier <jerome@forissier.org> | 2021-07-26 09:50:32 +0200 |
---|---|---|
committer | Jérôme Forissier <jerome@forissier.org> | 2021-07-27 11:16:32 +0200 |
commit | 2d603acdc602d4d25b7414be938a06a2e8008967 (patch) | |
tree | 724b136c2487c226a52a03bf2f3c744ee009735f /.azure-pipelines.yml | |
parent | 49dbb9ef65643c4322cf3f848910fa880d1c02f6 (diff) |
ci: run code style check in .azure-pipelines.yml
The Travis CI script .travis.yml is not run anymore. A banner at
https://travis-ci.org/ says "Since June 15th, 2021, the building on
travis-ci.org is ceased. Please use travis-ci.com from now on."
For simplicity let's move the code style checks to the Azure Pipelines
script. We already have two jobs there, a third one is easy to do.
Signed-off-by: Jerome Forissier <jerome@forissier.org>
Acked-by: Jens Wiklander <jens.wiklander@linaro.org>
Diffstat (limited to '.azure-pipelines.yml')
-rw-r--r-- | .azure-pipelines.yml | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/.azure-pipelines.yml b/.azure-pipelines.yml index d19efd39..5c5e1813 100644 --- a/.azure-pipelines.yml +++ b/.azure-pipelines.yml @@ -1,4 +1,47 @@ jobs: + - job: code_style + displayName: 'Check code style' + pool: + vmImage: ubuntu-18.04 + container: + image: jforissier/optee_os_ci + steps: + - script: | + set -e + pushd . + mkdir -p /tmp/linux/scripts + cd /tmp/linux/scripts + wget --quiet https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/plain/scripts/checkpatch.pl + chmod +x checkpatch.pl + wget --quiet https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/plain/scripts/spelling.txt + echo "invalid.struct.name" >const_structs.checkpatch + export PATH=/tmp/linux/scripts:$PATH + popd + source scripts/checkpatch_inc.sh + function _do() { echo '>>' $*; $*; } + # Run checkpatch.pl: + # - on the tip of the branch only if we're not in a pull request + # - otherwise: + # * on each commit in the development branch that is not in the target (merge to) branch + # * on the global diff if the PR contains more than one commit (useful to check if fixup + # commits do solve previous checkpatch errors) + if [ "${SYSTEM_PULLREQUEST_PULLREQUESTID}" == "" ]; then \ + _do checkpatch HEAD || failed=1; \ + else \ + for c in $(git rev-list HEAD^1..HEAD^2); do \ + _do checkpatch $c || failed=1; \ + done; \ + if [ "$(git rev-list --count HEAD^1..HEAD^2)" -gt 1 ]; then \ + _do checkdiff $(git rev-parse HEAD^1) $(git rev-parse HEAD^2) || failed=1; \ + fi; \ + fi + [ -z "$failed" ] + displayName: 'Run checkpatch' + - script: | + sudo -E bash -c "apt update -qq -y && apt install -qq -y pycodestyle" + pycodestyle scripts/*.py core/arch/arm/plat-stm32mp1/scripts/stm32image.py + displayName: 'Run pycodestyle' + condition: succeededOrFailed() # Run this 'script' even if previous ones failed - job: build_all displayName: 'Build all' pool: |