forked from zephyrproject-rtos/zephyr
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.shippable.yml
151 lines (143 loc) · 5.67 KB
/
.shippable.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
language: c
compiler: gcc
env:
global:
- SDK=0.9.1
- SANITYCHECK_OPTIONS=" --inline-logs -R"
- SANITYCHECK_OPTIONS_RETRY="${SANITYCHECK_OPTIONS} --only-failed --outdir=out-2nd-pass"
- ZEPHYR_SDK_INSTALL_DIR=/opt/sdk/zephyr-sdk-0.9.1
- ZEPHYR_GCC_VARIANT=zephyr
- USE_CCACHE=1
- MATRIX_BUILDS="2"
- MATRIX_BUILDS_EXTRA="3"
matrix:
- MATRIX_BUILD="1"
- MATRIX_BUILD="2"
- MATRIX_BUILD="3"
build:
cache: true
cache_dir_list:
- ${SHIPPABLE_BUILD_DIR}/ccache
pre_ci_boot:
image_name: zephyrprojectrtos/ci
image_tag: master.27
pull: true
options: "-e HOME=/home/buildslave --privileged=true --tty --net=bridge --user buildslave"
ci:
- export CCACHE_DIR=${SHIPPABLE_BUILD_DIR}/ccache/.ccache
- git rebase origin/${PULL_REQUEST_BASE_BRANCH}
- source zephyr-env.sh
- ccache -c -s --max-size=2000M
- make host-tools
- export PREBUILT_HOST_TOOLS=${ZEPHYR_BASE}/bin
- >
if [ "$IS_PULL_REQUEST" = "true" ]; then
S3_PATH="s3://zephyr-logs/pull-requests/${REPO_FULL_NAME}/${PULL_REQUEST}"
else
if [ "$JOB_TRIGGERED_BY_NAME" = "undefined" ]; then
LOG_TYPE="manual";
else
LOG_TYPE=${JOB_TRIGGERED_BY_NAME};
fi;
S3_PATH="s3://zephyr-logs/${LOG_TYPE}/${REPO_FULL_NAME}/${BUILD_NUMBER}";
fi;
- >
if [ "$MATRIX_BUILD" = "3" -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 > doc.log 2>&1;
./scripts/filter-known-issues.py --config-dir .known-issues/doc/ doc.log > doc.warnings;
if [ "$?" != 0 ]; then
echo " ==> Error running filter script"
exit 1
fi;
if [ -s doc.warnings ]; then
echo " => New documentation warnings/errors";
fi;
echo "- Verify commit message and coding style";
./scripts/ci/check-compliance.py --commits ${COMMIT_RANGE} || true;
fi;
- >
sudo pip3 install sh;
./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 --subset ${MATRIX_BUILD}/${MATRIX_BUILDS_EXTRA} +modified_boards.args || ./scripts/sanitycheck +modified_boards.args --only-failed;
cp ./scripts/sanity_chk/last_sanity.xml modified_boards.xml;
fi;
if [ -s modified_tests.args ]; then
./scripts/sanitycheck --subset ${MATRIX_BUILD}/${MATRIX_BUILDS_EXTRA} +modified_tests.args || ./scripts/sanitycheck +modified_tests.args --only-failed
cp ./scripts/sanity_chk/last_sanity.xml modified_tests.xml;
fi;
rm -f modified_tests.args modified_boards.args;
- >
if [ "$MATRIX_BUILD" != "3" ]; then
./scripts/sanitycheck ${PLATFORMS} --subset ${MATRIX_BUILD}/${MATRIX_BUILDS} ${COVERAGE} ${SANITYCHECK_OPTIONS} || ./scripts/sanitycheck ${PLATFORMS} ${COVERAGE} ${SANITYCHECK_OPTIONS_RETRY} || ./scripts/sanitycheck ${PLATFORMS} ${COVERAGE} ${SANITYCHECK_OPTIONS_RETRY}
fi;
- ccache -s
on_failure:
- rm -rf sanity-out out-2nd-pass
- mkdir -p shippable/testresults
- >
if [ -e compliance.xml ]; then
cp compliance.xml shippable/testresults/;
aws s3 cp compliance.xml ${S3_PATH}/;
fi;
- >
if [ -e ./scripts/sanity_chk/last_sanity.xml ]; then
cp ./scripts/sanity_chk/last_sanity.xml shippable/testresults/;
aws s3 cp ./scripts/sanity_chk/last_sanity.xml ${S3_PATH}/sanitycheck.${MATRIX_BUILD}.xml;
fi;
- >
if [ -e ./modified_tests.xml ]; then
cp ./modified_tests.xml shippable/testresults/;
aws s3 cp ./modified_tests.xml ${S3_PATH}/modified_tests.xml;
fi;
on_success:
- rm -rf sanity-out out-2nd-pass
- mkdir -p shippable/testresults
- >
if [ "$MATRIX_BUILD" = "3" -a "$IS_PULL_REQUEST" = "true" ]; then
aws s3 sync --quiet doc/_build/html ${S3_PATH}/doc;
aws s3 sync --quiet doc/doxygen/html ${S3_PATH}/api;
fi
- >
if [ -e compliance.xml ]; then
cp compliance.xml shippable/testresults/;
aws s3 cp compliance.xml ${S3_PATH}/;
fi;
- >
if [ -e ./scripts/sanity_chk/last_sanity.xml ]; then
cp ./scripts/sanity_chk/last_sanity.xml shippable/testresults/;
aws s3 cp ./scripts/sanity_chk/last_sanity.xml ${S3_PATH}/sanitycheck.${MATRIX_BUILD}..xml;
fi;
- >
if [ -e ./modified_tests.xml ]; then
cp ./modified_tests.xml shippable/testresults/;
aws s3 cp ./modified_tests.xml ${S3_PATH}/modified_tests.xml;
fi;
integrations:
notifications:
- integrationName: slack_integration
type: slack
recipients:
- "#ci"
branches:
only:
- master
on_success: never
on_failure: always
- integrationName: email
type: email
recipients:
branches:
only:
- master
- net
- bluetooth
- arm
on_success: never
on_failure: never