forked from DScheglov/ehealth.api
-
Notifications
You must be signed in to change notification settings - Fork 0
/
mix_tests.sh
executable file
·53 lines (43 loc) · 1.39 KB
/
mix_tests.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
#!/bin/bash
cd $TRAVIS_BUILD_DIR
# Run all tests except pending ones
echo "- mix test --exclude pending --trace "
mix test --exclude pending --trace
if [ "$?" -eq 0 ]; then
echo "mix test successfully completed"
else
echo "mix test Finished with errors ,exited with 1"
mix_test=1 ;
fi;
# Submit code coverage report to Coveralls
# Add --pro if you using private repo.
echo "- mix coveralls.travis --exclude pending --umbrella;"
mix coveralls.travis --exclude pending --umbrella
if [ "$?" -eq 0 ]; then
echo "mix coveralls.travis successfully completed"
else
echo "mix coveralls.travis finished with errors , exited with 1"
mix_test=1;
fi;
# Run static code analysis
echo "- mix credo --strict ; "
mix credo --strict
if [ "$?" -eq 0 ]; then
echo "mix credo successfully completed"
else
echo "mix credo finished with errors, exited with 1"
mix_test=1;
fi;
# Check code style
echo "- mix format;"
mix format --check-formatted
if [ "$?" -eq 0 ]; then
echo "mix format successfully completed"
else
echo "mix format finished with errors, exited with 1"
mix_test=1;
fi;
if [ "${mix_test}" == "1" ]; then
echo "finished with errors"
exit 1;
fi;