Skip to content

Commit d87f042

Browse files
Initial commit
0 parents  commit d87f042

File tree

569 files changed

+2476305
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

569 files changed

+2476305
-0
lines changed

.github/workflows/main.yml

Lines changed: 381 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,381 @@
1+
name: autotests
2+
3+
on:
4+
pull_request:
5+
push:
6+
workflow_dispatch:
7+
8+
permissions:
9+
checks: write
10+
contents: read
11+
pull-requests: read
12+
13+
14+
jobs:
15+
sprint_1:
16+
runs-on: ubuntu-22.04
17+
container:
18+
image: praktikumcpp/practicum_cpp_backend:latest
19+
volumes:
20+
- /var/run/docker.sock:/var/run/docker.sock
21+
options: --name main-container
22+
steps:
23+
- name: get docker network
24+
run: echo "DOCKER_NETWORK=$(docker inspect main-container -f '{{range $k, $v := .NetworkSettings.Networks}}{{printf "%s" $k}}{{end}}')" >> $GITHUB_ENV
25+
26+
- name: Checkout code & tests
27+
uses: actions/checkout@v3
28+
with:
29+
submodules: true
30+
31+
- name: Install dependencies
32+
run: |
33+
pip uninstall conan -y
34+
pip install -U conan==1.59.0
35+
cp -R /home/forconan/.conan /github/home/.conan
36+
37+
- name: run tests sprint1 sum
38+
run: |
39+
cd cpp-backend-tests-practicum/scripts/sprint1
40+
./sum/run.sh
41+
42+
- name: run tests sprint1 sync_server
43+
run: |
44+
cd cpp-backend-tests-practicum/scripts/sprint1
45+
./sync_server/run.sh
46+
47+
- name: run tests sprint1 restaurant_single_threaded
48+
run: |
49+
cd cpp-backend-tests-practicum/scripts/sprint1
50+
./restaurant_single_threaded/run.sh
51+
52+
- name: run tests sprint1 restaurant_multi_threaded
53+
run: |
54+
cd cpp-backend-tests-practicum/scripts/sprint1
55+
./restaurant_multi_threaded/run.sh
56+
57+
- name: run tests sprint1 cafeteria
58+
run: |
59+
cd cpp-backend-tests-practicum/scripts/sprint1
60+
./cafeteria/run.sh
61+
62+
- name: run tests sprint1 async_server
63+
run: |
64+
cd cpp-backend-tests-practicum/scripts/sprint1
65+
./async_server/run.sh
66+
67+
- name: run tests sprint1 map_json
68+
run: |
69+
cd cpp-backend-tests-practicum/scripts/sprint1
70+
./map_json/run.sh
71+
72+
- name: run tests sprint1 final_task
73+
run: |
74+
cd cpp-backend-tests-practicum/scripts/sprint1
75+
./final_task/run.sh
76+
77+
- name: Publish XML reports
78+
uses: EnricoMi/publish-unit-test-result-action@v2
79+
if: always()
80+
with:
81+
junit_files: ${{ github.workspace }}/*.xml
82+
83+
sprint_2:
84+
runs-on: ubuntu-22.04
85+
container:
86+
image: praktikumcpp/practicum_cpp_backend:latest
87+
volumes:
88+
- /var/run/docker.sock:/var/run/docker.sock
89+
options: --name main-container
90+
steps:
91+
92+
- name: get docker network
93+
run: echo "DOCKER_NETWORK=$(docker inspect main-container -f '{{range $k, $v := .NetworkSettings.Networks}}{{printf "%s" $k}}{{end}}')" >> $GITHUB_ENV
94+
95+
- name: Checkout code & tests
96+
uses: actions/checkout@v3
97+
with:
98+
submodules: true
99+
100+
- name: Install dependencies
101+
run: |
102+
pip uninstall conan -y
103+
pip install -U conan==1.59.0
104+
cp -R /home/forconan/.conan /github/home/.conan
105+
106+
- name: run tests sprint2 static_content
107+
run: |
108+
cd cpp-backend-tests-practicum/scripts/sprint2
109+
./static_content/run.sh
110+
111+
- name: run tests sprint2 logger
112+
run: |
113+
./cpp-backend-tests-practicum/scripts/sprint2/logger/run.sh
114+
115+
- name: run tests sprint2 server_logging
116+
run: |
117+
cd cpp-backend-tests-practicum/scripts/sprint2
118+
./server_logging/run.sh
119+
120+
- name: run tests sprint2 join_game
121+
run: |
122+
cd cpp-backend-tests-practicum/scripts/sprint2
123+
./join_game/run.sh
124+
125+
- name: run tests sprint2 game_state
126+
run: |
127+
cd cpp-backend-tests-practicum/scripts/sprint2
128+
./game_state/run.sh
129+
130+
- name: run tests sprint2 move_players
131+
run: |
132+
cd cpp-backend-tests-practicum/scripts/sprint2
133+
./move_players/run.sh
134+
135+
- name: run tests sprint2 time_control
136+
run: |
137+
cd cpp-backend-tests-practicum/scripts/sprint2
138+
./time_control/run.sh
139+
140+
- name: run tests sprint2 command_line
141+
run: |
142+
cd cpp-backend-tests-practicum/scripts/sprint2
143+
./command_line/run.sh
144+
145+
146+
sprint_3:
147+
runs-on: ubuntu-22.04
148+
steps:
149+
150+
- name: Checkout code & tests
151+
uses: actions/checkout@v3
152+
with:
153+
submodules: true
154+
155+
- name: Install dependencies
156+
run: |
157+
pip uninstall conan -y
158+
pip install -U conan==1.59.0
159+
pip install -r requirements.txt
160+
pip show pytest
161+
162+
- name: run tests sprint3 instrumentation
163+
run: |
164+
cd cpp-backend-tests-practicum/scripts/sprint3
165+
./instrumentation/run.sh
166+
167+
# - name: Load map_json binary
168+
# uses: actions/download-artifact@v3
169+
# with:
170+
# name: game_server
171+
# path: ${{ github.workspace }}/sprint1/problems/map_json/solution/build/bin
172+
173+
# - run: chmod +x ${GITHUB_WORKSPACE}/sprint1/problems/map_json/solution/build/bin/game_server
174+
175+
- name: Load FlameGraph
176+
uses: actions/checkout@v3
177+
with:
178+
repository: 'brendangregg/FlameGraph'
179+
path: ${{ github.workspace }}/sprint3/problems/flamegraph/solution/FlameGraph
180+
181+
- name: run tests sprint3 flamegraph
182+
run: |
183+
./cpp-backend-tests-practicum/scripts/sprint1/map_json/build.sh
184+
cd cpp-backend-tests-practicum/scripts/sprint3
185+
./flamegraph/run.sh
186+
187+
- name: run tests sprint3 gen_objects
188+
run: |
189+
cd cpp-backend-tests-practicum/scripts/sprint3
190+
./gen_objects/run.sh
191+
192+
- name: run tests sprint3 static_lib
193+
run: |
194+
cd cpp-backend-tests-practicum/scripts/sprint3
195+
pip show pytest
196+
./static_lib/run.sh
197+
198+
- name: run tests sprint3 gather-tests
199+
run: |
200+
cd cpp-backend-tests-practicum/scripts/sprint3
201+
./gather-tests/run.sh
202+
203+
- name: run tests sprint3 gather-tests_wrong1
204+
run: |
205+
cd cpp-backend-tests-practicum/scripts/sprint3
206+
./gather-tests_wrong1/run.sh
207+
208+
- name: run tests sprint3 gather-tests_wrong2
209+
run: |
210+
cd cpp-backend-tests-practicum/scripts/sprint3
211+
./gather-tests_wrong2/run.sh
212+
213+
- name: run tests sprint3 gather-tests_wrong3
214+
run: |
215+
cd cpp-backend-tests-practicum/scripts/sprint3
216+
./gather-tests_wrong3/run.sh
217+
218+
- name: run tests sprint3 gather-tests_wrong4
219+
run: |
220+
cd cpp-backend-tests-practicum/scripts/sprint3
221+
./gather-tests_wrong4/run.sh
222+
223+
- name: run tests sprint3 gather-tests_wrong5
224+
run: |
225+
cd cpp-backend-tests-practicum/scripts/sprint3
226+
./gather-tests_wrong5/run.sh
227+
228+
- name: run tests sprint3 gather
229+
run: |
230+
cd cpp-backend-tests-practicum/scripts/sprint3
231+
./gather/run.sh
232+
233+
- name: run tests sprint3 find_return
234+
run: |
235+
cd cpp-backend-tests-practicum/scripts/sprint3
236+
./find_return/run.sh
237+
238+
- name: run tests sprint3 scores
239+
run: |
240+
cd cpp-backend-tests-practicum/scripts/sprint3
241+
./scores/run.sh
242+
243+
- name: run tests sprint3 ammo
244+
run: |
245+
cd cpp-backend-tests-practicum/scripts/sprint3
246+
./ammo/run.sh
247+
248+
- name: run tests sprint3 load
249+
run: |
250+
cd cpp-backend-tests-practicum/scripts/sprint3
251+
./load/run.sh
252+
253+
- name: Publish XML reports
254+
uses: EnricoMi/publish-unit-test-result-action@v2
255+
if: always()
256+
with:
257+
junit_files: ${{ github.workspace }}/*.xml
258+
259+
sprint_4:
260+
runs-on: ubuntu-22.04
261+
steps:
262+
263+
- name: Checkout code & tests
264+
uses: actions/checkout@v3
265+
with:
266+
submodules: true
267+
268+
- name: Install dependencies
269+
run: |
270+
pip uninstall conan -y
271+
pip install -U conan==1.59.0
272+
pip install -r requirements.txt
273+
pip show pytest
274+
275+
- name: run tests sprint4 state_serialization
276+
run: |
277+
cd cpp-backend-tests-practicum/scripts/sprint4
278+
./state_serialization/run.sh
279+
280+
- name: Publish XML reports
281+
uses: EnricoMi/publish-unit-test-result-action@v2
282+
if: always()
283+
with:
284+
junit_files: ${{ github.workspace }}/*.xml
285+
286+
sprint_3_with_server:
287+
runs-on: ubuntu-22.04
288+
container:
289+
image: praktikumcpp/practicum_cpp_backend_server:latest
290+
options: --privileged
291+
services:
292+
cppserver:
293+
image: praktikumcpp/game_server:latest
294+
ports:
295+
- 8080:8080
296+
steps:
297+
298+
- name: Checkout code & tests
299+
uses: actions/checkout@v3
300+
with:
301+
submodules: true
302+
303+
- name: run tests sprint3 ammo
304+
run: |
305+
cd cpp-backend-tests-practicum/scripts/sprint3
306+
./ammo/run_ci.sh
307+
308+
- name: run tests sprint3 load
309+
run: |
310+
cd cpp-backend-tests-practicum/scripts/sprint3
311+
./load/run_ci.sh
312+
313+
## - name: run tests sprint3 stress
314+
## run: |
315+
## cd sprint3/problems/stress/solution
316+
## yandex-tank -c ${GITHUB_WORKSPACE}/sprint3/problems/stress/solution/load.yaml ${GITHUB_WORKSPACE}/sprint3/problems/stress/solution/ammo.txt
317+
## pytest --junitxml=${GITHUB_WORKSPACE}/stress.xml ${GITHUB_WORKSPACE}/cpp-backend-tests-practicum/tests/test_s03_stress.py
318+
## env:
319+
## DIRECTORY: ${{ github.workspace }}/sprint3/problems/stress/solution/logs
320+
#
321+
- name: Publish XML reports
322+
uses: EnricoMi/publish-unit-test-result-action@v2
323+
if: always()
324+
with:
325+
junit_files: ${{ github.workspace }}/*.xml
326+
327+
328+
sprint_4_with_postgress:
329+
runs-on: ubuntu-22.04
330+
container:
331+
image: praktikumcpp/practicum_cpp_backend:latest
332+
volumes:
333+
- /var/run/docker.sock:/var/run/docker.sock
334+
options: --name main-container
335+
services:
336+
postgres:
337+
image: ubuntu/postgres:14-22.04_beta
338+
env:
339+
POSTGRES_PASSWORD: Mys3Cr3t
340+
POSTGRES_HOST: postgres
341+
POSTGRES_PORT: 5432
342+
343+
steps:
344+
- name: get docker network
345+
run: |
346+
echo "DOCKER_NETWORK=$(docker inspect main-container -f '{{range $k, $v := .NetworkSettings.Networks}}{{printf "%s" $k}}{{end}}')" >> $GITHUB_ENV
347+
348+
- name: Checkout code & tests
349+
uses: actions/checkout@v3
350+
with:
351+
submodules: true
352+
353+
- name: Install dependencies
354+
run: |
355+
cp -R /home/forconan/.conan /github/home/.conan
356+
357+
- name: run tests sprint4 db_of_books
358+
run: |
359+
cd cpp-backend-tests-practicum/scripts/sprint4
360+
./db_of_books/run_postgresless.sh
361+
362+
- name: run tests sprint4 bookypedia-1
363+
run: |
364+
cd cpp-backend-tests-practicum/scripts/sprint4
365+
./bookypedia-1/run_postgresless.sh
366+
367+
- name: run tests sprint4 bookypedia-2
368+
run: |
369+
cd cpp-backend-tests-practicum/scripts/sprint4
370+
./bookypedia-2/run_postgresless.sh
371+
372+
- name: run tests sprint4 leave_game
373+
run: |
374+
cd cpp-backend-tests-practicum/scripts/sprint4
375+
./leave_game/run_postgresless.sh
376+
377+
- name: Publish XML reports
378+
uses: EnricoMi/publish-unit-test-result-action@v2
379+
if: always()
380+
with:
381+
junit_files: ${{ github.workspace }}/*.xml

0 commit comments

Comments
 (0)