-
Notifications
You must be signed in to change notification settings - Fork 0
/
ci.sh
88 lines (84 loc) · 2.23 KB
/
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
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
77
78
79
80
81
82
83
84
85
86
87
88
#!/bin/sh
# Other CI tools are not working for the following reasons:
# - GitHub classroom's GitHub Actions ran out of time
# - Other tool such as circleCI and TravisCI requires GitHub write scope permission (need admin rights)
# Preparing for the CI pipeline
export CI=true
error_detected=false
# Running CI for frontend
echo "======================================"
echo "=========Starting Frontend CI========="
echo "======================================"
cd ./frontend
echo ""
echo "---------------------------------"
echo " Frontend Linting "
npm run lint
if [ $? -ne 0 ] ; then
error_detected=true;
fi
echo "---------------------------------"
echo " "
echo "---------------------------------"
echo " Frontend Prettier "
npm run prettier
if [ $? -ne 0 ] ; then
error_detected=true
fi
echo "---------------------------------"
echo " "
echo "---------------------------------"
echo " Frontend Tests "
yarn test
if [ $? -ne 0 ] ; then
error_detected=true
fi
echo "---------------------------------"
if [ "$error_detected" = true ] ; then
echo "......SOMETHING FAILED...."
echo "!!!!!!!!!!!!!!!!!!!!!!!!!!"
else
echo "......All Passed.....\n"
fi
read -p "Press any key to run CI for backend..."
echo "======================================="
echo " "
clear
error_detected=false
# Running CI for backend
echo "======================================"
echo "===========Starting Backend CI========"
echo "======================================"
cd ../backend
echo ""
echo "---------------------------------"
echo " Backend Linting "
npm run lint
if [ $? -ne 0 ] ; then
error_detected=true;
fi
echo "---------------------------------"
echo " "
echo "---------------------------------"
echo " Backend Prettier "
npm run prettier
if [ $? -ne 0 ] ; then
error_detected=true
fi
echo "---------------------------------"
echo " "
echo "---------------------------------"
echo " Backend Tests "
yarn test
if [ $? -ne 0 ] ; then
error_detected=true
fi
echo "---------------------------------"
if [ "$error_detected" = true ] ; then
echo "......SOMETHING FAILED...."
echo "!!!!!!!!!!!!!!!!!!!!!!!!!!"
else
echo "......All Passed.....\n"
fi
echo "======================================="
read -p "Press any key to quit... "