| Pascal Brand | 2893f86 | 2014-10-07 15:28:44 +0200 | [diff] [blame] | 1 | # One may have a look at http://docs.travis-ci.com/user/installing-dependencies/ |
| 2 | |
| Jerome Forissier | 44e4588 | 2014-11-27 10:42:38 +0100 | [diff] [blame] | 3 | language: c |
| 4 | |
| Pascal Brand | 2893f86 | 2014-10-07 15:28:44 +0200 | [diff] [blame] | 5 | notifications: |
| 6 | - email: true |
| 7 | |
| Jens Wiklander | 82ec680 | 2020-01-29 12:37:33 +0100 | [diff] [blame] | 8 | git: |
| David Brown | bf1d73a | 2020-02-10 14:48:41 -0700 | [diff] [blame] | 9 | depth: false |
| Jens Wiklander | 82ec680 | 2020-01-29 12:37:33 +0100 | [diff] [blame] | 10 | |
| 11 | before_script: |
| 12 | - export OPTEE_CLIENT=$PWD |
| 13 | |
| 14 | # Download checkpatch.pl |
| 15 | - export KERNEL=$HOME/linux && mkdir -p $KERNEL/scripts && cd $KERNEL/scripts |
| Jerome Forissier | eb0b098 | 2020-10-23 14:36:21 +0200 | [diff] [blame] | 16 | - wget https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/plain/scripts/checkpatch.pl && chmod a+x checkpatch.pl |
| 17 | - wget https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/plain/scripts/spelling.txt |
| Jens Wiklander | 82ec680 | 2020-01-29 12:37:33 +0100 | [diff] [blame] | 18 | - echo "invalid.struct.name" >const_structs.checkpatch |
| 19 | - export PATH=$KERNEL/scripts/:$PATH |
| 20 | - cd $OPTEE_CLIENT |
| 21 | - source scripts/checkpatch_inc.sh |
| 22 | |
| Jerome Forissier | 44e4588 | 2014-11-27 10:42:38 +0100 | [diff] [blame] | 23 | # Install the cross-compiler |
| Pascal Brand | 2893f86 | 2014-10-07 15:28:44 +0200 | [diff] [blame] | 24 | before_install: |
| 25 | - sudo apt-get update -qq |
| Jerome Forissier | 7e9c85b | 2019-07-30 17:07:34 +0200 | [diff] [blame] | 26 | - sudo apt-get install -y gcc-arm-linux-gnueabihf libc6-dev-armhf-cross |
| Jerome Forissier | 44e4588 | 2014-11-27 10:42:38 +0100 | [diff] [blame] | 27 | - arm-linux-gnueabihf-gcc --version |
| Jerome Forissier | a1cc349 | 2016-07-18 17:38:00 +0200 | [diff] [blame] | 28 | # Travis does 'export CC=gcc'. Unset CC so that ./flags.mk properly |
| 29 | # defines the cross-compiler to the default value: $(CROSS_COMPILE)gcc. |
| 30 | - unset CC |
| Pascal Brand | 2893f86 | 2014-10-07 15:28:44 +0200 | [diff] [blame] | 31 | |
| 32 | # Several compilation options are checked |
| 33 | script: |
| Jens Wiklander | 82ec680 | 2020-01-29 12:37:33 +0100 | [diff] [blame] | 34 | # Run checkpatch.pl on: |
| 35 | # - the tip of the branch if we're not in a pull request |
| 36 | # - each commit in the development branch that's not in the target branch otherwise |
| 37 | - 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 |
| 38 | # If we have a pull request with more than 1 commit, also check the squashed commits |
| 39 | # Useful to check if fix-up commits do indeed solve previous checkpatch errors |
| 40 | - 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 |
| 41 | |
| Pascal Brand | 2893f86 | 2014-10-07 15:28:44 +0200 | [diff] [blame] | 42 | - make clean all |
| 43 | - CFG_TEE_CLIENT_LOG_LEVEL=0 make clean all |
| 44 | - CFG_TEE_CLIENT_LOG_LEVEL=5 make clean all |