3
3
schedule :
4
4
- cron : ' 0 22 * * *'
5
5
workflow_dispatch :
6
+
7
+ env :
8
+ SERVER_IMAGE_TEST_REPO : cvat_server
9
+
6
10
jobs :
7
11
check_updates :
8
12
runs-on : ubuntu-latest
@@ -64,43 +68,61 @@ jobs:
64
68
echo ::set-output name=default_branch::${DEFAULT_BRANCH}
65
69
echo ::set-output name=sha::${SHA}
66
70
67
- run_tests :
71
+ build :
68
72
needs : search_cache
69
73
runs-on : ubuntu-latest
70
74
steps :
71
75
- uses : actions/checkout@v2
72
76
73
- - uses : actions/setup-node@v2
74
- with :
75
- node-version : ' 16.x'
76
-
77
- - uses : actions/setup-python@v2
77
+ - name : Login to Docker Hub
78
+ uses : docker/login-action@v2
78
79
with :
79
- python-version : ' 3.8'
80
+ username : ${{ secrets.DOCKERHUB_USERNAME }}
81
+ password : ${{ secrets.DOCKERHUB_TOKEN }}
80
82
81
- - name : Getting CVAT server cache from the default branch
83
+ - name : CVAT server. Getting cache from the default branch
82
84
uses : actions/cache@v3
83
85
with :
84
86
path : /tmp/cvat_cache_server
85
87
key : ${{ runner.os }}-build-server-${{ needs.search_cache.outputs.sha }}
86
88
87
- - name : Getting CVAT UI cache from the default branch
88
- uses : actions/cache@v3
89
+ - name : CVAT server. Extract metadata (tags, labels) for Docker
90
+ id : meta-server
91
+ uses : docker/metadata-action@master
89
92
with :
90
- path : /tmp/cvat_cache_ui
91
- key : ${{ runner.os }}-build-ui-${{ needs.search_cache.outputs.sha }}
93
+ images : ${{ secrets.DOCKERHUB_WORKSPACE }}/${{ env.SERVER_IMAGE_TEST_REPO }}
92
94
93
95
- name : Set up Docker Buildx
94
96
uses : docker/setup-buildx-action@v2
95
97
96
- - name : Building CVAT server image
97
- uses : docker/build-push-action@v2
98
+ - name : CVAT server. Build and push
99
+ uses : docker/build-push-action@v3
98
100
with :
99
- context : .
100
- file : ./Dockerfile
101
101
cache-from : type=local,src=/tmp/cvat_cache_server
102
- tags : openvino/cvat_server:latest
103
- load : true
102
+ context : .
103
+ file : Dockerfile
104
+ push : true
105
+ tags : ${{ steps.meta-server.outputs.tags }}
106
+ labels : ${{ steps.meta-server.outputs.labels }}
107
+
108
+ unit_testing :
109
+ needs : build
110
+ runs-on : ubuntu-latest
111
+ steps :
112
+ - uses : actions/checkout@v2
113
+
114
+ - uses : actions/setup-python@v2
115
+ with :
116
+ python-version : ' 3.8'
117
+
118
+ - name : Set up Docker Buildx
119
+ uses : docker/setup-buildx-action@v2
120
+
121
+ - name : Getting CVAT UI cache from the default branch
122
+ uses : actions/cache@v3
123
+ with :
124
+ path : /tmp/cvat_cache_ui
125
+ key : ${{ runner.os }}-build-ui-${{ needs.search_cache.outputs.sha }}
104
126
105
127
- name : Building CVAT UI image
106
128
uses : docker/build-push-action@v2
@@ -111,6 +133,23 @@ jobs:
111
133
tags : openvino/cvat_ui:latest
112
134
load : true
113
135
136
+ - name : CVAT server. Extract metadata (tags, labels) for Docker
137
+ id : meta-server
138
+ uses : docker/metadata-action@master
139
+ with :
140
+ images : ${{ secrets.DOCKERHUB_WORKSPACE }}/${{ env.SERVER_IMAGE_TEST_REPO }}
141
+
142
+ - name : Login to Docker Hub
143
+ uses : docker/login-action@v2
144
+ with :
145
+ username : ${{ secrets.DOCKERHUB_USERNAME }}
146
+ password : ${{ secrets.DOCKERHUB_TOKEN }}
147
+
148
+ - name : Pull CVAT server image
149
+ run : |
150
+ docker pull ${{ steps.meta-server.outputs.tags }}
151
+ docker tag ${{ steps.meta-server.outputs.tags }} openvino/cvat_server
152
+
114
153
- name : OPA tests
115
154
run : |
116
155
curl -L -o opa https://openpolicyagent.org/downloads/v0.34.2/opa_linux_amd64_static
@@ -136,17 +175,67 @@ jobs:
136
175
137
176
docker-compose -f docker-compose.yml -f docker-compose.dev.yml -f docker-compose.ci.yml down -v
138
177
178
+ e2e_testing :
179
+ needs : build
180
+ runs-on : ubuntu-latest
181
+ steps :
182
+ - uses : actions/checkout@v2
183
+
184
+ - uses : actions/setup-node@v2
185
+ with :
186
+ node-version : ' 16.x'
187
+
188
+ - name : Set up Docker Buildx
189
+ uses : docker/setup-buildx-action@v2
190
+
191
+ - name : Getting CVAT UI cache from the default branch
192
+ uses : actions/cache@v3
193
+ with :
194
+ path : /tmp/cvat_cache_ui
195
+ key : ${{ runner.os }}-build-ui-${{ needs.search_cache.outputs.sha }}
196
+
197
+ - name : Building CVAT UI image
198
+ uses : docker/build-push-action@v2
199
+ with :
200
+ context : .
201
+ file : ./Dockerfile.ui
202
+ cache-from : type=local,src=/tmp/cvat_cache_ui
203
+ tags : openvino/cvat_ui:latest
204
+ load : true
205
+
206
+ - name : CVAT server. Extract metadata (tags, labels) for Docker
207
+ id : meta-server
208
+ uses : docker/metadata-action@master
209
+ with :
210
+ images : ${{ secrets.DOCKERHUB_WORKSPACE }}/${{ env.SERVER_IMAGE_TEST_REPO }}
211
+
212
+ - name : Login to Docker Hub
213
+ uses : docker/login-action@v2
214
+ with :
215
+ username : ${{ secrets.DOCKERHUB_USERNAME }}
216
+ password : ${{ secrets.DOCKERHUB_TOKEN }}
217
+
218
+ - name : Pull CVAT server image
219
+ run : |
220
+ docker pull ${{ steps.meta-server.outputs.tags }}
221
+ docker tag ${{ steps.meta-server.outputs.tags }} openvino/cvat_server
222
+
139
223
- name : Instrumentation of the code then rebuilding the CVAT UI
140
224
run : |
141
225
npm ci
142
226
npm run coverage
143
227
docker-compose -f docker-compose.yml -f docker-compose.dev.yml -f components/serverless/docker-compose.serverless.yml build cvat_ui
144
228
145
- - name : End-to-end. Run CVAT instance
229
+ - name : Run CVAT instance
146
230
run : |
147
- docker-compose -f docker-compose.yml -f docker-compose.dev.yml -f ./tests/docker-compose.email.yml -f tests/docker-compose.file_share.yml -f components/serverless/docker-compose.serverless.yml up -d
148
-
149
- - name : End-to-end. Waiting for server
231
+ docker-compose \
232
+ -f docker-compose.yml \
233
+ -f docker-compose.dev.yml \
234
+ -f ./tests/docker-compose.email.yml \
235
+ -f tests/docker-compose.file_share.yml \
236
+ -f components/serverless/docker-compose.serverless.yml up -d
237
+
238
+ - name : Waiting for server
150
239
id : wait-server
151
240
env :
152
241
API_ABOUT_PAGE : " localhost:8080/api/server/about"
@@ -176,22 +265,41 @@ jobs:
176
265
script : |
177
266
core.setFailed('Workflow failed: incorrect response from server. See logs artifact to get more info')
178
267
179
- - name : End-to-end. Add user for tests
268
+ - name : Add user for tests
180
269
env :
181
270
DJANGO_SU_NAME : " admin"
182
271
DJANGO_SU_EMAIL :
" [email protected] "
183
272
DJANGO_SU_PASSWORD : " 12qwaszx"
184
273
run : |
185
274
docker exec -i cvat /bin/bash -c "echo \"from django.contrib.auth.models import User; User.objects.create_superuser('${DJANGO_SU_NAME}', '${DJANGO_SU_EMAIL}', '${DJANGO_SU_PASSWORD}')\" | python3 ~/manage.py shell"
186
275
187
- - name : End-to-end. Run tests
276
+ - name : Run tests
188
277
run : |
189
278
cd ./tests
190
279
npm ci
191
- npm run cypress:run:chrome
192
- mv ./.nyc_output/out.json ./.nyc_output/out_2d.json
193
- npm run cypress:run:chrome:canvas3d
194
- mv ./.nyc_output/out.json ./.nyc_output/out_3d.json
280
+
281
+ TESTS_3D=('canvas3d_functionality' 'canvas3d_functionality_2')
282
+ for testset in ${TESTS_3D[@]};
283
+ do
284
+ npx cypress run \
285
+ --headed \
286
+ --config-file cypress_canvas3d.json \
287
+ --browser chrome \
288
+ --spec 'cypress/integration/${testset}/**/*.js,cypress/integration/remove_users_tasks_projects_organizations.js'
289
+ mv ./.nyc_output/out.json ./.nyc_output/out_$testset.json
290
+ done
291
+
292
+ TESTS=('actions_tasks' 'actions_tasks2' 'actions_tasks3' \
293
+ 'actions_objects' 'actions_objects2' 'actions_users' \
294
+ 'actions_projects_models' 'actions_organizations' 'issues_prs' \
295
+ 'issues_prs2' 'canvas3d_functionality' 'canvas3d_functionality_2')
296
+ for testset in ${TESTS[@]};
297
+ do
298
+ npx cypress run \
299
+ --browser chrome \
300
+ --spec 'cypress/integration/${testset}/**/*.js,cypress/integration/remove_users_tasks_projects_organizations.js'
301
+ mv ./.nyc_output/out.json ./.nyc_output/out_$testset.json
302
+ done
195
303
196
304
- name : Creating a log file from "cvat" container logs
197
305
if : failure()
@@ -223,27 +331,29 @@ jobs:
223
331
224
332
coveralls :
225
333
runs-on : ubuntu-latest
226
- needs : run_tests
334
+ needs : [unit_testing, e2e_testing]
227
335
steps :
228
336
- uses : actions/checkout@v2
229
337
230
- - name : Getting CVAT server cache from the default branch
231
- uses : actions/cache@v3
232
- with :
233
- path : /tmp/cvat_cache_server
234
- key : ${{ runner.os }}-build-server-${{ needs.search_cache.outputs.sha }}
235
-
236
338
- name : Set up Docker Buildx
237
- uses : docker/setup-buildx-action@v1.1. 2
339
+ uses : docker/setup-buildx-action@2
238
340
239
- - name : Building CVAT server image
240
- uses : docker/build-push-action@v2
341
+ - name : CVAT server. Extract metadata (tags, labels) for Docker
342
+ id : meta-server
343
+ uses : docker/metadata-action@master
241
344
with :
242
- context : .
243
- file : ./Dockerfile
244
- cache-from : type=local,src=/tmp/cvat_cache_server
245
- tags : openvino/cvat_server:latest
246
- load : true
345
+ images : ${{ secrets.DOCKERHUB_WORKSPACE }}/${{ env.SERVER_IMAGE_TEST_REPO }}
346
+
347
+ - name : Login to Docker Hub
348
+ uses : docker/login-action@v2
349
+ with :
350
+ username : ${{ secrets.DOCKERHUB_USERNAME }}
351
+ password : ${{ secrets.DOCKERHUB_TOKEN }}
352
+
353
+ - name : Pull CVAT server image
354
+ run : |
355
+ docker pull ${{ steps.meta-server.outputs.tags }}
356
+ docker tag ${{ steps.meta-server.outputs.tags }} openvino/cvat_server
247
357
248
358
- name : Downloading coverage results
249
359
uses : actions/download-artifact@v2
0 commit comments