blob: 1a2faef0d99a6e6423b02a7373cde7edce06d6ed [file] [log] [blame]
Jerome Forissier8353e242014-11-26 16:57:07 +01001language: c
2
Pascal Brand260fa3f2014-10-08 08:18:53 +02003notifications:
4 - email: true
5
Jens Wiklander517d41f2016-02-29 15:02:13 +01006git:
7 depth: 1000000
8
Pascal Brand260fa3f2014-10-08 08:18:53 +02009before_script:
Jerome Forissiera1387892019-02-22 17:01:06 +010010 - export OPTEE_OS=$PWD
Pascal Brand1b10abf2014-10-20 13:24:54 +020011
Pascal Brand7d657272014-11-03 12:49:01 +010012 # Download checkpatch.pl
Jerome Forissiera1387892019-02-22 17:01:06 +010013 - export KERNEL=$HOME/linux && mkdir -p $KERNEL/scripts && cd $KERNEL/scripts
Pascal Brand7d657272014-11-03 12:49:01 +010014 - wget https://raw.githubusercontent.com/torvalds/linux/master/scripts/checkpatch.pl && chmod a+x checkpatch.pl
Pascal Brand1b10abf2014-10-20 13:24:54 +020015 - wget https://raw.githubusercontent.com/torvalds/linux/master/scripts/spelling.txt
Jens Wiklander51ff8502016-10-19 17:50:45 +020016 - echo "invalid.struct.name" >const_structs.checkpatch
Jerome Forissiera1387892019-02-22 17:01:06 +010017 - export PATH=$KERNEL/scripts/:$PATH
18 - cd $OPTEE_OS
19 - source scripts/checkpatch_inc.sh
Pascal Brand1b10abf2014-10-20 13:24:54 +020020
Jerome Forissiera1387892019-02-22 17:01:06 +010021 # Install pycodestyle
Jerome Forissiera3a309a2018-11-14 13:36:08 +010022 - pip install --upgrade --user pycodestyle
Jerome Forissier644dfaa2017-11-27 16:40:16 +010023
Pascal Brand260fa3f2014-10-08 08:18:53 +020024script:
Jerome Forissiere04653b2016-08-26 10:40:06 +020025 # Run checkpatch.pl on:
26 # - the tip of the branch if we're not in a pull request
27 # - each commit in the development branch that's not in the target branch otherwise
28 - if [ "$TRAVIS_PULL_REQUEST" == "false" ]; then checkpatch HEAD; else for c in $(git rev-list HEAD^1..HEAD^2); do checkpatch $c || failed=1; done; [ -z "$failed" ]; fi
Jerome Forissier3891de72016-09-14 17:55:39 +020029 # If we have a pull request with more than 1 commit, also check the squashed commits
30 # Useful to check if fix-up commits do indeed solve previous checkpatch errors
31 - if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then if [ "$(git rev-list --count HEAD^1..HEAD^2)" -gt 1 ]; then checkdiff $(git rev-parse HEAD^1) $(git rev-parse HEAD^2); fi; fi
Pascal Brand1b10abf2014-10-20 13:24:54 +020032
Jerome Forissiera3a309a2018-11-14 13:36:08 +010033 # Check Python style
Jerome Forissiera1387892019-02-22 17:01:06 +010034 - pycodestyle scripts/*.py core/arch/arm/plat-stm32mp1/scripts/stm32image.py