blob: d395656270812a0cfdb25fe40f032913d9039bbb [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 Nashifefc66842017-05-04 18:15:11 -04008 - SANITYCHECK_OPTIONS=" --inline-logs -R"
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 Nashifacedb702017-04-25 23:12:08 -040011 - ZEPHYR_GCC_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 Nashif67848ff2017-10-28 14:40:53 -040026 image_tag: v0.2
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
45 if [ -s doc/doc.warnings ]; then
Anas Nashif3a212f82017-04-29 22:36:11 -040046 echo " => New documentation warnings/errors";
Anas Nashife8391cb2017-11-15 07:34:11 -050047 cp doc/doc.warnings doc.warnings
Anas Nashif3a212f82017-04-29 22:36:11 -040048 fi;
David B. Kinderd3b0cd42017-09-21 11:55:15 -070049 echo "- Verify commit message, coding style, doc build";
Anas Nashif2f117af2017-05-09 16:57:00 -040050 ./scripts/ci/check-compliance.py --commits ${COMMIT_RANGE} || true;
Anas Nashifacedb702017-04-25 23:12:08 -040051 fi;
52 - >
Anas Nashifb127aff2017-10-06 08:41:09 -040053 if [ "$IS_PULL_REQUEST" = "true" ]; then
54 ./scripts/ci/get_modified_tests.py --commits origin/${PULL_REQUEST_BASE_BRANCH}..HEAD > modified_tests.args;
55 ./scripts/ci/get_modified_boards.py --commits origin/${PULL_REQUEST_BASE_BRANCH}..HEAD > modified_boards.args;
Anas Nashif31df3b22017-07-27 08:45:01 -040056
Anas Nashifb127aff2017-10-06 08:41:09 -040057 if [ -s modified_boards.args ]; then
58 ./scripts/sanitycheck +modified_boards.args --save-tests test_file.txt;
59 fi;
60 if [ -s modified_tests.args ]; then
61 ./scripts/sanitycheck +modified_tests.args --save-tests test_file.txt;
62 fi;
63 rm -f modified_tests.args modified_boards.args;
Anas Nashifc1cafb12017-08-09 23:34:14 -040064 fi;
Anas Nashiff8aa9e62017-09-02 14:37:51 -040065 - ./scripts/sanitycheck ${SANITYCHECK_OPTIONS} --save-tests test_file.txt
Anas Nashif2ed5eb32017-09-12 22:00:39 -040066 - ./scripts/sanitycheck --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 -040067 - rm test_file.txt
Anas Nashifacedb702017-04-25 23:12:08 -040068 - ccache -s
Anas Nashifaa05b952017-08-02 12:34:24 -040069 on_failure:
70 - rm -rf sanity-out out-2nd-pass
71 - mkdir -p shippable/testresults
72 - >
73 if [ -e compliance.xml ]; then
74 cp compliance.xml shippable/testresults/;
Anas Nashifaa05b952017-08-02 12:34:24 -040075 fi;
76 - >
77 if [ -e ./scripts/sanity_chk/last_sanity.xml ]; then
78 cp ./scripts/sanity_chk/last_sanity.xml shippable/testresults/;
Anas Nashifaa05b952017-08-02 12:34:24 -040079 fi;
Anas Nashifaa05b952017-08-02 12:34:24 -040080 on_success:
Anas Nashifacedb702017-04-25 23:12:08 -040081 - rm -rf sanity-out out-2nd-pass
82 - mkdir -p shippable/testresults
83 - >
84 if [ -e compliance.xml ]; then
85 cp compliance.xml shippable/testresults/;
86 fi;
Anas Nashifacedb702017-04-25 23:12:08 -040087 - >
88 if [ -e ./scripts/sanity_chk/last_sanity.xml ]; then
89 cp ./scripts/sanity_chk/last_sanity.xml shippable/testresults/;
90 fi;
Anas Nashifacedb702017-04-25 23:12:08 -040091
92integrations:
93 notifications:
Anas Nashif3a212f82017-04-29 22:36:11 -040094 - integrationName: slack_integration
95 type: slack
96 recipients:
97 - "#ci"
98 branches:
99 only:
100 - master
101 on_success: never
102 on_failure: always
Anas Nashifacedb702017-04-25 23:12:08 -0400103 - integrationName: email
104 type: email
105 recipients:
106 - builds@zephyrproject.org
107 branches:
108 only:
109 - master
110 - net
111 - bluetooth
112 - arm
113 on_success: never
114 on_failure: never