-
Notifications
You must be signed in to change notification settings - Fork 2
/
github-ci.sh
executable file
·39 lines (32 loc) · 1.05 KB
/
github-ci.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
# error codes
EXIT_CODE_INCORRECT_PATH=1
EXIT_CODE_FAILED_TESTING=2
# package to test
echo "Install Robot Framework."
pip3 install robotframework
# packages to generate documentation
echo "Install packages to generate documentation."
pip3 install docutils pygments
# export path to the library
echo "Export path to the HttpCtrl library."
cd src || exit $EXIT_CODE_INCORRECT_PATH
PYTHONPATH=`pwd`
export PYTHONPATH=${PYTHONPATH}
echo "Path '$PYTHONPATH' is exported."
# run tests
echo "Run tests for HttpCtrl."
cd ../tst || exit $EXIT_CODE_INCORRECT_PATH
python3 -m robot.run *.robot
result=$?
# check testing results
if [ $result -ne 0 ]
then
echo "Testing results contain errors - mark build as a failure."
exit $EXIT_CODE_FAILED_TESTING
fi
# generate documentation
echo "Generate documentation for HttpCtrl."
cd ../src || exit $EXIT_CODE_INCORRECT_PATH
python3 -m robot.libdoc -v 0.1.9 -F reST HttpCtrl.Client client.html
python3 -m robot.libdoc -v 0.1.9 -F reST HttpCtrl.Server server.html
python3 -m robot.libdoc -v 0.1.9 -F reST HttpCtrl.Json json.html