148 lines
5.8 KiB
YAML
148 lines
5.8 KiB
YAML
language: c
|
|
|
|
compiler: gcc
|
|
|
|
env:
|
|
global:
|
|
- SDK=0.9.3
|
|
- SANITYCHECK_OPTIONS=" --inline-logs --enable-coverage"
|
|
- SANITYCHECK_OPTIONS_RETRY="${SANITYCHECK_OPTIONS} --only-failed --outdir=out-2nd-pass"
|
|
- ZEPHYR_SDK_INSTALL_DIR=/opt/sdk/zephyr-sdk-0.9.3
|
|
- ZEPHYR_TOOLCHAIN_VARIANT=zephyr
|
|
- MATRIX_BUILDS="5"
|
|
- MATRIX_BUILDS_EXTRA="5"
|
|
matrix:
|
|
- MATRIX_BUILD="1"
|
|
- MATRIX_BUILD="2"
|
|
- MATRIX_BUILD="3"
|
|
- MATRIX_BUILD="4"
|
|
- MATRIX_BUILD="5"
|
|
|
|
build:
|
|
cache: true
|
|
cache_dir_list:
|
|
- ${SHIPPABLE_BUILD_DIR}/ccache
|
|
pre_ci_boot:
|
|
image_name: zephyrprojectrtos/ci
|
|
image_tag: v0.4-rc7
|
|
pull: true
|
|
options: "-e HOME=/home/buildslave --privileged=true --tty --net=bridge --user buildslave"
|
|
|
|
ci:
|
|
- export CCACHE_DIR=${SHIPPABLE_BUILD_DIR}/ccache/.ccache
|
|
- >
|
|
if [ "$IS_PULL_REQUEST" = "true" ]; then
|
|
git rebase origin/${PULL_REQUEST_BASE_BRANCH};
|
|
fi
|
|
- source zephyr-env.sh
|
|
- ccache -c -s --max-size=5000M
|
|
- >
|
|
if [ "$MATRIX_BUILD" = "5" -a "$IS_PULL_REQUEST" = "true" ]; then
|
|
export COMMIT_RANGE=origin/${PULL_REQUEST_BASE_BRANCH}..HEAD
|
|
echo "Building a Pull Request";
|
|
echo "- Building Documentation";
|
|
echo "Commit range:" ${COMMIT_RANGE}
|
|
make htmldocs
|
|
if [ "$?" != "0" ]; then
|
|
echo "Documentation build failed";
|
|
exit 1;
|
|
fi
|
|
if [ -s doc/_build/doc.warnings ]; then
|
|
echo " => New documentation warnings/errors";
|
|
cp doc/_build/doc.warnings doc.warnings
|
|
fi;
|
|
echo "- Verify commit message, coding style, doc build";
|
|
./scripts/ci/check-compliance.py --commits ${COMMIT_RANGE} || true;
|
|
fi;
|
|
- >
|
|
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;
|
|
|
|
if [ -s modified_boards.args ]; then
|
|
./scripts/sanitycheck ${SANITYCHECK_OPTIONS} +modified_boards.args --save-tests test_file.txt;
|
|
fi;
|
|
if [ -s modified_tests.args ]; then
|
|
./scripts/sanitycheck ${SANITYCHECK_OPTIONS} +modified_tests.args --save-tests test_file.txt;
|
|
fi;
|
|
rm -f modified_tests.args modified_boards.args;
|
|
fi;
|
|
- ./scripts/sanitycheck ${SANITYCHECK_OPTIONS} --save-tests test_file.txt
|
|
- ./scripts/sanitycheck ${SANITYCHECK_OPTIONS} --load-tests test_file.txt --subset ${MATRIX_BUILD}/${MATRIX_BUILDS} || ./scripts/sanitycheck ${SANITYCHECK_OPTIONS_RETRY} || ./scripts/sanitycheck ${SANITYCHECK_OPTIONS_RETRY}
|
|
- rm test_file.txt
|
|
- ccache -s
|
|
on_failure:
|
|
- rm -rf ccache $HOME/.cache/zephyr
|
|
- mkdir -p shippable/testresults
|
|
- mkdir -p shippable/codecoverage
|
|
- source zephyr-env.sh
|
|
- >
|
|
if [ "$MATRIX_BUILD" = "1" ]; then
|
|
gcovr -r ${ZEPHYR_BASE} -x > shippable/codecoverage/coverage.xml;
|
|
lcov --capture --directory sanity-out/native_posix/ --directory sanity-out/unit_testing/ --output-file lcov.pre.info -q --rc lcov_branch_coverage=1;
|
|
lcov -q --remove lcov.pre.info mylib.c --remove lcov.pre.info tests/\* --remove lcov.pre.info samples/\* --remove lcov.pre.info ext/\* --remove lcov.pre.info *generated* -o lcov.info --rc lcov_branch_coverage=1;
|
|
rm lcov.pre.info;
|
|
rm -rf sanity-out out-2nd-pass;
|
|
bash <(curl -s https://codecov.io/bash) -f "lcov.info" -X coveragepy -X fixes;
|
|
rm lcov.info;
|
|
else
|
|
rm -rf sanity-out out-2nd-pass;
|
|
fi;
|
|
- >
|
|
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:
|
|
- rm -rf ccache $HOME/.cache/zephyr
|
|
- mkdir -p shippable/testresults
|
|
- mkdir -p shippable/codecoverage
|
|
- source zephyr-env.sh
|
|
- >
|
|
if [ "$MATRIX_BUILD" = "1" ]; then
|
|
gcovr -r ${ZEPHYR_BASE} -x > shippable/codecoverage/coverage.xml;
|
|
lcov --capture --directory sanity-out/native_posix/ --directory sanity-out/unit_testing/ --output-file lcov.pre.info -q --rc lcov_branch_coverage=1;
|
|
lcov -q --remove lcov.pre.info mylib.c --remove lcov.pre.info tests/\* --remove lcov.pre.info samples/\* --remove lcov.pre.info ext/\* --remove lcov.pre.info *generated* -o lcov.info --rc lcov_branch_coverage=1;
|
|
rm lcov.pre.info;
|
|
rm -rf sanity-out out-2nd-pass;
|
|
bash <(curl -s https://codecov.io/bash) -f "lcov.info" -X coveragepy -X fixes;
|
|
rm lcov.info;
|
|
else
|
|
rm -rf sanity-out out-2nd-pass;
|
|
fi;
|
|
- >
|
|
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;
|
|
|
|
integrations:
|
|
notifications:
|
|
- integrationName: slack_integration
|
|
type: slack
|
|
recipients:
|
|
- "#ci"
|
|
branches:
|
|
only:
|
|
- master
|
|
on_success: never
|
|
on_failure: always
|
|
- integrationName: email
|
|
type: email
|
|
recipients:
|
|
- builds@zephyrproject.org
|
|
branches:
|
|
only:
|
|
- master
|
|
- net
|
|
- bluetooth
|
|
- arm
|
|
on_success: never
|
|
on_failure: never
|