mirror of
https://github.com/zephyrproject-rtos/zephyr
synced 2025-08-04 13:35:22 +00:00
Compile and run the tests avaliable in bsim_bt and collect the coverage results into the coverage report. Also, detect if bsim's component folder already contains the nRF52 HW models, and if it does instead of trying to fetch them again (which will fail) check that the right versio is present. This should ease testing locally. Signed-off-by: Alberto Escolar Piedras <alpi@oticon.com>
130 lines
4.8 KiB
YAML
130 lines
4.8 KiB
YAML
language: c
|
|
|
|
compiler: gcc
|
|
|
|
env:
|
|
global:
|
|
- SDK=0.9.5
|
|
- SANITYCHECK_OPTIONS=" --inline-logs --enable-coverage -N"
|
|
- SANITYCHECK_OPTIONS_RETRY="${SANITYCHECK_OPTIONS} --only-failed --outdir=out-2nd-pass"
|
|
- ZEPHYR_SDK_INSTALL_DIR=/opt/sdk/zephyr-sdk-0.9.5
|
|
- ZEPHYR_TOOLCHAIN_VARIANT=zephyr
|
|
- MATRIX_BUILDS="5"
|
|
- MATRIX_BUILDS_EXTRA="5"
|
|
- BSIM_OUT_PATH=/opt/bsim/
|
|
- BSIM_COMPONENTS_PATH=${BSIM_OUT_PATH}/components/
|
|
- BSIM_BT_TEST_RESULTS_FILE="./bsim_bt_out/bsim_results.xml"
|
|
matrix:
|
|
- MATRIX_BUILD="1"
|
|
- MATRIX_BUILD="2"
|
|
- MATRIX_BUILD="3"
|
|
- MATRIX_BUILD="4"
|
|
- MATRIX_BUILD="5"
|
|
|
|
build:
|
|
cache: false
|
|
cache_dir_list:
|
|
- ${SHIPPABLE_BUILD_DIR}/ccache
|
|
pre_ci_boot:
|
|
image_name: zephyrprojectrtos/ci
|
|
image_tag: v0.4-rc12
|
|
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
|
|
./scripts/ci/run_ci.sh -b master -r origin -m ${MATRIX_BUILD} -M ${MATRIX_BUILDS} -p;
|
|
else
|
|
./scripts/ci/run_ci.sh -b master -r origin -m ${MATRIX_BUILD} -M ${MATRIX_BUILDS};
|
|
fi;
|
|
- ccache -s
|
|
on_failure:
|
|
- >
|
|
if [ -f "$HOME/.cache/zephyr/ToolchainCapabilityDatabase.cmake" ]; then
|
|
echo "Dumping the capability database in case we are affected by #9992"
|
|
cat $HOME/.cache/zephyr/ToolchainCapabilityDatabase.cmake
|
|
fi;
|
|
- 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/nrf52_bsim/ --directory sanity-out/unit_testing/ --directory bsim_bt_out/ --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 -f 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;
|
|
- >
|
|
if [ -e ${BSIM_BT_TEST_RESULTS_FILE} ]; then
|
|
cp ${BSIM_BT_TEST_RESULTS_FILE} 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/nrf52_bsim/ --directory sanity-out/unit_testing/ --directory bsim_bt_out/ --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 -f 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;
|
|
- >
|
|
if [ -e ${BSIM_BT_TEST_RESULTS_FILE} ]; then
|
|
cp ${BSIM_BT_TEST_RESULTS_FILE} 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
|