-
Notifications
You must be signed in to change notification settings - Fork 45
139 lines (119 loc) · 3.66 KB
/
main.yml
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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
name: CI/CD Status
on: [push,pull_request]
jobs:
build:
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v2
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.16
- name: Gosec - Code Analyser
continue-on-error: true
run: |
curl -sfL https://raw.githubusercontent.com/securego/gosec/master/install.sh | sh -s -- -b $(go env GOPATH)/bin latest
gosec ./...
- name: Docker Build Job
run: |
export GOBIN=/home/runner/go/bin
docker --version
echo "build discovery"
cd discovery
pwd
sh build development
echo "build broker"
cd ../broker
pwd
sh build development
echo "build worker"
cd ../worker
pwd
sh build development
echo "build master"
cd ../master
pwd
sh build development
echo "build designer"
cd ../designer
pwd
sh build development
- name: Setting Up Environment
run: |
sudo apt-get install jq
sudo apt install python3.7
sudo apt install python-pip
pip -V
sudo pip install --upgrade pip
pip install setuptools
pip install Flask
pip install requests
pip install -U pytest
pip install pytest-cov
pip install pyflakes
sudo npm install -g eslint
sudo apt-get install curl
- name: Running Linters [GoLint - a linter for golang, Pyflakes - a linter for python, ESLint - for Javascript]
run: |
#For go directories
go get -u golang.org/x/lint/golint
export GOBIN=/home/runner/go/bin
cd discovery/
golint
cd ../broker
golint
cd ../master
golint
cd ../worker
golint
cd ../
echo "For python files"
pyflakes . || true
echo "For Javascript files"
eslint . --no-eslintrc --format table || true
- name: Launching Docker containers
run: |
sudo docker run -it -d --rm --name rabbitmq -p 5672:5672 -p 15672:15672 --env RABBITMQ_DEFAULT_USER=admin --env RABBITMQ_DEFAULT_PASS=mypass rabbitmq:3.8-management
docker ps -a
- name: Building Fogflow Components
run: |
export GOBIN=/home/runner/go/bin
ls
cd discovery/
go get; go build;
ls
cd ../broker/
go get; go build;
ls
cd ../designer/
npm install
- name: Running Test Cases
run: |
export PATH=/home/runner/.local/bin:$PATH
ls
cp release/validation/config.json discovery/
cp release/validation/config.json broker/
cp release/validation/config.json master/
cp release/validation/config.json worker/
cp release/validation/config.json designer/
cd discovery/
screen -d -m ./discovery
cd ../broker/
screen -d -m ./broker
cd ../designer/
screen -d -m node main.js
cd ../test/UnitTest/
screen -d -m python accumulator.py
# echo "NGSI-v1 Testing !!!"
# cd ../UnitTest/v1/
# pytest -s -v test_casesNGSIv1.py
# echo "NGSI-v2 Testing !!!"
# cd ../v2/
# pytest -s -v test_casesNGSIv2.py
# echo "NGSI-LD Testing !!!"
# cd ../NGSI-LD/
# pytest -s -v test_casesNGSI-LD.py
# echo "Persistance Testing !!!"
# cd ../persistance/
# pytest -s -v test_persistance.py
echo "Testing Done !!!!!"