Skip to content

Commit 715f3eb

Browse files
wangnuannuanfanghuaqi
authored andcommitted
travis: update the scripts with the embarc_osp (#27)
* travis: update scripts with embarc_osp Signed-off-by: Jingru Wang <[email protected]> * travis: delete unnecessary command Signed-off-by: Jingru Wang <[email protected]>
1 parent b8929a8 commit 715f3eb

File tree

6 files changed

+107
-65
lines changed

6 files changed

+107
-65
lines changed

.ci/before_install.sh

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
die() {
2+
3+
echo " *** ERROR: " $*
4+
5+
exit 1
6+
7+
}
8+
if [ "${TRAVIS}" == "true" ] ; then
9+
[ "${TRAVIS_OS_NAME}" != "linux" ] || {
10+
sudo apt-get update || die
11+
sudo apt-get install lib32z1 || die
12+
sudo apt-get install dos2unix || die
13+
sudo apt-get install doxygen || die
14+
}
15+
fi
16+
17+
{
18+
pip install --upgrade pip || die
19+
pip install PrettyTable || die
20+
pip install colorama || die
21+
pip install configparser || die
22+
}
File renamed without changes.

.ci/script.sh

+74
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
die() {
2+
echo " *** ERROR: " $*
3+
exit 1
4+
5+
}
6+
7+
TOOLCHAIN_CACHE_FOLDER=".cache/toolchain"
8+
ARC_DEV_GNU_ROOT="/u/arcgnu_verif/gnu_builds"
9+
ARC_DEV_MW_ROOT="/u/relauto/.TOOLS_ROOT/ToolsCommon/MWDT_eng/"
10+
11+
if [ "${TOOLCHAIN}" == "gnu" ]; then
12+
ARC_DEV_TOOL_ROOT="${ARC_DEV_GNU_ROOT}/${TOOLCHAIN_VER}/elf32_le_linux"
13+
else
14+
ARC_DEV_TOOL_ROOT="${ARC_DEV_MW_ROOT}/mwdt_${TOOLCHAIN_VER}/linux/ARC"
15+
fi
16+
17+
U_NAME=${U_NAME:=embARC_Bot}
18+
U_EMAIL=${U_EMAIL:=info@embARC.org}
19+
echo $U_NAME, $U_EMAIL
20+
git config --global user.name "${U_NAME}"
21+
git config --global user.email "${U_EMAIL}"
22+
git checkout -- . || die
23+
git archive --format zip -o applications.zip --prefix embarc_applications/ HEAD || die
24+
[ $embARC_OSP_REPO ] || {
25+
embARC_OSP_REPO="https://github.com/foss-for-synopsys-dwc-arc-processors/embarc_osp.git"
26+
}
27+
git clone ${embARC_OSP_REPO} embarc_osp
28+
cd embarc_osp || die
29+
unzip ../applications.zip>/dev/null 2>&1 || die
30+
31+
32+
[ "$TRAVIS" == "true" ] && {
33+
if [ "${TOOLCHAIN}" == "gnu" ]; then
34+
35+
python .ci/toolchain.py -v $TOOLCHAIN_VER -c $TOOLCHAIN_CACHE_FOLDER || die
36+
if [ -d $TOOLCHAIN_CACHE_FOLDER ] ;then
37+
if [ -d $TOOLCHAIN_CACHE_FOLDER/$TOOLCHAIN_VER ] ; then
38+
ARC_DEV_TOOL_ROOT="${TOOLCHAIN_CACHE_FOLDER}/${TOOLCHAIN_VER}"
39+
fi
40+
fi
41+
else
42+
die "Toolchain not supported in travis ci"
43+
fi
44+
}
45+
46+
if [ -d $ARC_DEV_TOOL_ROOT ] ; then
47+
bash .ci/linux_env_set_arc.sh -t $TOOLCHAIN -r $ARC_DEV_TOOL_ROOT || die
48+
[ ! -e "arctool.env" ] && die "arctool.env doesn't exist"
49+
source arctool.env || die
50+
rm -rf arctool.env || die
51+
else
52+
die "The toolchain path does not exist "
53+
fi
54+
55+
56+
if [ "${TOOLCHAIN}" == "gnu" ]; then
57+
arc-elf32-gcc -v || die "ARC GNU toolchain is not installed correctly"
58+
else
59+
ccac -v || die "MWDT toolchain is not installed correctly"
60+
fi
61+
62+
63+
{
64+
65+
bash apply_embARC_patch.sh || die
66+
67+
EXPECTED="../${EXPECTED}"
68+
cd .ci || die
69+
{
70+
BUILD_OPTS="OSP_ROOT=${OSP_ROOT} TOOLCHAIN=${TOOLCHAIN} BOARD=${BOARD} BD_VER=${BD_VER} CUR_CORE=${CUR_CORE} GNU_VER=${GNU_VER} EXAMPLES=${EXAMPLES} EXPECTED=${EXPECTED}"
71+
python build.py ${BUILD_OPTS} || die
72+
}
73+
74+
}

.travis.yml

+11-11
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,16 @@ env:
1515
"context": "travis-ci/$NAME",
1616
"target_url": "https://travis-ci.org/$TRAVIS_REPO_SLUG/jobs/$TRAVIS_JOB_ID"
1717
}\nDATA'
18-
- EXPECTED=".travis/expected.ini"
18+
- EXPECTED=".ci/expected.ini"
1919

