forked from TuGraph-family/tugraph-db
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathit.sh
76 lines (60 loc) · 2.02 KB
/
it.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
#!/bin/bash
# Standard Github-hosted runner is 2core currently.
# Larger runner will support soon(current in Beta).
set -e
BUILD_OUTPUT_TAR_URL=$1
WITH_PROCEDURE=${2:-"OFF"}
echo 'build output tar url:'
echo $BUILD_OUTPUT_TAR_URL
# mv code path for coverage
MY_WORKSPACE='/workspace/code-repo'
if [[ -d "$MY_WORKSPACE" ]]; then
echo "$MY_WORKSPACE already exists, will be removed!"
rm -rf $MY_WORKSPACE
fi
# download build.output
mkdir -p /workspace
cd /workspace
echo $BUILD_OUTPUT_TAR_URL
wget -q -t 3 $BUILD_OUTPUT_TAR_URL -O output.tar.gz
tar -zxmf output.tar.gz
# refresh timestamp of build
tar -zxmf output.tar.gz code-repo/build
# set $MY_WORKSPACE to root dir
cd $MY_WORKSPACE
# build java
cd ${MY_WORKSPACE}/deps/tugraph-db-client-java/
sh local_build.sh
cp rpc-client-test/target/tugraph-db-java-rpc-client-test-*.jar ${MY_WORKSPACE}/build/output/
cp ogm/tugraph-db-ogm-test/target/tugraph-db-ogm-test-*.jar ${MY_WORKSPACE}/build/output/
# build cpp client test
cd ${MY_WORKSPACE}/test/test_rpc_client
sh ./cpp/CppClientTest/compile.sh
cp -r ./cpp/CppClientTest/build/clienttest ${MY_WORKSPACE}/build/output/
# set $MY_WORKSPACE to root dir
cd $MY_WORKSPACE
# integrate tests
cd build/output
ln -s ../../src/client/python/TuGraphClient/TuGraphClient.py .
ln -s ../../src/client/python/TuGraphClient/TuGraphRestClient.py .
ln -s ../../test/integration/* ./
ln -s ../../learn/examples/* ./
ln -s ../../demo/movie .
if [[ "$WITH_PROCEDURE" == "OFF" ]]; then
rm -rf test_algo.py test_sampling.py test_train.py
fi
pytest ./
# codecov
cd $MY_WORKSPACE
mkdir testresult
bash $MY_WORKSPACE/ci/codecov.sh $MY_WORKSPACE/build $MY_WORKSPACE/testresult
# mv code to $WORKSPACE
if [[ "$WORKSPACE" != "$MY_WORKSPACE" ]]; then
echo "$WORKSPACE is not equal to $MY_WORKSPACE"
echo 'mv source code back to workspace'
rm -rf $WORKSPACE
mkdir -p $WORKSPACE
mv $MY_WORKSPACE/* $MY_WORKSPACE/.[^.]* $WORKSPACE
fi
cd $WORKSPACE
python3 ./ci/lcov_cobertura.py $WORKSPACE/testresult/coverage.info --output $WORKSPACE/testresult/coverage.xml --demangle