Skip to content

Commit 59bcb37

Browse files
committed
Add Mynewt target builds to CI
Adds scripts to build and test many Mynewt project configurations; this avoids breaking builds after changes are not tested for some particular configuration option. Signed-off-by: Fabio Utzig <[email protected]>
1 parent 1e38d1a commit 59bcb37

File tree

3 files changed

+106
-1
lines changed

3 files changed

+106
-1
lines changed

.travis.yml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,10 @@
22

33
language: rust
44

5-
cache: cargo
5+
cache:
6+
directories:
7+
- $HOME/TOOLCHAIN
8+
- cargo
69

710
matrix:
811
include:
@@ -36,6 +39,12 @@ matrix:
3639
#- os: linux
3740
# env: MULTI_FEATURES="sig-rsa validate-slot0 overwrite-only"
3841

42+
- os: linux
43+
language: go
44+
env: TEST=mynewt
45+
go:
46+
- "1.10"
47+
3948
before_install:
4049
- |
4150
if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then

ci/mynewt_install.sh

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
#!/bin/bash -x
2+
3+
# Licensed to the Apache Software Foundation (ASF) under one
4+
# or more contributor license agreements. See the NOTICE file
5+
# distributed with this work for additional information
6+
# regarding copyright ownership. The ASF licenses this file
7+
# to you under the Apache License, Version 2.0 (the
8+
# "License"); you may not use this file except in compliance
9+
# with the License. You may obtain a copy of the License at
10+
#
11+
# http://www.apache.org/licenses/LICENSE-2.0
12+
#
13+
# Unless required by applicable law or agreed to in writing,
14+
# software distributed under the License is distributed on an
15+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16+
# KIND, either express or implied. See the License for the
17+
# specific language governing permissions and limitations
18+
# under the License.
19+
20+
install_newt() {
21+
pushd $HOME
22+
git clone --depth=1 https://github.com/apache/mynewt-newt
23+
[[ $? -ne 0 ]] && exit 1
24+
25+
pushd mynewt-newt && ./build.sh
26+
[[ $? -ne 0 ]] && exit 1
27+
28+
cp newt/newt $HOME/bin
29+
popd
30+
popd
31+
}
32+
33+
shallow_clone_mynewt() {
34+
mkdir -p repos/apache-mynewt-core
35+
git clone --depth=1 https://github.com/apache/mynewt-core repos/apache-mynewt-core
36+
[[ $? -ne 0 ]] && exit 1
37+
}
38+
39+
arm_toolchain_install() {
40+
TOOLCHAIN_PATH=$HOME/TOOLCHAIN
41+
42+
GCC_URL=https://developer.arm.com/-/media/Files/downloads/gnu-rm/7-2017q4/gcc-arm-none-eabi-7-2017-q4-major-linux.tar.bz2
43+
GCC_BASE=gcc-arm-none-eabi-7-2017-q4-major
44+
45+
mkdir -p $TOOLCHAIN_PATH
46+
47+
if [ ! -s ${TOOLCHAIN_PATH}/$GCC_BASE/bin/arm-none-eabi-gcc ]; then
48+
wget -O ${TOOLCHAIN_PATH}/${GCC_BASE}.tar.bz2 $GCC_URL
49+
[[ $? -ne 0 ]] && exit 1
50+
51+
tar xfj ${TOOLCHAIN_PATH}/${GCC_BASE}.tar.bz2 -C $TOOLCHAIN_PATH
52+
fi
53+
54+
for i in ${TOOLCHAIN_PATH}/${GCC_BASE}/bin/arm-none-eabi-* ; do
55+
rm -f $HOME/bin/${i##*/}
56+
ln -s $i $HOME/bin/${i##*/}
57+
done
58+
}
59+
60+
mkdir -p $HOME/bin
61+
export PATH=$HOME/bin:$PATH
62+
63+
install_newt
64+
shallow_clone_mynewt
65+
arm_toolchain_install

ci/mynewt_run.sh

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
#!/bin/bash -x
2+
3+
# Licensed to the Apache Software Foundation (ASF) under one
4+
# or more contributor license agreements. See the NOTICE file
5+
# distributed with this work for additional information
6+
# regarding copyright ownership. The ASF licenses this file
7+
# to you under the Apache License, Version 2.0 (the
8+
# "License"); you may not use this file except in compliance
9+
# with the License. You may obtain a copy of the License at
10+
#
11+
# http://www.apache.org/licenses/LICENSE-2.0
12+
#
13+
# Unless required by applicable law or agreed to in writing,
14+
# software distributed under the License is distributed on an
15+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16+
# KIND, either express or implied. See the License for the
17+
# specific language governing permissions and limitations
18+
# under the License.
19+
20+
export PATH=$HOME/bin:$PATH
21+
pwd
22+
23+
ln -s ci/mynewt_targets targets
24+
ln -s ci/mynewt_keys keys
25+
26+
for target in $(ls targets); do
27+
newt build $target
28+
[[ $? -ne 0 ]] && exit 1
29+
done
30+
31+
exit 0

0 commit comments

Comments
 (0)