2020
cache:
2121
pip: true
2222
directories:
23-
- $HOME/.cache/result
24-
- $HOME/.cache/toolchain
23+
- .cache/result
24+
- .cache/toolchain
2525

2626
before_install:
27-
- bash .travis/before_install.sh
27+
- bash .ci/before_install.sh
2828
# setup git
2929
- git config --global user.name "${U_NAME}"
3030
- git config --global user.email "${U_EMAIL}"
@@ -36,25 +36,25 @@ after_failure:
3636
- bash -c "$STATUS" failure "Local $NAME testing has failed"
3737

3838
script:
39-
- bash .travis/script.sh
39+
- bash .ci/script.sh
4040

4141
matrix:
4242
include:
43-
- env: NAME="emsk-11-gnu_201709" OSP_ROOT="." BOARD="emsk" TOOLCHAIN="gnu" BD_VER="11" GNU_VER="2017.09" EXAMPLES="embarc_applications"
43+
- env: NAME="emsk-11-gnu_201709" OSP_ROOT="." BOARD="emsk" TOOLCHAIN="gnu" BD_VER="11" TOOLCHAIN_VER="2017.09" EXAMPLES="embarc_applications"
4444
os: linux
4545
compiler: gcc
46-
- env: NAME="emsk-11-gnu_201803" OSP_ROOT="." BOARD="emsk" TOOLCHAIN="gnu" BD_VER="11" GNU_VER="2018.03" EXAMPLES="embarc_applications"
46+
- env: NAME="emsk-11-gnu_201803" OSP_ROOT="." BOARD="emsk" TOOLCHAIN="gnu" BD_VER="11" TOOLCHAIN_VER="2018.03" EXAMPLES="embarc_applications"
4747
os: linux
4848
compiler: gcc
49-
- env: NAME="emsk-22-gnu_201709" OSP_ROOT="." BOARD="emsk" TOOLCHAIN="gnu" BD_VER="22" GNU_VER="2017.09" EXAMPLES="embarc_applications"
49+
- env: NAME="emsk-22-gnu_201709" OSP_ROOT="." BOARD="emsk" TOOLCHAIN="gnu" BD_VER="22" TOOLCHAIN_VER="2017.09" EXAMPLES="embarc_applications"
5050
os: linux
5151
compiler: gcc
52-
- env: NAME="emsk-22-gnu_201803" OSP_ROOT="." BOARD="emsk" TOOLCHAIN="gnu" BD_VER="22" GNU_VER="2018.03" EXAMPLES="embarc_applications"
52+
- env: NAME="emsk-22-gnu_201803" OSP_ROOT="." BOARD="emsk" TOOLCHAIN="gnu" BD_VER="22" TOOLCHAIN_VER="2018.03" EXAMPLES="embarc_applications"
5353
os: linux
5454
compiler: gcc
55-
- env: NAME="emsk-23-gnu_201709" OSP_ROOT="." BOARD="emsk" TOOLCHAIN="gnu" BD_VER="23" GNU_VER="2017.09" EXAMPLES="embarc_applications"
55+
- env: NAME="emsk-23-gnu_201709" OSP_ROOT="." BOARD="emsk" TOOLCHAIN="gnu" BD_VER="23" TOOLCHAIN_VER="2017.09" EXAMPLES="embarc_applications"
5656
os: linux
5757
compiler: gcc
58-
- env: NAME="emsk-23-gnu_201803" OSP_ROOT="." BOARD="emsk" TOOLCHAIN="gnu" BD_VER="23" GNU_VER="2018.03" EXAMPLES="embarc_applications"
58+
- env: NAME="emsk-23-gnu_201803" OSP_ROOT="." BOARD="emsk" TOOLCHAIN="gnu" BD_VER="23" TOOLCHAIN_VER="2018.03" EXAMPLES="embarc_applications"
5959
os: linux
6060
compiler: gcc

.travis/before_install.sh

-19
This file was deleted.

.travis/script.sh

-35
This file was deleted.

0 commit comments

Comments
 (0)