Anas Nashif | acedb70 | 2017-04-25 23:12:08 -0400 | [diff] [blame] | 1 | language: c |
| 2 | |
| 3 | compiler: gcc |
| 4 | |
| 5 | env: |
| 6 | global: |
Anas Nashif | 67848ff | 2017-10-28 14:40:53 -0400 | [diff] [blame] | 7 | - SDK=0.9.2 |
Anas Nashif | bd2838b | 2018-02-10 08:12:01 -0600 | [diff] [blame] | 8 | - SANITYCHECK_OPTIONS=" --inline-logs" |
Anas Nashif | 2ed5eb3 | 2017-09-12 22:00:39 -0400 | [diff] [blame] | 9 | - SANITYCHECK_OPTIONS_RETRY="${SANITYCHECK_OPTIONS} --only-failed --outdir=out-2nd-pass" |
Anas Nashif | 67848ff | 2017-10-28 14:40:53 -0400 | [diff] [blame] | 10 | - ZEPHYR_SDK_INSTALL_DIR=/opt/sdk/zephyr-sdk-0.9.2 |
Anas Nashif | 7ee8bb9 | 2018-02-11 14:36:21 -0600 | [diff] [blame] | 11 | - ZEPHYR_TOOLCHAIN_VARIANT=zephyr |
Anas Nashif | 036dde2 | 2017-11-08 20:02:34 -0500 | [diff] [blame] | 12 | - MATRIX_BUILDS="4" |
| 13 | - MATRIX_BUILDS_EXTRA="4" |
Anas Nashif | acedb70 | 2017-04-25 23:12:08 -0400 | [diff] [blame] | 14 | matrix: |
Anas Nashif | 52cc234 | 2017-05-18 07:49:47 -0400 | [diff] [blame] | 15 | - MATRIX_BUILD="1" |
| 16 | - MATRIX_BUILD="2" |
Anas Nashif | a24e6ba | 2017-07-19 12:45:02 +0300 | [diff] [blame] | 17 | - MATRIX_BUILD="3" |
Anas Nashif | 7c1602d | 2017-10-28 14:24:18 -0400 | [diff] [blame] | 18 | - MATRIX_BUILD="4" |
Anas Nashif | acedb70 | 2017-04-25 23:12:08 -0400 | [diff] [blame] | 19 | |
| 20 | build: |
| 21 | cache: true |
| 22 | cache_dir_list: |
| 23 | - ${SHIPPABLE_BUILD_DIR}/ccache |
| 24 | pre_ci_boot: |
Anas Nashif | 5fc31b8 | 2017-05-19 16:17:16 -0400 | [diff] [blame] | 25 | image_name: zephyrprojectrtos/ci |
Anas Nashif | e09646a | 2018-01-11 06:45:51 -0500 | [diff] [blame] | 26 | image_tag: v0.3 |
Anas Nashif | acedb70 | 2017-04-25 23:12:08 -0400 | [diff] [blame] | 27 | pull: true |
| 28 | options: "-e HOME=/home/buildslave --privileged=true --tty --net=bridge --user buildslave" |
| 29 | |
| 30 | ci: |
Anas Nashif | acedb70 | 2017-04-25 23:12:08 -0400 | [diff] [blame] | 31 | - export CCACHE_DIR=${SHIPPABLE_BUILD_DIR}/ccache/.ccache |
Anas Nashif | b127aff | 2017-10-06 08:41:09 -0400 | [diff] [blame] | 32 | - > |
| 33 | if [ "$IS_PULL_REQUEST" = "true" ]; then |
| 34 | git rebase origin/${PULL_REQUEST_BASE_BRANCH}; |
| 35 | fi |
Anas Nashif | acedb70 | 2017-04-25 23:12:08 -0400 | [diff] [blame] | 36 | - source zephyr-env.sh |
Anas Nashif | 52cc234 | 2017-05-18 07:49:47 -0400 | [diff] [blame] | 37 | - ccache -c -s --max-size=2000M |
Anas Nashif | acedb70 | 2017-04-25 23:12:08 -0400 | [diff] [blame] | 38 | - > |
Anas Nashif | 036dde2 | 2017-11-08 20:02:34 -0500 | [diff] [blame] | 39 | if [ "$MATRIX_BUILD" = "4" -a "$IS_PULL_REQUEST" = "true" ]; then |
Anas Nashif | 0ea8e3e | 2017-07-19 10:37:39 +0300 | [diff] [blame] | 40 | export COMMIT_RANGE=origin/${PULL_REQUEST_BASE_BRANCH}..HEAD |
Anas Nashif | 2dc9ae4 | 2017-04-28 20:30:13 -0400 | [diff] [blame] | 41 | echo "Building a Pull Request"; |
Anas Nashif | 3a212f8 | 2017-04-29 22:36:11 -0400 | [diff] [blame] | 42 | echo "- Building Documentation"; |
Kumar Gala | 9b874d6 | 2017-05-04 10:04:34 -0500 | [diff] [blame] | 43 | echo "Commit range:" ${COMMIT_RANGE} |
Anas Nashif | 706ac7f | 2017-11-10 08:27:08 -0500 | [diff] [blame] | 44 | make htmldocs |
Anas Nashif | 3bbd1c7 | 2018-01-12 15:01:44 -0500 | [diff] [blame] | 45 | if [ "$?" != "0" ]; then |
| 46 | echo "Documentation build failed"; |
| 47 | exit 1; |
| 48 | fi |
Anas Nashif | 706ac7f | 2017-11-10 08:27:08 -0500 | [diff] [blame] | 49 | if [ -s doc/doc.warnings ]; then |
Anas Nashif | 3a212f8 | 2017-04-29 22:36:11 -0400 | [diff] [blame] | 50 | echo " => New documentation warnings/errors"; |
Anas Nashif | e8391cb | 2017-11-15 07:34:11 -0500 | [diff] [blame] | 51 | cp doc/doc.warnings doc.warnings |
Anas Nashif | 3a212f8 | 2017-04-29 22:36:11 -0400 | [diff] [blame] | 52 | fi; |
David B. Kinder | d3b0cd4 | 2017-09-21 11:55:15 -0700 | [diff] [blame] | 53 | echo "- Verify commit message, coding style, doc build"; |
Anas Nashif | 2f117af | 2017-05-09 16:57:00 -0400 | [diff] [blame] | 54 | ./scripts/ci/check-compliance.py --commits ${COMMIT_RANGE} || true; |
Anas Nashif | acedb70 | 2017-04-25 23:12:08 -0400 | [diff] [blame] | 55 | fi; |
| 56 | - > |
Anas Nashif | b127aff | 2017-10-06 08:41:09 -0400 | [diff] [blame] | 57 | 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 Nashif | 31df3b2 | 2017-07-27 08:45:01 -0400 | [diff] [blame] | 60 | |
Anas Nashif | b127aff | 2017-10-06 08:41:09 -0400 | [diff] [blame] | 61 | if [ -s modified_boards.args ]; then |
Anas Nashif | 1e10767 | 2018-01-05 22:30:33 -0500 | [diff] [blame] | 62 | ./scripts/sanitycheck ${SANITYCHECK_OPTIONS} +modified_boards.args --save-tests test_file.txt; |
Anas Nashif | b127aff | 2017-10-06 08:41:09 -0400 | [diff] [blame] | 63 | fi; |
| 64 | if [ -s modified_tests.args ]; then |
Anas Nashif | 1e10767 | 2018-01-05 22:30:33 -0500 | [diff] [blame] | 65 | ./scripts/sanitycheck ${SANITYCHECK_OPTIONS} +modified_tests.args --save-tests test_file.txt; |
Anas Nashif | b127aff | 2017-10-06 08:41:09 -0400 | [diff] [blame] | 66 | fi; |
| 67 | rm -f modified_tests.args modified_boards.args; |
Anas Nashif | c1cafb1 | 2017-08-09 23:34:14 -0400 | [diff] [blame] | 68 | fi; |
Anas Nashif | f8aa9e6 | 2017-09-02 14:37:51 -0400 | [diff] [blame] | 69 | - ./scripts/sanitycheck ${SANITYCHECK_OPTIONS} --save-tests test_file.txt |
Anas Nashif | 1e10767 | 2018-01-05 22:30:33 -0500 | [diff] [blame] | 70 | - ./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 Nashif | f8aa9e6 | 2017-09-02 14:37:51 -0400 | [diff] [blame] | 71 | - rm test_file.txt |
Anas Nashif | acedb70 | 2017-04-25 23:12:08 -0400 | [diff] [blame] | 72 | - ccache -s |
Anas Nashif | aa05b95 | 2017-08-02 12:34:24 -0400 | [diff] [blame] | 73 | on_failure: |
Anas Nashif | 9b1b0fc | 2018-01-02 09:45:54 -0500 | [diff] [blame] | 74 | - rm -rf ccache |
Anas Nashif | aa05b95 | 2017-08-02 12:34:24 -0400 | [diff] [blame] | 75 | - mkdir -p shippable/testresults |
Anas Nashif | be1d409 | 2017-11-24 14:40:20 -0500 | [diff] [blame] | 76 | - mkdir -p shippable/codecoverage |
| 77 | - source zephyr-env.sh |
Anas Nashif | 2924000 | 2018-01-05 08:28:23 -0500 | [diff] [blame] | 78 | - > |
| 79 | if [ "$MATRIX_BUILD" = "1" ]; then |
| 80 | gcovr -r ${ZEPHYR_BASE} -x > shippable/codecoverage/coverage.xml; |
Alberto Escolar Piedras | c6524ab | 2018-02-08 21:35:55 +0100 | [diff] [blame] | 81 | 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 Piedras | d82ff17 | 2018-02-03 20:35:15 +0100 | [diff] [blame] | 82 | lcov -q --remove lcov.pre.info *generated* -o lcov.info --rc lcov_branch_coverage=1; |
| 83 | rm lcov.pre.info; |
Anas Nashif | 2924000 | 2018-01-05 08:28:23 -0500 | [diff] [blame] | 84 | rm -rf sanity-out out-2nd-pass; |
Alberto Escolar Piedras | d82ff17 | 2018-02-03 20:35:15 +0100 | [diff] [blame] | 85 | bash <(curl -s https://codecov.io/bash) -f "lcov.info" -X coveragepy -X fixes; |
| 86 | rm lcov.info; |
Anas Nashif | 2924000 | 2018-01-05 08:28:23 -0500 | [diff] [blame] | 87 | else |
| 88 | rm -rf sanity-out out-2nd-pass; |
| 89 | fi; |
Anas Nashif | aa05b95 | 2017-08-02 12:34:24 -0400 | [diff] [blame] | 90 | - > |
| 91 | if [ -e compliance.xml ]; then |
| 92 | cp compliance.xml shippable/testresults/; |
Anas Nashif | aa05b95 | 2017-08-02 12:34:24 -0400 | [diff] [blame] | 93 | fi; |
| 94 | - > |
| 95 | if [ -e ./scripts/sanity_chk/last_sanity.xml ]; then |
| 96 | cp ./scripts/sanity_chk/last_sanity.xml shippable/testresults/; |
Anas Nashif | aa05b95 | 2017-08-02 12:34:24 -0400 | [diff] [blame] | 97 | fi; |
Anas Nashif | aa05b95 | 2017-08-02 12:34:24 -0400 | [diff] [blame] | 98 | on_success: |
Anas Nashif | 9b1b0fc | 2018-01-02 09:45:54 -0500 | [diff] [blame] | 99 | - rm -rf ccache |
Anas Nashif | acedb70 | 2017-04-25 23:12:08 -0400 | [diff] [blame] | 100 | - mkdir -p shippable/testresults |
Anas Nashif | be1d409 | 2017-11-24 14:40:20 -0500 | [diff] [blame] | 101 | - mkdir -p shippable/codecoverage |
| 102 | - source zephyr-env.sh |
Anas Nashif | 2924000 | 2018-01-05 08:28:23 -0500 | [diff] [blame] | 103 | - > |
| 104 | if [ "$MATRIX_BUILD" = "1" ]; then |
| 105 | gcovr -r ${ZEPHYR_BASE} -x > shippable/codecoverage/coverage.xml; |
Alberto Escolar Piedras | c6524ab | 2018-02-08 21:35:55 +0100 | [diff] [blame] | 106 | 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 Piedras | d82ff17 | 2018-02-03 20:35:15 +0100 | [diff] [blame] | 107 | lcov -q --remove lcov.pre.info *generated* -o lcov.info --rc lcov_branch_coverage=1; |
| 108 | rm lcov.pre.info; |
Anas Nashif | 2924000 | 2018-01-05 08:28:23 -0500 | [diff] [blame] | 109 | rm -rf sanity-out out-2nd-pass; |
Alberto Escolar Piedras | d82ff17 | 2018-02-03 20:35:15 +0100 | [diff] [blame] | 110 | bash <(curl -s https://codecov.io/bash) -f "lcov.info" -X coveragepy -X fixes; |
| 111 | rm lcov.info; |
Anas Nashif | 2924000 | 2018-01-05 08:28:23 -0500 | [diff] [blame] | 112 | else |
| 113 | rm -rf sanity-out out-2nd-pass; |
| 114 | fi; |
Anas Nashif | acedb70 | 2017-04-25 23:12:08 -0400 | [diff] [blame] | 115 | - > |
| 116 | if [ -e compliance.xml ]; then |
| 117 | cp compliance.xml shippable/testresults/; |
| 118 | fi; |
Anas Nashif | acedb70 | 2017-04-25 23:12:08 -0400 | [diff] [blame] | 119 | - > |
| 120 | if [ -e ./scripts/sanity_chk/last_sanity.xml ]; then |
| 121 | cp ./scripts/sanity_chk/last_sanity.xml shippable/testresults/; |
| 122 | fi; |
Anas Nashif | acedb70 | 2017-04-25 23:12:08 -0400 | [diff] [blame] | 123 | |
| 124 | integrations: |
| 125 | notifications: |
Anas Nashif | 3a212f8 | 2017-04-29 22:36:11 -0400 | [diff] [blame] | 126 | - 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 Nashif | acedb70 | 2017-04-25 23:12:08 -0400 | [diff] [blame] | 135 | - 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 |