blob: 35737b0a8639e44b81dab79cabbcac99750f85dd [file] [log] [blame]
Pascal Brand2893f862014-10-07 15:28:44 +02001# One may have a look at http://docs.travis-ci.com/user/installing-dependencies/
2
Jerome Forissier44e45882014-11-27 10:42:38 +01003language: c
4
Pascal Brand2893f862014-10-07 15:28:44 +02005notifications:
6 - email: true
7
Jens Wiklander82ec6802020-01-29 12:37:33 +01008git:
David Brownbf1d73a2020-02-10 14:48:41 -07009 depth: false
Jens Wiklander82ec6802020-01-29 12:37:33 +010010
11before_script:
12 - export OPTEE_CLIENT=$PWD
13
14 # Download checkpatch.pl
15 - export KERNEL=$HOME/linux && mkdir -p $KERNEL/scripts && cd $KERNEL/scripts
Jerome Forissiereb0b0982020-10-23 14:36:21 +020016 - 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 Wiklander82ec6802020-01-29 12:37:33 +010018 - 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 Forissier44e45882014-11-27 10:42:38 +010023# Install the cross-compiler
Pascal Brand2893f862014-10-07 15:28:44 +020024before_install:
25 - sudo apt-get update -qq
Jerome Forissier7e9c85b2019-07-30 17:07:34 +020026 - sudo apt-get install -y gcc-arm-linux-gnueabihf libc6-dev-armhf-cross
Jerome Forissier44e45882014-11-27 10:42:38 +010027 - arm-linux-gnueabihf-gcc --version
Jerome Forissiera1cc3492016-07-18 17:38:00 +020028 # 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 Brand2893f862014-10-07 15:28:44 +020031
32# Several compilation options are checked
33script:
Jens Wiklander82ec6802020-01-29 12:37:33 +010034 # 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 Brand2893f862014-10-07 15:28:44 +020042 - make clean all
43 - CFG_TEE_CLIENT_LOG_LEVEL=0 make clean all
44 - CFG_TEE_CLIENT_LOG_LEVEL=5 make clean all