1# One may have a look at http://docs.travis-ci.com/user/installing-dependencies/
2
3language: c
4
5notifications:
6  - email: true
7
8git:
9  depth: false
10
11before_script:
12  - export OPTEE_CLIENT=$PWD
13
14  # Download checkpatch.pl
15  - export KERNEL=$HOME/linux && mkdir -p $KERNEL/scripts && cd $KERNEL/scripts
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
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
23# Install the cross-compiler
24before_install:
25  - sudo apt-get update -qq
26  - sudo apt-get install -y gcc-arm-linux-gnueabihf libc6-dev-armhf-cross
27  - arm-linux-gnueabihf-gcc --version
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
31
32# Several compilation options are checked
33script:
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
42  - make clean all
43  - CFG_TEE_CLIENT_LOG_LEVEL=0 make clean all
44  - CFG_TEE_CLIENT_LOG_LEVEL=5 make clean all
45