[continuous-integration] initial migration to GitHub actions (#4728)

This commit is contained in:
Jonathan Hui
2020-03-24 20:45:19 -07:00
committed by GitHub
parent 35bb0027d0
commit 4cb09ec637
8 changed files with 1016 additions and 0 deletions
+38
View File
@@ -0,0 +1,38 @@
#!/bin/bash
#
# Copyright (c) 2020, The OpenThread Authors.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# 3. Neither the name of the copyright holder nor the
# names of its contributors may be used to endorse or promote products
# derived from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
#
set -euxo pipefail
main()
{
"$(dirname "$0")"/check-arm-build-autotools
"$(dirname "$0")"/check-arm-build-cmake
}
main "$@"
+269
View File
@@ -0,0 +1,269 @@
#!/bin/bash
#
# Copyright (c) 2020, The OpenThread Authors.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# 3. Neither the name of the copyright holder nor the
# names of its contributors may be used to endorse or promote products
# derived from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
#
set -euxo pipefail
reset_source()
{
rm -rf build output tmp
}
build_cc1352()
{
local options=(
"COMMISSIONER=1"
"DHCP6_CLIENT=1"
"DHCP6_SERVER=1"
"DNS_CLIENT=1"
"JOINER=1"
"SLAAC=1"
)
reset_source
make -f examples/Makefile-cc1352 "${options[@]}"
}
build_cc2538()
{
local options=(
"COMMISSIONER=1"
"DHCP6_CLIENT=1"
"DHCP6_SERVER=1"
"DNS_CLIENT=1"
"JOINER=1"
"SLAAC=1"
)
reset_source
make -f examples/Makefile-cc2538 "${options[@]}"
}
build_cc2650()
{
reset_source
make -f examples/Makefile-cc2650
}
build_cc2652()
{
local options=(
"COMMISSIONER=1"
"DHCP6_CLIENT=1"
"DHCP6_SERVER=1"
"DNS_CLIENT=1"
"JOINER=1"
"SLAAC=1"
)
reset_source
make -f examples/Makefile-cc2652 "${options[@]}"
}
build_kw41z()
{
local options=(
"COMMISSIONER=1"
"DHCP6_CLIENT=1"
"DHCP6_SERVER=1"
"DNS_CLIENT=1"
"JOINER=1"
"SLAAC=1"
)
reset_source
make -f examples/Makefile-kw41z "${options[@]}"
}
build_nrf52811()
{
local options=(
"BORDER_ROUTER=1"
"COAP=1"
"DNS_CLIENT=1"
"LINK_RAW=1"
"MAC_FILTER=1"
"MTD_NETDIAG=1"
)
# UART transport
reset_source
make -f examples/Makefile-nrf52811 "${options[@]}"
# SPI transport for NCP
reset_source
make -f examples/Makefile-nrf52811 "${options[@]}" NCP_SPI=1
# Build without transport (no CLI or NCP applications)
reset_source
make -f examples/Makefile-nrf52811 DISABLE_TRANSPORTS=1
}
build_nrf52833()
{
local options=(
"BORDER_AGENT=1"
"BORDER_ROUTER=1"
"COAP=1"
"COAPS=1"
"COMMISSIONER=1"
"DHCP6_CLIENT=1"
"DHCP6_SERVER=1"
"DNS_CLIENT=1"
"ECDSA=1"
"FULL_LOGS=1"
"IP6_FRAGM=1"
"JOINER=1"
"LINK_RAW=1"
"MAC_FILTER=1"
"MTD_NETDIAG=1"
"SERVICE=1"
"SLAAC=1"
"SNTP_CLIENT=1"
"UDP_FORWARD=1"
)
# UART transport
reset_source
make -f examples/Makefile-nrf52833 "${options[@]}"
# USB transport
reset_source
make -f examples/Makefile-nrf52833 "${options[@]}" USB=1
# SPI transport for NCP
reset_source
make -f examples/Makefile-nrf52833 "${options[@]}" NCP_SPI=1
# Build without transport (no CLI or NCP applications)
reset_source
make -f examples/Makefile-nrf52833 "${options[@]}" DISABLE_TRANSPORTS=1
}
build_nrf52840()
{
local options=(
"BORDER_AGENT=1"
"BORDER_ROUTER=1"
"COAP=1"
"COAPS=1"
"COMMISSIONER=1"
"DEBUG=1"
"DHCP6_CLIENT=1"
"DHCP6_SERVER=1"
"DNS_CLIENT=1"
"ECDSA=1"
"FULL_LOGS=1"
"IP6_FRAGM=1"
"JOINER=1"
"LINK_RAW=1"
"MAC_FILTER=1"
"MTD_NETDIAG=1"
"SERVICE=1"
"SLAAC=1"
"SNTP_CLIENT=1"
"UDP_FORWARD=1"
)
# UART transport
reset_source
make -f examples/Makefile-nrf52840 "${options[@]}"
# USB transport with bootloader e.g. to support PCA10059 dongle
reset_source
make -f examples/Makefile-nrf52840 "${options[@]}" BOOTLOADER=1 USB=1
# SPI transport for NCP
reset_source
make -f examples/Makefile-nrf52840 "${options[@]}" NCP_SPI=1
# Build without transport (no CLI or NCP applications)
reset_source
make -f examples/Makefile-nrf52840 "${options[@]}" DISABLE_TRANSPORTS=1
# Software cryptography
reset_source
make -f examples/Makefile-nrf52840 "${options[@]}" DISABLE_BUILTIN_MBEDTLS=0
# Software cryptography with threading support
reset_source
make -f examples/Makefile-nrf52840 "${options[@]}" DISABLE_BUILTIN_MBEDTLS=0 MBEDTLS_THREADING=1
}
build_qpg6095()
{
local options=(
"COMMISSIONER=1"
"DHCP6_CLIENT=1"
"DHCP6_SERVER=1"
"DNS_CLIENT=1"
"JOINER=1"
"SLAAC=1"
)
reset_source
make -f examples/Makefile-qpg6095 "${options[@]}"
}
build_samr21()
{
local options=(
"COMMISSIONER=1"
"DHCP6_CLIENT=1"
"DHCP6_SERVER=1"
"DNS_CLIENT=1"
"JOINER=1"
"SLAAC=1"
)
reset_source
wget http://ww1.microchip.com/downloads/en/DeviceDoc/asf-standalone-archive-3.45.0.85.zip
unzip -qq asf-standalone-archive-3.45.0.85.zip
mv xdk-asf-3.45.0 third_party/microchip/asf
make -f examples/Makefile-samr21 "${options[@]}"
}
main()
{
./bootstrap
build_cc1352
build_cc2538
build_cc2650
build_cc2652
build_kw41z
build_nrf52811
build_nrf52833
build_nrf52840
build_qpg6095
build_samr21
}
main "$@"
+63
View File
@@ -0,0 +1,63 @@
#!/bin/bash
#
# Copyright (c) 2020, The OpenThread Authors.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# 3. Neither the name of the copyright holder nor the
# names of its contributors may be used to endorse or promote products
# derived from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
#
set -euxo pipefail
readonly OT_COMMON_OPTIONS=(
"-DOT_COMPILE_WARNING_AS_ERROR=ON"
)
reset_source()
{
git checkout -- .
git clean -xfd
}
build_cc2538()
{
local options=("${OT_COMMON_OPTIONS[@]}")
options+=(
"-DOT_PLATFORM=cc2538"
"-DCMAKE_TOOLCHAIN_FILE=examples/platforms/cc2538/arm-none-eabi.cmake"
)
reset_source
mkdir build
cd build
cmake -GNinja "${options[@]}" ..
ninja
}
main()
{
build_cc2538
}
main "$@"
+113
View File
@@ -0,0 +1,113 @@
#!/bin/bash
#
# Copyright (c) 2020, The OpenThread Authors.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# 3. Neither the name of the copyright holder nor the
# names of its contributors may be used to endorse or promote products
# derived from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
#
set -euxo pipefail
readonly OT_BUILD_JOBS=$(getconf _NPROCESSORS_ONLN)
do_scan_build()
{
local options=(
"-DOPENTHREAD_CONFIG_ANNOUNCE_SENDER_ENABLE=1"
"-DOPENTHREAD_CONFIG_BORDER_AGENT_ENABLE=1"
"-DOPENTHREAD_CONFIG_BORDER_ROUTER_ENABLE=1"
"-DOPENTHREAD_CONFIG_CHANNEL_MANAGER_ENABLE=1"
"-DOPENTHREAD_CONFIG_CHANNEL_MONITOR_ENABLE=1"
"-DOPENTHREAD_CONFIG_CHILD_SUPERVISION_ENABLE=1"
"-DOPENTHREAD_CONFIG_COAP_API_ENABLE=1"
"-DOPENTHREAD_CONFIG_COAP_SECURE_API_ENABLE=1"
"-DOPENTHREAD_CONFIG_COMMISSIONER_ENABLE=1"
"-DOPENTHREAD_CONFIG_DHCP6_CLIENT_ENABLE=1"
"-DOPENTHREAD_CONFIG_DHCP6_SERVER_ENABLE=1"
"-DOPENTHREAD_CONFIG_DIAG_ENABLE=1"
"-DOPENTHREAD_CONFIG_DNS_CLIENT_ENABLE=1"
"-DOPENTHREAD_CONFIG_ECDSA_ENABLE=1"
"-DOPENTHREAD_CONFIG_HEAP_EXTERNAL_ENABLE=1"
"-DOPENTHREAD_CONFIG_IP6_FRAGMENTATION_ENABLE=1"
"-DOPENTHREAD_CONFIG_IP6_SLAAC_ENABLE=1"
"-DOPENTHREAD_CONFIG_LEGACY_ENABLE=1"
"-DOPENTHREAD_CONFIG_MAC_BEACON_RSP_WHEN_JOINABLE_ENABLE=1"
"-DOPENTHREAD_CONFIG_MAC_RETRY_SUCCESS_HISTOGRAM_ENABLE=1"
"-DOPENTHREAD_CONFIG_MLE_ATTACH_BACKOFF_ENABLE=1"
"-DOPENTHREAD_CONFIG_MLE_STEERING_DATA_SET_OOB_ENABLE=1"
"-DOPENTHREAD_CONFIG_MPL_DYNAMIC_INTERVAL_ENABLE"
"-DOPENTHREAD_CONFIG_JAM_DETECTION_ENABLE=1"
"-DOPENTHREAD_CONFIG_JOINER_ENABLE=1"
"-DOPENTHREAD_CONFIG_LINK_RAW_ENABLE=1"
"-DOPENTHREAD_CONFIG_LOG_LEVEL_DYNAMIC_ENABLE=1"
"-DOPENTHREAD_CONFIG_MAC_FILTER_ENABLE=1"
"-DOPENTHREAD_CONFIG_PLATFORM_FLASH_API_ENABLE=1"
"-DOPENTHREAD_CONFIG_PLATFORM_NETIF_ENABLE=1"
"-DOPENTHREAD_CONFIG_PLATFORM_RADIO_COEX_ENABLE=1"
"-DOPENTHREAD_CONFIG_PLATFORM_USEC_TIMER_ENABLE=1"
"-DOPENTHREAD_CONFIG_REFERENCE_DEVICE_ENABLE=1"
"-DOPENTHREAD_CONFIG_SNTP_CLIENT_ENABLE=1"
"-DOPENTHREAD_CONFIG_SOFTWARE_ACK_TIMEOUT_ENABLE=1"
"-DOPENTHREAD_CONFIG_SOFTWARE_CSMA_BACKOFF_ENABLE=1"
"-DOPENTHREAD_CONFIG_SOFTWARE_ENERGY_SCAN_ENABLE=1"
"-DOPENTHREAD_CONFIG_SOFTWARE_RETRANSMIT_ENABLE=1"
"-DOPENTHREAD_CONFIG_TMF_NETDATA_SERVICE_ENABLE=1"
"-DOPENTHREAD_CONFIG_TMF_NETWORK_DIAG_MTD_ENABLE=1"
"-DOPENTHREAD_CONFIG_UDP_FORWARD_ENABLE=1"
)
options+=(
"-DMBEDTLS_DEBUG_C"
"-I$(pwd)/third_party/mbedtls"
"-I$(pwd)/third_party/mbedtls/repo/include"
"-DMBEDTLS_CONFIG_FILE=\\\"mbedtls-config.h\\\""
)
configure_options=(
"--enable-builtin-mbedtls=no"
"--enable-cli"
"--enable-executable=no"
"--enable-ftd"
"--enable-mtd"
"--enable-ncp"
"--enable-radio-only"
"--with-examples=simulation"
)
export CPPFLAGS="${options[*]} -DOPENTHREAD_CONFIG_NCP_SPI_ENABLE=1"
scan-build ./configure "${configure_options[@]}"
scan-build --status-bugs -analyze-headers -v make -j"${OT_BUILD_JOBS}"
export CPPFLAGS="${options[*]} -DOPENTHREAD_CONFIG_NCP_UART_ENABLE=1"
scan-build ./configure "${configure_options[@]}"
scan-build --status-bugs -analyze-headers -v make -j"${OT_BUILD_JOBS}"
}
main()
{
./bootstrap
do_scan_build
}
main "$@"
+38
View File
@@ -0,0 +1,38 @@
#!/bin/bash
#
# Copyright (c) 2020, The OpenThread Authors.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# 3. Neither the name of the copyright holder nor the
# names of its contributors may be used to endorse or promote products
# derived from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
#
set -euxo pipefail
main()
{
"$(dirname "$0")"/check-simulation-build-autotools
"$(dirname "$0")"/check-simulation-build-cmake
}
main "$@"
+178
View File
@@ -0,0 +1,178 @@
#!/bin/bash
#
# Copyright (c) 2020, The OpenThread Authors.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# 3. Neither the name of the copyright holder nor the
# names of its contributors may be used to endorse or promote products
# derived from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
#
set -euxo pipefail
readonly OT_BUILD_JOBS=$(getconf _NPROCESSORS_ONLN)
reset_source()
{
rm -rf build output tmp
}
build_all_features()
{
local options=(
"-DOPENTHREAD_CONFIG_ANNOUNCE_SENDER_ENABLE=1"
"-DOPENTHREAD_CONFIG_BORDER_AGENT_ENABLE=1"
"-DOPENTHREAD_CONFIG_BORDER_ROUTER_ENABLE=1"
"-DOPENTHREAD_CONFIG_CHANNEL_MANAGER_ENABLE=1"
"-DOPENTHREAD_CONFIG_CHANNEL_MONITOR_ENABLE=1"
"-DOPENTHREAD_CONFIG_CHILD_SUPERVISION_ENABLE=1"
"-DOPENTHREAD_CONFIG_COAP_API_ENABLE=1"
"-DOPENTHREAD_CONFIG_COAP_SECURE_API_ENABLE=1"
"-DOPENTHREAD_CONFIG_COMMISSIONER_ENABLE=1"
"-DOPENTHREAD_CONFIG_DHCP6_CLIENT_ENABLE=1"
"-DOPENTHREAD_CONFIG_DHCP6_SERVER_ENABLE=1"
"-DOPENTHREAD_CONFIG_DIAG_ENABLE=1"
"-DOPENTHREAD_CONFIG_DNS_CLIENT_ENABLE=1"
"-DOPENTHREAD_CONFIG_ECDSA_ENABLE=1"
"-DOPENTHREAD_CONFIG_HEAP_EXTERNAL_ENABLE=1"
"-DOPENTHREAD_CONFIG_IP6_FRAGMENTATION_ENABLE=1"
"-DOPENTHREAD_CONFIG_IP6_SLAAC_ENABLE=1"
"-DOPENTHREAD_CONFIG_LEGACY_ENABLE=1"
"-DOPENTHREAD_CONFIG_MAC_BEACON_RSP_WHEN_JOINABLE_ENABLE=1"
"-DOPENTHREAD_CONFIG_MAC_RETRY_SUCCESS_HISTOGRAM_ENABLE=1"
"-DOPENTHREAD_CONFIG_MLE_ATTACH_BACKOFF_ENABLE=1"
"-DOPENTHREAD_CONFIG_MLE_STEERING_DATA_SET_OOB_ENABLE=1"
"-DOPENTHREAD_CONFIG_MPL_DYNAMIC_INTERVAL_ENABLE"
"-DOPENTHREAD_CONFIG_JAM_DETECTION_ENABLE=1"
"-DOPENTHREAD_CONFIG_JOINER_ENABLE=1"
"-DOPENTHREAD_CONFIG_LINK_RAW_ENABLE=1"
"-DOPENTHREAD_CONFIG_LOG_LEVEL_DYNAMIC_ENABLE=1"
"-DOPENTHREAD_CONFIG_MAC_FILTER_ENABLE=1"
"-DOPENTHREAD_CONFIG_NCP_UART_ENABLE=1"
"-DOPENTHREAD_CONFIG_PLATFORM_FLASH_API_ENABLE=1"
"-DOPENTHREAD_CONFIG_PLATFORM_NETIF_ENABLE=1"
"-DOPENTHREAD_CONFIG_PLATFORM_RADIO_COEX_ENABLE=1"
"-DOPENTHREAD_CONFIG_PLATFORM_USEC_TIMER_ENABLE=1"
"-DOPENTHREAD_CONFIG_REFERENCE_DEVICE_ENABLE=1"
"-DOPENTHREAD_CONFIG_SNTP_CLIENT_ENABLE=1"
"-DOPENTHREAD_CONFIG_SOFTWARE_ACK_TIMEOUT_ENABLE=1"
"-DOPENTHREAD_CONFIG_SOFTWARE_CSMA_BACKOFF_ENABLE=1"
"-DOPENTHREAD_CONFIG_SOFTWARE_ENERGY_SCAN_ENABLE=1"
"-DOPENTHREAD_CONFIG_SOFTWARE_RETRANSMIT_ENABLE=1"
"-DOPENTHREAD_CONFIG_TMF_NETDATA_SERVICE_ENABLE=1"
"-DOPENTHREAD_CONFIG_TMF_NETWORK_DIAG_MTD_ENABLE=1"
"-DOPENTHREAD_CONFIG_UDP_FORWARD_ENABLE=1"
)
export CPPFLAGS="${options[*]} -DOPENTHREAD_CONFIG_LOG_LEVEL=OT_LOG_LEVEL_NONE"
reset_source
make -f examples/Makefile-simulation
export CPPFLAGS="${options[*]} -DOPENTHREAD_CONFIG_LOG_LEVEL=OT_LOG_LEVEL_DEBG"
reset_source
make -f examples/Makefile-simulation
export CPPFLAGS="${options[*]} -DOPENTHREAD_CONFIG_ASSERT_ENABLE=0"
reset_source
make -f examples/Makefile-simulation
}
build_nest_common()
{
local options=(
"-DOPENTHREAD_CONFIG_BORDER_ROUTER_ENABLE=1"
"-DOPENTHREAD_CONFIG_CHANNEL_MANAGER_ENABLE=1"
"-DOPENTHREAD_CONFIG_CHANNEL_MONITOR_ENABLE=1"
"-DOPENTHREAD_CONFIG_CHILD_SUPERVISION_ENABLE=1"
"-DOPENTHREAD_CONFIG_DIAG_ENABLE=1"
"-DOPENTHREAD_CONFIG_JAM_DETECTION_ENABLE=1"
"-DOPENTHREAD_CONFIG_LEGACY_ENABLE=1"
"-DOPENTHREAD_CONFIG_MAC_FILTER_ENABLE=1"
"-DOPENTHREAD_CONFIG_NCP_SPI_ENABLE=1"
"-DOPENTHREAD_CONFIG_PLATFORM_FLASH_API_ENABLE=1"
"-DOPENTHREAD_CONFIG_TMF_NETDATA_SERVICE_ENABLE=1"
)
export CPPFLAGS="${options[*]}"
reset_source
mkdir build && cd build
../configure \
--enable-cli \
--enable-mtd \
--with-examples=simulation \
--disable-docs \
--disable-tests
make -j"${OT_BUILD_JOBS}"
cd ..
options=(
"-DOPENTHREAD_CONFIG_ANOUNCE_SENDER_ENABLE=1"
"-DOPENTHREAD_CONFIG_PLATFORM_FLASH_API_ENABLE=1"
"-DOPENTHREAD_CONFIG_TIME_SYNC_ENABLE=1"
"-DOPENTHREAD_CONFIG_NCP_UART_ENABLE=1"
)
export CPPFLAGS="${options[*]}"
reset_source
mkdir build && cd build
../configure \
--enable-cli \
--enable-ftd \
--enable-mtd \
--enable-ncp \
--enable-radio-only \
--disable-docs \
--disable-tests \
--with-examples=simulation
make -j"${OT_BUILD_JOBS}"
cd ..
options=(
"-DOPENTHREAD_CONFIG_NCP_UART_ENABLE=1"
"-DOPENTHREAD_CONFIG_PLATFORM_FLASH_API_ENABLE=1"
)
export CPPFLAGS="${options[*]}"
reset_source
mkdir build && cd build
../configure \
--enable-ftd \
--enable-mtd \
--enable-ncp \
--with-examples=simulation \
--disable-docs \
--disable-tests \
--with-vendor-extension=../src/core/common/extension_example.cpp \
--with-ncp-vendor-hook-source=../src/ncp/example_vendor_hook.cpp
make -j"${OT_BUILD_JOBS}"
cd ..
}
main()
{
./bootstrap
build_all_features
build_nest_common
}
main "$@"
+97
View File
@@ -0,0 +1,97 @@
#!/bin/bash
#
# Copyright (c) 2020, The OpenThread Authors.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# 3. Neither the name of the copyright holder nor the
# names of its contributors may be used to endorse or promote products
# derived from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
#
set -euxo pipefail
readonly OT_COMMON_OPTIONS=(
"-DOT_COMPILE_WARNING_AS_ERROR=on"
"-DOT_PLATFORM=simulation"
)
reset_source()
{
git checkout -- .
git clean -xfd
}
build_all_features()
{
local options=("${OT_COMMON_OPTIONS[@]}")
options+=(
"-DOT_BORDER_AGENT=on"
"-DOT_BORDER_ROUTER=on"
"-DOT_COAP=on"
"-DOT_COAPS=on"
"-DOT_COMMISSIONER=on"
"-DOT_CHANNEL_MANAGER=on"
"-DOT_CHANNEL_MONITOR=on"
"-DOT_CHILD_SUPERVISION=on"
"-DOT_DHCP6_CLIENT=on"
"-DOT_DHCP6_SERVER=on"
"-DOT_DIAGNOSTIC=on"
"-DOT_DNS_CLIENT=on"
"-DOT_ECDSA=on"
"-DOT_IP6_FRAGM=on"
"-DOT_JAM_DETECTION=on"
"-DOT_JOINER=on"
"-DOT_LINK_RAW=on"
"-DOT_MAC_FILTER=on"
"-DOT_MTD_NETDIAG=on"
"-DOT_SERVICE=on"
"-DOT_SLAAC=on"
"-DOT_SNTP_CLIENT=on"
)
reset_source
git checkout -- .
git clean -xfd
mkdir build && cd build
cmake -GNinja "${options[@]}" ..
ninja
cd ..
}
build_toranj()
{
reset_source
./tests/toranj/build.sh cmake
reset_source
./tests/toranj/build.sh cmake-posix
}
main()
{
build_all_features
build_toranj
}
main "$@"