2017-04-26 11:12:08 +08:00
|
|
|
language: c
|
|
|
|
|
|
|
|
compiler: gcc
|
|
|
|
|
|
|
|
env:
|
|
|
|
global:
|
2018-05-15 01:36:15 +08:00
|
|
|
- SDK=0.9.3
|
2018-02-10 22:12:01 +08:00
|
|
|
- SANITYCHECK_OPTIONS=" --inline-logs"
|
2017-09-13 10:00:39 +08:00
|
|
|
- SANITYCHECK_OPTIONS_RETRY="${SANITYCHECK_OPTIONS} --only-failed --outdir=out-2nd-pass"
|
2018-05-15 01:36:15 +08:00
|
|
|
- ZEPHYR_SDK_INSTALL_DIR=/opt/sdk/zephyr-sdk-0.9.3
|
2018-02-12 04:36:21 +08:00
|
|
|
- ZEPHYR_TOOLCHAIN_VARIANT=zephyr
|
2018-04-04 22:58:28 +08:00
|
|
|
- MATRIX_BUILDS="5"
|
|
|
|
- MATRIX_BUILDS_EXTRA="5"
|
2017-04-26 11:12:08 +08:00
|
|
|
matrix:
|
2017-05-18 19:49:47 +08:00
|
|
|
- MATRIX_BUILD="1"
|
|
|
|
- MATRIX_BUILD="2"
|
2017-07-19 17:45:02 +08:00
|
|
|
- MATRIX_BUILD="3"
|
2017-10-29 02:24:18 +08:00
|
|
|
- MATRIX_BUILD="4"
|
2018-04-04 22:58:28 +08:00
|
|
|
- MATRIX_BUILD="5"
|
2017-04-26 11:12:08 +08:00
|
|
|
|
|
|
|
build:
|
|
|
|
cache: true
|
|
|
|
cache_dir_list:
|
|
|
|
- ${SHIPPABLE_BUILD_DIR}/ccache
|
|
|
|
pre_ci_boot:
|
2017-05-20 04:17:16 +08:00
|
|
|
image_name: zephyrprojectrtos/ci
|
2018-05-15 01:36:15 +08:00
|
|
|
image_tag: v0.4-rc2
|
2017-04-26 11:12:08 +08:00
|
|
|
pull: true
|
|
|
|
options: "-e HOME=/home/buildslave --privileged=true --tty --net=bridge --user buildslave"
|
|
|
|
|
|
|
|
ci:
|
|
|
|
- export CCACHE_DIR=${SHIPPABLE_BUILD_DIR}/ccache/.ccache
|
2017-10-06 20:41:09 +08:00
|
|
|
- >
|
|
|
|
if [ "$IS_PULL_REQUEST" = "true" ]; then
|
|
|
|
git rebase origin/${PULL_REQUEST_BASE_BRANCH};
|
|
|
|
fi
|
2017-04-26 11:12:08 +08:00
|
|
|
- source zephyr-env.sh
|
2017-05-18 19:49:47 +08:00
|
|
|
- ccache -c -s --max-size=2000M
|
2017-04-30 10:36:11 +08:00
|
|
|
- >
|
2018-04-04 22:58:28 +08:00
|
|
|
if [ "$MATRIX_BUILD" = "5" -a "$IS_PULL_REQUEST" = "true" ]; then
|
2017-07-19 15:37:39 +08:00
|
|
|
export COMMIT_RANGE=origin/${PULL_REQUEST_BASE_BRANCH}..HEAD
|
2017-04-29 08:30:13 +08:00
|
|
|
echo "Building a Pull Request";
|
2017-04-30 10:36:11 +08:00
|
|
|
echo "- Building Documentation";
|
2017-05-04 23:04:34 +08:00
|
|
|
echo "Commit range:" ${COMMIT_RANGE}
|
2017-11-10 21:27:08 +08:00
|
|
|
make htmldocs
|
2018-01-13 04:01:44 +08:00
|
|
|
if [ "$?" != "0" ]; then
|
|
|
|
echo "Documentation build failed";
|
|
|
|
exit 1;
|
|
|
|
fi
|
2017-11-10 21:27:08 +08:00
|
|
|
if [ -s doc/doc.warnings ]; then
|
2017-04-30 10:36:11 +08:00
|
|
|
echo " => New documentation warnings/errors";
|
2017-11-15 20:34:11 +08:00
|
|
|
cp doc/doc.warnings doc.warnings
|
2017-04-30 10:36:11 +08:00
|
|
|
fi;
|
2017-09-22 02:55:15 +08:00
|
|
|
echo "- Verify commit message, coding style, doc build";
|
2017-05-10 04:57:00 +08:00
|
|
|
./scripts/ci/check-compliance.py --commits ${COMMIT_RANGE} || true;
|
2017-04-26 11:12:08 +08:00
|
|
|
fi;
|
2017-07-27 20:45:01 +08:00
|
|
|
- >
|
2017-10-06 20:41:09 +08:00
|
|
|
if [ "$IS_PULL_REQUEST" = "true" ]; then
|
|
|
|
./scripts/ci/get_modified_tests.py --commits origin/${PULL_REQUEST_BASE_BRANCH}..HEAD > modified_tests.args;
|
|
|
|
./scripts/ci/get_modified_boards.py --commits origin/${PULL_REQUEST_BASE_BRANCH}..HEAD > modified_boards.args;
|
2017-07-27 20:45:01 +08:00
|
|
|
|
2017-10-06 20:41:09 +08:00
|
|
|
if [ -s modified_boards.args ]; then
|
2018-01-06 11:30:33 +08:00
|
|
|
./scripts/sanitycheck ${SANITYCHECK_OPTIONS} +modified_boards.args --save-tests test_file.txt;
|
2017-10-06 20:41:09 +08:00
|
|
|
fi;
|
|
|
|
if [ -s modified_tests.args ]; then
|
2018-01-06 11:30:33 +08:00
|
|
|
./scripts/sanitycheck ${SANITYCHECK_OPTIONS} +modified_tests.args --save-tests test_file.txt;
|
2017-10-06 20:41:09 +08:00
|
|
|
fi;
|
|
|
|
rm -f modified_tests.args modified_boards.args;
|
2017-07-27 20:45:01 +08:00
|
|
|
fi;
|
2017-09-03 02:37:51 +08:00
|
|
|
- ./scripts/sanitycheck ${SANITYCHECK_OPTIONS} --save-tests test_file.txt
|
2018-01-06 11:30:33 +08:00
|
|
|
- ./scripts/sanitycheck ${SANITYCHECK_OPTIONS} --load-tests test_file.txt --subset ${MATRIX_BUILD}/${MATRIX_BUILDS} || ./scripts/sanitycheck ${SANITYCHECK_OPTIONS_RETRY} || ./scripts/sanitycheck ${SANITYCHECK_OPTIONS_RETRY}
|
2017-09-03 02:37:51 +08:00
|
|
|
- rm test_file.txt
|
2017-04-26 11:12:08 +08:00
|
|
|
- ccache -s
|
2017-08-03 00:34:24 +08:00
|
|
|
on_failure:
|
2018-05-14 21:31:29 +08:00
|
|
|
- rm -rf ccache $HOME/.cache/zephyr
|
2017-08-03 00:34:24 +08:00
|
|
|
- mkdir -p shippable/testresults
|
2017-11-25 03:40:20 +08:00
|
|
|
- mkdir -p shippable/codecoverage
|
|
|
|
- source zephyr-env.sh
|
2018-01-05 21:28:23 +08:00
|
|
|
- >
|
|
|
|
if [ "$MATRIX_BUILD" = "1" ]; then
|
|
|
|
gcovr -r ${ZEPHYR_BASE} -x > shippable/codecoverage/coverage.xml;
|
2018-02-09 04:35:55 +08:00
|
|
|
lcov --capture --directory sanity-out/native_posix/ --directory sanity-out/unit_testing/ --output-file lcov.pre.info -q --rc lcov_branch_coverage=1;
|
2018-02-04 03:35:15 +08:00
|
|
|
lcov -q --remove lcov.pre.info *generated* -o lcov.info --rc lcov_branch_coverage=1;
|
|
|
|
rm lcov.pre.info;
|
2018-01-05 21:28:23 +08:00
|
|
|
rm -rf sanity-out out-2nd-pass;
|
2018-02-04 03:35:15 +08:00
|
|
|
bash <(curl -s https://codecov.io/bash) -f "lcov.info" -X coveragepy -X fixes;
|
|
|
|
rm lcov.info;
|
2018-01-05 21:28:23 +08:00
|
|
|
else
|
|
|
|
rm -rf sanity-out out-2nd-pass;
|
|
|
|
fi;
|
2017-08-03 00:34:24 +08:00
|
|
|
- >
|
|
|
|
if [ -e compliance.xml ]; then
|
|
|
|
cp compliance.xml shippable/testresults/;
|
|
|
|
fi;
|
|
|
|
- >
|
|
|
|
if [ -e ./scripts/sanity_chk/last_sanity.xml ]; then
|
|
|
|
cp ./scripts/sanity_chk/last_sanity.xml shippable/testresults/;
|
|
|
|
fi;
|
|
|
|
on_success:
|
2018-05-14 21:31:29 +08:00
|
|
|
- rm -rf ccache $HOME/.cache/zephyr
|
2017-04-26 11:12:08 +08:00
|
|
|
- mkdir -p shippable/testresults
|
2017-11-25 03:40:20 +08:00
|
|
|
- mkdir -p shippable/codecoverage
|
|
|
|
- source zephyr-env.sh
|
2018-01-05 21:28:23 +08:00
|
|
|
- >
|
|
|
|
if [ "$MATRIX_BUILD" = "1" ]; then
|
|
|
|
gcovr -r ${ZEPHYR_BASE} -x > shippable/codecoverage/coverage.xml;
|
2018-02-09 04:35:55 +08:00
|
|
|
lcov --capture --directory sanity-out/native_posix/ --directory sanity-out/unit_testing/ --output-file lcov.pre.info -q --rc lcov_branch_coverage=1;
|
2018-02-04 03:35:15 +08:00
|
|
|
lcov -q --remove lcov.pre.info *generated* -o lcov.info --rc lcov_branch_coverage=1;
|
|
|
|
rm lcov.pre.info;
|
2018-01-05 21:28:23 +08:00
|
|
|
rm -rf sanity-out out-2nd-pass;
|
2018-02-04 03:35:15 +08:00
|
|
|
bash <(curl -s https://codecov.io/bash) -f "lcov.info" -X coveragepy -X fixes;
|
|
|
|
rm lcov.info;
|
2018-01-05 21:28:23 +08:00
|
|
|
else
|
|
|
|
rm -rf sanity-out out-2nd-pass;
|
|
|
|
fi;
|
2017-04-26 11:12:08 +08:00
|
|
|
- >
|
|
|
|
if [ -e compliance.xml ]; then
|
|
|
|
cp compliance.xml shippable/testresults/;
|
2017-04-30 10:36:11 +08:00
|
|
|
fi;
|
|
|
|
- >
|
|
|
|
if [ -e ./scripts/sanity_chk/last_sanity.xml ]; then
|
|
|
|
cp ./scripts/sanity_chk/last_sanity.xml shippable/testresults/;
|
2017-04-26 11:12:08 +08:00
|
|
|
fi;
|
|
|
|
|
|
|
|
integrations:
|
|
|
|
notifications:
|
2017-04-30 10:36:11 +08:00
|
|
|
- integrationName: slack_integration
|
|
|
|
type: slack
|
|
|
|
recipients:
|
|
|
|
- "#ci"
|
|
|
|
branches:
|
|
|
|
only:
|
|
|
|
- master
|
|
|
|
on_success: never
|
|
|
|
on_failure: always
|
2017-04-26 11:12:08 +08:00
|
|
|
- integrationName: email
|
|
|
|
type: email
|
|
|
|
recipients:
|
|
|
|
- builds@zephyrproject.org
|
|
|
|
branches:
|
|
|
|
only:
|
|
|
|
- master
|
|
|
|
- net
|
|
|
|
- bluetooth
|
|
|
|
- arm
|
|
|
|
on_success: never
|
|
|
|
on_failure: never
|