blob: 5ef8594c3b428ac4df1a5ec15326387ec229f150 [file] [log] [blame]
Anas Nashifacedb702017-04-25 23:12:08 -04001language: c
2
3compiler: gcc
4
5env:
6 global:
Anas Nashif67848ff2017-10-28 14:40:53 -04007 - SDK=0.9.2
Anas Nashifbd2838b2018-02-10 08:12:01 -06008 - SANITYCHECK_OPTIONS=" --inline-logs"
Anas Nashif2ed5eb32017-09-12 22:00:39 -04009 - SANITYCHECK_OPTIONS_RETRY="${SANITYCHECK_OPTIONS} --only-failed --outdir=out-2nd-pass"
Anas Nashif67848ff2017-10-28 14:40:53 -040010 - ZEPHYR_SDK_INSTALL_DIR=/opt/sdk/zephyr-sdk-0.9.2
Anas Nashif7ee8bb92018-02-11 14:36:21 -060011 - ZEPHYR_TOOLCHAIN_VARIANT=zephyr
Anas Nashif036dde22017-11-08 20:02:34 -050012 - MATRIX_BUILDS="4"
13 - MATRIX_BUILDS_EXTRA="4"
Anas Nashifacedb702017-04-25 23:12:08 -040014 matrix:
Anas Nashif52cc2342017-05-18 07:49:47 -040015 - MATRIX_BUILD="1"
16 - MATRIX_BUILD="2"
Anas Nashifa24e6ba2017-07-19 12:45:02 +030017 - MATRIX_BUILD="3"
Anas Nashif7c1602d2017-10-28 14:24:18 -040018 - MATRIX_BUILD="4"
Anas Nashifacedb702017-04-25 23:12:08 -040019
20build:
21 cache: true
22 cache_dir_list:
23 - ${SHIPPABLE_BUILD_DIR}/ccache
24 pre_ci_boot:
Anas Nashif5fc31b82017-05-19 16:17:16 -040025 image_name: zephyrprojectrtos/ci
Anas Nashife09646a2018-01-11 06:45:51 -050026 image_tag: v0.3
Anas Nashifacedb702017-04-25 23:12:08 -040027 pull: true
28 options: "-e HOME=/home/buildslave --privileged=true --tty --net=bridge --user buildslave"
29
30 ci:
Anas Nashifacedb702017-04-25 23:12:08 -040031 - export CCACHE_DIR=${SHIPPABLE_BUILD_DIR}/ccache/.ccache
Anas Nashifb127aff2017-10-06 08:41:09 -040032 - >
33 if [ "$IS_PULL_REQUEST" = "true" ]; then
34 git rebase origin/${PULL_REQUEST_BASE_BRANCH};
35 fi
Anas Nashifacedb702017-04-25 23:12:08 -040036 - source zephyr-env.sh
Anas Nashif52cc2342017-05-18 07:49:47 -040037 - ccache -c -s --max-size=2000M
Anas Nashifacedb702017-04-25 23:12:08 -040038 - >
Anas Nashif036dde22017-11-08 20:02:34 -050039 if [ "$MATRIX_BUILD" = "4" -a "$IS_PULL_REQUEST" = "true" ]; then
Anas Nashif0ea8e3e2017-07-19 10:37:39 +030040 export COMMIT_RANGE=origin/${PULL_REQUEST_BASE_BRANCH}..HEAD
Anas Nashif2dc9ae42017-04-28 20:30:13 -040041 echo "Building a Pull Request";
Anas Nashif3a212f82017-04-29 22:36:11 -040042 echo "- Building Documentation";
Kumar Gala9b874d62017-05-04 10:04:34 -050043 echo "Commit range:" ${COMMIT_RANGE}
Anas Nashif706ac7f2017-11-10 08:27:08 -050044 make htmldocs
Anas Nashif3bbd1c72018-01-12 15:01:44 -050045 if [ "$?" != "0" ]; then
46 echo "Documentation build failed";
47 exit 1;
48 fi
Anas Nashif706ac7f2017-11-10 08:27:08 -050049 if [ -s doc/doc.warnings ]; then
Anas Nashif3a212f82017-04-29 22:36:11 -040050 echo " => New documentation warnings/errors";
Anas Nashife8391cb2017-11-15 07:34:11 -050051 cp doc/doc.warnings doc.warnings
Anas Nashif3a212f82017-04-29 22:36:11 -040052 fi;
David B. Kinderd3b0cd42017-09-21 11:55:15 -070053 echo "- Verify commit message, coding style, doc build";
Anas Nashif2f117af2017-05-09 16:57:00 -040054 ./scripts/ci/check-compliance.py --commits ${COMMIT_RANGE} || true;
Anas Nashifacedb702017-04-25 23:12:08 -040055 fi;
56 - >
Anas Nashifb127aff2017-10-06 08:41:09 -040057 if [ "$IS_PULL_REQUEST" = "true" ]; then
58 ./scripts/ci/get_modified_tests.py --commits origin/${PULL_REQUEST_BASE_BRANCH}..HEAD > modified_tests.args;
59 ./scripts/ci/get_modified_boards.py --commits origin/${PULL_REQUEST_BASE_BRANCH}..HEAD > modified_boards.args;
Anas Nashif31df3b22017-07-27 08:45:01 -040060
Anas Nashifb127aff2017-10-06 08:41:09 -040061 if [ -s modified_boards.args ]; then
Anas Nashif1e107672018-01-05 22:30:33 -050062 ./scripts/sanitycheck ${SANITYCHECK_OPTIONS} +modified_boards.args --save-tests test_file.txt;
Anas Nashifb127aff2017-10-06 08:41:09 -040063 fi;
64 if [ -s modified_tests.args ]; then
Anas Nashif1e107672018-01-05 22:30:33 -050065 ./scripts/sanitycheck ${SANITYCHECK_OPTIONS} +modified_tests.args --save-tests test_file.txt;
Anas Nashifb127aff2017-10-06 08:41:09 -040066 fi;
67 rm -f modified_tests.args modified_boards.args;
Anas Nashifc1cafb12017-08-09 23:34:14 -040068 fi;
Anas Nashiff8aa9e62017-09-02 14:37:51 -040069 - ./scripts/sanitycheck ${SANITYCHECK_OPTIONS} --save-tests test_file.txt
Anas Nashif1e107672018-01-05 22:30:33 -050070 - ./scripts/sanitycheck ${SANITYCHECK_OPTIONS} --load-tests test_file.txt --subset ${MATRIX_BUILD}/${MATRIX_BUILDS} || ./scripts/sanitycheck ${SANITYCHECK_OPTIONS_RETRY} || ./scripts/sanitycheck ${SANITYCHECK_OPTIONS_RETRY}
Anas Nashiff8aa9e62017-09-02 14:37:51 -040071 - rm test_file.txt
Anas Nashifacedb702017-04-25 23:12:08 -040072 - ccache -s
Anas Nashifaa05b952017-08-02 12:34:24 -040073 on_failure:
Anas Nashif9b1b0fc2018-01-02 09:45:54 -050074 - rm -rf ccache
Anas Nashifaa05b952017-08-02 12:34:24 -040075 - mkdir -p shippable/testresults
Anas Nashifbe1d4092017-11-24 14:40:20 -050076 - mkdir -p shippable/codecoverage
77 - source zephyr-env.sh
Anas Nashif29240002018-01-05 08:28:23 -050078 - >
79 if [ "$MATRIX_BUILD" = "1" ]; then
80 gcovr -r ${ZEPHYR_BASE} -x > shippable/codecoverage/coverage.xml;
Alberto Escolar Piedrasc6524ab2018-02-08 21:35:55 +010081 lcov --capture --directory sanity-out/native_posix/ --directory sanity-out/unit_testing/ --output-file lcov.pre.info -q --rc lcov_branch_coverage=1;
Alberto Escolar Piedrasd82ff172018-02-03 20:35:15 +010082 lcov -q --remove lcov.pre.info *generated* -o lcov.info --rc lcov_branch_coverage=1;
83 rm lcov.pre.info;
Anas Nashif29240002018-01-05 08:28:23 -050084 rm -rf sanity-out out-2nd-pass;
Alberto Escolar Piedrasd82ff172018-02-03 20:35:15 +010085 bash <(curl -s https://codecov.io/bash) -f "lcov.info" -X coveragepy -X fixes;
86 rm lcov.info;
Anas Nashif29240002018-01-05 08:28:23 -050087 else
88 rm -rf sanity-out out-2nd-pass;
89 fi;
Anas Nashifaa05b952017-08-02 12:34:24 -040090 - >
91 if [ -e compliance.xml ]; then
92 cp compliance.xml shippable/testresults/;
Anas Nashifaa05b952017-08-02 12:34:24 -040093 fi;
94 - >
95 if [ -e ./scripts/sanity_chk/last_sanity.xml ]; then
96 cp ./scripts/sanity_chk/last_sanity.xml shippable/testresults/;
Anas Nashifaa05b952017-08-02 12:34:24 -040097 fi;
Anas Nashifaa05b952017-08-02 12:34:24 -040098 on_success:
Anas Nashif9b1b0fc2018-01-02 09:45:54 -050099 - rm -rf ccache
Anas Nashifacedb702017-04-25 23:12:08 -0400100 - mkdir -p shippable/testresults
Anas Nashifbe1d4092017-11-24 14:40:20 -0500101 - mkdir -p shippable/codecoverage
102 - source zephyr-env.sh
Anas Nashif29240002018-01-05 08:28:23 -0500103 - >
104 if [ "$MATRIX_BUILD" = "1" ]; then
105 gcovr -r ${ZEPHYR_BASE} -x > shippable/codecoverage/coverage.xml;
Alberto Escolar Piedrasc6524ab2018-02-08 21:35:55 +0100106 lcov --capture --directory sanity-out/native_posix/ --directory sanity-out/unit_testing/ --output-file lcov.pre.info -q --rc lcov_branch_coverage=1;
Alberto Escolar Piedrasd82ff172018-02-03 20:35:15 +0100107 lcov -q --remove lcov.pre.info *generated* -o lcov.info --rc lcov_branch_coverage=1;
108 rm lcov.pre.info;
Anas Nashif29240002018-01-05 08:28:23 -0500109 rm -rf sanity-out out-2nd-pass;
Alberto Escolar Piedrasd82ff172018-02-03 20:35:15 +0100110 bash <(curl -s https://codecov.io/bash) -f "lcov.info" -X coveragepy -X fixes;
111 rm lcov.info;
Anas Nashif29240002018-01-05 08:28:23 -0500112 else
113 rm -rf sanity-out out-2nd-pass;
114 fi;
Anas Nashifacedb702017-04-25 23:12:08 -0400115 - >
116 if [ -e compliance.xml ]; then
117 cp compliance.xml shippable/testresults/;
118 fi;
Anas Nashifacedb702017-04-25 23:12:08 -0400119 - >
120 if [ -e ./scripts/sanity_chk/last_sanity.xml ]; then
121 cp ./scripts/sanity_chk/last_sanity.xml shippable/testresults/;
122 fi;
Anas Nashifacedb702017-04-25 23:12:08 -0400123
124integrations:
125 notifications:
Anas Nashif3a212f82017-04-29 22:36:11 -0400126 - integrationName: slack_integration
127 type: slack
128 recipients:
129 - "#ci"
130 branches:
131 only:
132 - master
133 on_success: never
134 on_failure: always
Anas Nashifacedb702017-04-25 23:12:08 -0400135 - integrationName: email
136 type: email
137 recipients:
138 - builds@zephyrproject.org
139 branches:
140 only:
141 - master
142 - net
143 - bluetooth
144 - arm
145 on_success: never
146 on_failure: never