This is an automated email from the ASF dual-hosted git repository.

gnutt pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx-testing.git

commit b2588d35b6126afdb212b235c613691727486622
Author: liuhaitao <[email protected]>
AuthorDate: Tue Jan 14 11:22:02 2020 +0800

    Initial checkin CI related scripts and testlist files
    
    1. clone repos including nuttx, apps and tools
    2. setup tools including gcc toolchains, kconfig-frontends, genromfs and 
ccache
    3. do check build or nightly full build accordingly
    
    Change-Id: I5a2cb9e0a3dba69f16582340d19f6bf4d4d02195
    Signed-off-by: liuhaitao <[email protected]>
---
 cibuild.sh             | 203 +++++++++++++++++++++++++++++++++++++++++++++++++
 testlist/checklist.dat |  32 ++++++++
 testlist/fulllist.dat  |  38 +++++++++
 3 files changed, 273 insertions(+)

diff --git a/cibuild.sh b/cibuild.sh
new file mode 100755
index 0000000..1fa5676
--- /dev/null
+++ b/cibuild.sh
@@ -0,0 +1,203 @@
+#!/usr/bin/env bash
+
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#  http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+set -e -x
+
+WD=$PWD
+nuttx=$WD/../nuttx
+apps=$WD/../apps
+tools=$WD/../tools
+prebuilt=$WD/../prebuilt
+
+install="gen-romfs kconfig-frontends arm-gcc-toolchain mips-gcc-toolchain 
riscv-gcc-toolchain c-cache"
+
+function add_path {
+  PATH=$1:$PATH
+}
+
+function gen-romfs {
+  add_path $prebuilt/genromfs/usr/bin
+
+  if [ ! -f "$prebuilt/genromfs/usr/bin/genromfs" ]; then
+    if [ ! -d "$tools" ]; then
+      git clone https://github.com/nuttx/tools.git $tools
+    fi
+    mkdir -p $prebuilt; cd $tools
+    tar zxf genromfs-0.5.2.tar.gz -C $prebuilt
+    cd $prebuilt/genromfs-0.5.2
+    make install PREFIX=$prebuilt/genromfs
+    cd $prebuilt
+    rm -rf genromfs-0.5.2
+  fi
+}
+
+function kconfig-frontends {
+  add_path $prebuilt/kconfig-frontends/bin
+
+  if [ ! -f "$prebuilt/kconfig-frontends/bin/kconfig-mconf" ]; then
+    cd $tools/kconfig-frontends
+    ./configure --prefix=$prebuilt/kconfig-frontends --enable-mconf 
--disable-gconf --disable-qconf --enable-static
+    make install
+    cd $tools; git clean -xfd
+  fi
+}
+
+function arm-gcc-toolchain {
+  add_path $prebuilt/gcc-arm-none-eabi/bin
+
+  if [ ! -f "$prebuilt/gcc-arm-none-eabi/bin/arm-none-eabi-gcc" ]; then
+    cd $prebuilt
+    wget 
https://developer.arm.com/-/media/Files/downloads/gnu-rm/9-2019q4/RC2.1/gcc-arm-none-eabi-9-2019-q4-major-x86_64-linux.tar.bz2
+    tar jxf gcc-arm-none-eabi-9-2019-q4-major-x86_64-linux.tar.bz2
+    mv gcc-arm-none-eabi-9-2019-q4-major gcc-arm-none-eabi
+    rm gcc-arm-none-eabi-9-2019-q4-major-x86_64-linux.tar.bz2
+  fi
+  arm-none-eabi-gcc --version
+}
+
+function mips-gcc-toolchain {
+  add_path $prebuilt/pinguino-compilers/linux64/p32/bin
+
+  if [ ! -f "$prebuilt/pinguino-compilers/linux64/p32/bin/p32-gcc" ]; then
+    cd $prebuilt
+    git clone https://github.com/PinguinoIDE/pinguino-compilers
+  fi
+  p32-gcc --version
+}
+
+function riscv-gcc-toolchain {
+  add_path $prebuilt/riscv64-unknown-elf-gcc/bin
+
+  if [ ! -f "$prebuilt/riscv64-unknown-elf-gcc/bin/riscv64-unknown-elf-gcc" ]; 
then
+    cd $prebuilt
+    wget 
https://static.dev.sifive.com/dev-tools/riscv64-unknown-elf-gcc-8.3.0-2019.08.0-x86_64-linux-ubuntu14.tar.gz
+    tar zxf 
riscv64-unknown-elf-gcc-8.3.0-2019.08.0-x86_64-linux-ubuntu14.tar.gz
+    mv riscv64-unknown-elf-gcc-8.3.0-2019.08.0-x86_64-linux-ubuntu14 
riscv64-unknown-elf-gcc
+    rm riscv64-unknown-elf-gcc-8.3.0-2019.08.0-x86_64-linux-ubuntu14.tar.gz
+  fi
+  riscv64-unknown-elf-gcc --version
+}
+
+function c-cache {
+  add_path $prebuilt/ccache/bin
+
+  if [ ! -f "$prebuilt/ccache/bin/ccache" ]; then
+    cd $prebuilt;
+    wget 
https://github.com/ccache/ccache/releases/download/v3.7.7/ccache-3.7.7.tar.gz
+    tar zxf ccache-3.7.7.tar.gz
+    cd ccache-3.7.7; ./configure --prefix=$prebuilt/ccache; make; make install
+    cd $prebuilt; rm -rf ccache-3.7.7; rm ccache-3.7.7.tar.gz
+    ln -sf $prebuilt/ccache/bin/ccache $prebuilt/ccache/bin/gcc
+    ln -sf $prebuilt/ccache/bin/ccache $prebuilt/ccache/bin/g++
+    ln -sf $prebuilt/ccache/bin/ccache $prebuilt/ccache/bin/arm-none-eabi-gcc
+    ln -sf $prebuilt/ccache/bin/ccache $prebuilt/ccache/bin/arm-none-eabi-g++
+    ln -sf $prebuilt/ccache/bin/ccache $prebuilt/ccache/bin/p32-gcc
+    ln -sf $prebuilt/ccache/bin/ccache 
$prebuilt/ccache/bin/riscv64-unknown-elf-gcc
+    ln -sf $prebuilt/ccache/bin/ccache 
$prebuilt/ccache/bin/riscv64-unknown-elf-g++
+  fi
+  ccache --version
+}
+
+function usage {
+  echo ""
+  echo "USAGE: $0 [-i] [-s] [-c] [-b <check|full>]"
+  echo "       $0 -h"
+  echo ""
+  echo "Where:"
+  echo "  -i install tools"
+  echo "  -s setup repos"
+  echo "  -c enable ccache"
+  echo "  -b <check|full> do check or full CI Job"
+  echo "  -h will show this help test and terminate"
+  echo ""
+  exit 1
+}
+
+function enable_ccache {
+  export USE_CCACHE=1;
+  export CCACHE_DIR=$prebuilt/ccache/.ccache;
+  ccache -c
+  ccache -M 5G;
+  ccache -s
+}
+
+function setup_repos {
+  if [ -d "$nuttx" ]; then
+    cd $nuttx; git pull
+  else
+    git clone https://github.com/apache/incubator-nuttx.git $nuttx
+  fi
+
+  if [ -d "$apps" ]; then
+    cd $apps; git pull
+  else
+    git clone https://github.com/apache/incubator-nuttx-apps.git $apps
+  fi
+}
+
+function install_tools {
+  for func in $install; do
+    $func
+  done
+}
+
+function run_builds {
+  local ncpus=`grep -c ^processor /proc/cpuinfo`
+
+  $nuttx/tools/testbuild.sh -si -j $ncpus $WD/testlist/${build}list.dat
+  if [ $? != 0 ]; then
+    echo "ERROR: $BUILD build failed (error $?)"
+    exit 1
+  fi
+}
+
+if [ -z "$1" ]; then
+   usage
+fi
+
+while [ ! -z "$1" ]; do
+  case "$1" in
+  -h )
+    usage
+    ;;
+  -i )
+    install_tools
+    ;;
+  -c )
+    enable_ccache
+    ;;
+  -b )
+    shift
+    build="$1"
+    break
+    ;;
+  -s )
+    setup_repos
+    ;;
+  * )
+    usage
+    ;;
+  esac
+  shift
+done
+
+if [ ! -z "$build" ]; then
+  install_tools
+  setup_repos
+  run_builds
+fi
diff --git a/testlist/checklist.dat b/testlist/checklist.dat
new file mode 100644
index 0000000..a0d2e01
--- /dev/null
+++ b/testlist/checklist.dat
@@ -0,0 +1,32 @@
+/arm,CONFIG_ARMV7M_TOOLCHAIN_GNU_EABIL
+-ea3131:pgnsh
+-eagle100:nxflat
+-eagle100:thttpd
+-imxrt1050-evk:libcxxtest
+-imxrt1060-evk:libcxxtest
+-launchxl-cc1310:nsh
+-launchxl-tms57004:nsh
+-lincoln60:thttpd-binfs
+-lpcxpresso-lpc1768:thttpd
+-mikroe-stm32f4:fulldemo
+-moxa:nsh
+-olimex-lpc1766stk:slip-httpd
+-olimex-lpc1766stk:thttpd-nxflat
+-olimex-stm32-p407:kelf
+-sama5d3x-ek:nxwm
+-sama5d4-ek:dramboot
+-sama5d4-ek:elf
+-shenzhou:thttpd
+-stm32f4discovery:cxxtest
+-stm32f4discovery:testlibcxx
+-stm32f4discovery:winbuild
+-tms570ls31x-usb-kit:nsh
+-zkit-arm-1769:thttpd
+
+/mips,CONFIG_MIPS32_TOOLCHAIN_PINGUINOL
+
+/sim
+-sim:cxxtest
+-sim:nxwm
+-sim:rpproxy
+-sim:rpserver
diff --git a/testlist/fulllist.dat b/testlist/fulllist.dat
new file mode 100644
index 0000000..df46889
--- /dev/null
+++ b/testlist/fulllist.dat
@@ -0,0 +1,38 @@
+/arm,CONFIG_ARMV7M_TOOLCHAIN_GNU_EABIL
+-ea3131:pgnsh
+-eagle100:nxflat
+-eagle100:thttpd
+-imxrt1050-evk:libcxxtest
+-imxrt1060-evk:libcxxtest
+-launchxl-cc1310:nsh
+-launchxl-tms57004:nsh
+-lincoln60:thttpd-binfs
+-lpcxpresso-lpc1768:thttpd
+-mikroe-stm32f4:fulldemo
+-moxa:nsh
+-olimex-lpc1766stk:slip-httpd
+-olimex-lpc1766stk:thttpd-nxflat
+-olimex-stm32-p407:kelf
+-sama5d3x-ek:nxwm
+-sama5d4-ek:dramboot
+-sama5d4-ek:elf
+-shenzhou:thttpd
+-stm32f4discovery:cxxtest
+-stm32f4discovery:testlibcxx
+-stm32f4discovery:winbuild
+-tms570ls31x-usb-kit:nsh
+-zkit-arm-1769:thttpd
+
+/mips,CONFIG_MIPS32_TOOLCHAIN_PINGUINOL
+
+/risc-v,CONFIG_RV32IM_TOOLCHAIN_GNU_RVGL
+-gapuino:nsh
+-nr5m100-nexys4:nsh
+
+/sim
+-sim:cxxtest
+-sim:nxwm
+-sim:rpproxy
+-sim:rpserver
+
+/x86

Reply via email to