Skip to content

Commit 01ebf74

Browse files
wangnuannuanfanghuaqi
authored andcommitted
travis ci: Use osp travis script to build application (#26)
1 parent 65f2d3f commit 01ebf74

File tree

5 files changed

+49
-101
lines changed

5 files changed

+49
-101
lines changed

.travis.yml

Lines changed: 33 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,60 @@
11
language: python
2+
python: 2.7
23

34
sudo: required
45
dist: trusty
56

6-
python:
7-
- "3.6"
7+
env:
8+
global:
9+
- >
10+
STATUS=$'curl -so/dev/null --user "$EMBARC_BOT" --request POST
11+
https://api.github.com/repos/$TRAVIS_REPO_SLUG/statuses/${TRAVIS_PULL_REQUEST_SHA:-$TRAVIS_COMMIT}
12+
--data @- << DATA\n{
13+
"state": "$0",
14+
"description": "$1",
15+
"context": "travis-ci/$NAME",
16+
"target_url": "https://travis-ci.org/$TRAVIS_REPO_SLUG/jobs/$TRAVIS_JOB_ID"
17+
}\nDATA'
18+
- EXPECTED=".travis/expected.ini"
19+
20+
cache:
21+
pip: true
22+
directories:
23+
- $HOME/.cache/result
24+
- $HOME/.cache/toolchain
825

926
before_install:
1027
- bash .travis/before_install.sh
1128
# setup git
1229
- git config --global user.name "${U_NAME}"
1330
- git config --global user.email "${U_EMAIL}"
1431

32+
after_success:
33+
- bash -c "$STATUS" success "Local $NAME testing has passed"
34+
35+
after_failure:
36+
- bash -c "$STATUS" failure "Local $NAME testing has failed"
37+
1538
script:
1639
- bash .travis/script.sh
1740

1841
matrix:
1942
include:
20-
- env: TOOLCHAIN="gnu" BOARD="emsk" BD_VER="11" CUR_CORE="arcem6"
43+
- env: NAME="emsk-gnu-201709-11" OSP_ROOT="." BOARD="emsk" TOOLCHAIN="gnu" BD_VER="11" GNU_VER="2017.09" EXAMPLES="embarc_applications"
2144
os: linux
2245
compiler: gcc
23-
- env: TOOLCHAIN="gnu" BOARD="emsk" BD_VER="22" CUR_CORE="arcem7d"
46+
- env: NAME="emsk-gnu-201803-11" OSP_ROOT="." BOARD="emsk" TOOLCHAIN="gnu" BD_VER="11" GNU_VER="2018.03" EXAMPLES="embarc_applications"
2447
os: linux
2548
compiler: gcc
26-
- env: TOOLCHAIN="gnu" BOARD="emsk" BD_VER="22" CUR_CORE="arcem11d"
49+
- env: NAME="emsk-gnu-201709-22" OSP_ROOT="." BOARD="emsk" TOOLCHAIN="gnu" BD_VER="22" GNU_VER="2017.09" EXAMPLES="embarc_applications"
2750
os: linux
2851
compiler: gcc
29-
- env: TOOLCHAIN="gnu" BOARD="emsk" BD_VER="23" CUR_CORE="arcem7d"
52+
- env: NAME="emsk-gnu-201803-22" OSP_ROOT="." BOARD="emsk" TOOLCHAIN="gnu" BD_VER="22" GNU_VER="2018.03" EXAMPLES="embarc_applications"
3053
os: linux
3154
compiler: gcc
32-
- env: TOOLCHAIN="gnu" BOARD="emsk" BD_VER="23" CUR_CORE="arcem11d"
55+
- env: NAME="emsk-gnu-201709-23" OSP_ROOT="." BOARD="emsk" TOOLCHAIN="gnu" BD_VER="23" GNU_VER="2017.09" EXAMPLES="embarc_applications"
3356
os: linux
3457
compiler: gcc
58+
- env: NAME="emsk-gnu-201803-23" OSP_ROOT="." BOARD="emsk" TOOLCHAIN="gnu" BD_VER="23" GNU_VER="2018.03" EXAMPLES="embarc_applications"
59+
os: linux
60+
compiler: gcc

.travis/before_install.sh

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,13 @@ die() {
77
}
88
set -x
99

10-
cd /tmp || die
1110
[ $TRAVIS_OS_NAME != linux ] || {
1211

1312
sudo apt-get update || die
1413
sudo apt-get install lib32z1 || die
1514
sudo apt-get install dos2unix || die
16-
wget https://github.com/foss-for-synopsys-dwc-arc-processors/toolchain/releases/download/arc-2017.09-release/arc_gnu_2017.09_prebuilt_elf32_le_linux_install.tar.gz || die
17-
tar xzf arc_gnu_2017.09_prebuilt_elf32_le_linux_install.tar.gz || die
18-
export PATH=/tmp/arc_gnu_2017.09_prebuilt_elf32_le_linux_install/bin:$PATH || die
19-
arc-elf32-gcc --version || die
15+
pip install --upgrade pip || die
16+
pip install PrettyTable || die
17+
pip install colorama || die
18+
pip install configparser || die
2019
}

.travis/build.py

Lines changed: 0 additions & 65 deletions
This file was deleted.

.travis/expected.ini

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[embarc_applications/arc_design_contest/2018/XDU_Master-Sign-Language/arc]
2+
emsk=22,23
3+

.travis/script.sh

Lines changed: 9 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -12,39 +12,24 @@ set -x
1212
git config --global user.name "${U_NAME}"
1313
git config --global user.email "${U_EMAIL}"
1414

15-
export PATH=/tmp/arc_gnu_2017.09_prebuilt_elf32_le_linux_install/bin:$PATH || die
15+
export PATH=/tmp/arc_gnu_${GNU_VER}_prebuilt_elf32_le_linux_install/bin:$PATH || die
1616
git checkout -- . || die
1717
git archive --format zip -o applications.zip --prefix embarc_applications/ HEAD || die
1818
[ $embARC_OSP_REPO ] || {
1919
embARC_OSP_REPO="https://github.com/foss-for-synopsys-dwc-arc-processors/embarc_osp.git"
2020
}
2121
git clone ${embARC_OSP_REPO} embarc_osp
2222
cd embarc_osp || die
23-
unzip ../applications.zip || die
23+
unzip ../applications.zip>/dev/null 2>&1 || die
2424
bash apply_embARC_patch.sh || die
25-
cd ../ || die
26-
cd .travis || die
27-
28-
[ $TOOLCHAIN != gnu -o $BOARD != emsk -o $BD_VER != 11 -o $CUR_CORE != arcem6 ] || {
29-
30-
python3 build.py "TOOLCHAIN=${TOOLCHAIN} BOARD=${BOARD} BD_VER=${BD_VER} CUR_CORE=${CUR_CORE}" || die
31-
}
32-
[ $TOOLCHAIN != gnu -o $BOARD != emsk -o $BD_VER != 22 -o $CUR_CORE != arcem7d ] || {
33-
34-
python3 build.py "TOOLCHAIN=${TOOLCHAIN} BOARD=${BOARD} BD_VER=${BD_VER} CUR_CORE=${CUR_CORE}" || die
35-
}
25+
# cd ../ || die
3626

37-
[ $TOOLCHAIN != gnu -o $BOARD != emsk -o $BD_VER != 22 -o $CUR_CORE != arcem11d ] || {
38-
39-
python3 build.py "TOOLCHAIN=${TOOLCHAIN} BOARD=${BOARD} BD_VER=${BD_VER} CUR_CORE=${CUR_CORE}" || die
40-
}
41-
[ $TOOLCHAIN != gnu -o $BOARD != emsk -o $BD_VER != 23 -o $CUR_CORE != arcem7d ] || {
42-
43-
python3 build.py "TOOLCHAIN=${TOOLCHAIN} BOARD=${BOARD} BD_VER=${BD_VER} CUR_CORE=${CUR_CORE}" || die
44-
}
45-
[ $TOOLCHAIN != gnu -o $BOARD != emsk -o $BD_VER != 23 -o $CUR_CORE != arcem11d ] || {
46-
47-
python3 build.py "TOOLCHAIN=${TOOLCHAIN} BOARD=${BOARD} BD_VER=${BD_VER} CUR_CORE=${CUR_CORE}" || die
27+
echo $EXPECTED
28+
EXPECTED="../""${EXPECTED}"
29+
cd .travis || die
30+
{
31+
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}"
32+
python build.py ${BUILD_OPTS} || die
4833
}
4934

5035
}

0 commit comments

Comments
 (0)