File tree 4 files changed +24
-20
lines changed
4 files changed +24
-20
lines changed Original file line number Diff line number Diff line change 8
8
9
9
jobs :
10
10
test :
11
- runs-on : ubuntu-latest
12
- name : CPP
11
+ strategy :
12
+ fail-fast : false
13
+ matrix :
14
+ os : [ubuntu-latest, windows-latest, macosx-latest]
15
+ runs-on : ${{ matrix.os }}
13
16
env :
14
17
CPLUS_INCLUDE_PATH : " /usr/local/include/:/usr/include/jsoncpp/:/usr/local/opt/openssl/include/:/usr/lib/"
15
18
steps :
16
19
- uses : actions/checkout@v3
17
- - run : sudo apt-get install lcov libcurl4-openssl-dev libssl-dev uuid-dev libjson-c-dev libjsoncpp-dev nodejs npm
20
+ - if : ${{ matrix.os == 'ubuntu-latest' }}
21
+ run : sudo apt-get install lcov libcurl4-openssl-dev libssl-dev uuid-dev libjson-c-dev libjsoncpp-dev nodejs npm
18
22
- run : bash ./unit_test.sh
19
- - run : bash ./generate_code_cov.sh
23
+ - run : bash ./generate_code_cov.sh
20
24
- run : bash ./function_test.sh
21
25
- run : bash <(curl -s https://codecov.io/bash)
Original file line number Diff line number Diff line change @@ -7,11 +7,11 @@ if command -v python > /dev/null ; then
7
7
MAKE=" make -j $( python -c ' import multiprocessing as mp; print(int(mp.cpu_count()))' ) "
8
8
fi
9
9
10
- echo $MAKE
10
+ echo " $MAKE "
11
11
12
12
rm -rf sdk_build
13
13
mkdir sdk_build
14
- cd sdk_build
14
+ cd sdk_build || exit
15
15
cmake -DBUILD_PRODUCT=" $product " -DBUILD_FUNCTION_TESTS=OFF -DBUILD_UNIT_TESTS=OFF -DENABLE_COVERAGE=OFF -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr ..
16
16
$MAKE
17
17
Original file line number Diff line number Diff line change 1
1
#! /bin/bash
2
2
3
- cd ` dirname $0 `
3
+ cd $( dirname " $0 " ) || exit
4
4
echo ' -------build function test----------'
5
5
6
6
MAKE=make
7
7
if command -v python > /dev/null ; then
8
8
MAKE=" make -j $( python -c ' import multiprocessing as mp; print(int(mp.cpu_count()))' ) "
9
9
fi
10
10
11
- echo $MAKE
11
+ echo " $MAKE "
12
12
13
13
FT_BUILD_DIR=ft_build
14
14
rm -rf $FT_BUILD_DIR
15
15
mkdir $FT_BUILD_DIR
16
- cd $FT_BUILD_DIR
16
+ cd $FT_BUILD_DIR || exit
17
17
cmake -DBUILD_FUNCTION_TESTS=ON -DBUILD_UNIT_TESTS=OFF ..
18
18
$MAKE cdn core cs ecs rds slb vpc cdn_ft core_ft cs_ft ecs_ft nlp_ft rds_ft slb_ft vpc_ft
19
19
Original file line number Diff line number Diff line change 1
1
#! /bin/bash
2
2
3
- cd ` dirname $0 `
3
+ cd $( dirname " $0 " ) || exit
4
4
echo ' -------build unit test----------'
5
5
6
6
echo ' start a test http server'
7
- NODE=` which nodejs`
7
+ NODE=$( which nodejs)
8
8
9
9
if [ " $NODE " ]
10
10
then
11
11
echo ' '
12
12
else
13
- NODE=` which node`
13
+ NODE=$( which node)
14
14
fi
15
15
16
- echo ' node binary path: ' $NODE
16
+ echo ' node binary path: ' " $NODE "
17
17
18
- server=` ps -ef | grep http_test_server | grep -v grep`
19
- echo " check server: " $server
18
+ server=$( ps -ef | grep http_test_server | grep -v grep)
19
+ echo " check server: " " $server "
20
20
if [ " $server " ]
21
21
then
22
22
echo " server is on"
23
23
else
24
24
echo " server is off, start it"
25
- cd test/httpserver
25
+ cd test/httpserver || exit
26
26
npm i
27
- nohup $NODE http_test_server.js &
28
- cd -
27
+ nohup " $NODE " http_test_server.js &
28
+ cd - || exit
29
29
fi
30
30
31
31
MAKE=make
32
32
if command -v python > /dev/null ; then
33
33
MAKE=" make -j $( python -c ' import multiprocessing as mp; print(int(mp.cpu_count()))' ) "
34
34
fi
35
35
36
- echo $MAKE
36
+ echo " $MAKE "
37
37
38
38
UT_BUILD_DIR=ut_build
39
39
rm -rf $UT_BUILD_DIR
40
40
mkdir $UT_BUILD_DIR
41
- cd $UT_BUILD_DIR
41
+ cd $UT_BUILD_DIR || exit
42
42
cmake -DBUILD_FUNCTION_TESTS=OFF -DBUILD_UNIT_TESTS=ON -DENABLE_COVERAGE=ON ..
43
43
$MAKE core_ut
44
44
You can’t perform that action at this time.
0 commit comments