Skip to content

Commit 7d73bee

Browse files
authored
Merge pull request #152 from moevm/PB-113
#113 Проверка собираемости контейнеров
2 parents 21c30cd + bc25816 commit 7d73bee

File tree

4 files changed

+78
-22
lines changed

4 files changed

+78
-22
lines changed
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: Container collection check
2+
3+
on:
4+
push:
5+
paths:
6+
- 'env_file'
7+
- 'Dockerfile'
8+
- 'docker-compose.yml'
9+
- 'src/**'
10+
workflow_run:
11+
workflows: [ PEP8 Style Guide Enforcement & Requirements check ]
12+
types: [ completed ]
13+
14+
jobs:
15+
docker_check:
16+
runs-on: ubuntu-22.04
17+
steps:
18+
- uses: actions/checkout@v2
19+
20+
- name: Create .env
21+
env:
22+
TELEGRAM_TOKEN: ${{ secrets.TEST_BOT_TOKEN }}
23+
run: |
24+
cp env_file .env
25+
sed -i -e "s/PasteYourTelegramToken/${TELEGRAM_TOKEN}/g" .env
26+
27+
- name: Build images
28+
run: |
29+
docker compose build
30+
31+
- name: Pull images
32+
run: |
33+
docker compose pull --ignore-buildable
34+
35+
- name: Start containers
36+
run: |
37+
docker compose up -d
38+
sleep 30
39+
40+
- name: Check containers
41+
run: |
42+
echo "Running containers <$(docker ps -a --filter "status=running" --format "{{.ID}}" | wc -l)> of $(docker ps -a --format "{{.ID}}" | wc -l)."
43+
docker ps -a --filter "status=running" --format "{{.ID}}\t{{.Names}}"
44+
if [[ "$(docker ps -a --filter "status=running" --format "{{.ID}}" | wc -l)" -eq "$(docker ps -a --format "{{.ID}}" | wc -l)" ]]; then
45+
echo -e "\nCHECK COMPLETE"
46+
exit 0
47+
else
48+
echo -e "\nCHECK FAILED"
49+
exit 1
50+
fi

.github/workflows/linter.yml

Lines changed: 26 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,32 @@
1-
name: PEP8 Style Guide Enforcement \ Requirements check
1+
name: PEP8 Style Guide Enforcement & Requirements check
22

33
on: [push]
44

55
jobs:
6-
build:
6+
base_check:
77
runs-on: ubuntu-latest
88
steps:
9-
- uses: actions/checkout@v2
10-
- name: Set up Python 3.10
11-
uses: actions/setup-python@v2
12-
with:
13-
python-version: "3.10"
14-
- name: Installation of testing utilities (Pipreqs, Pylint)
15-
run: |
16-
python -m pip install --upgrade pip
17-
pip install pipreqs pylint
18-
- name: Dependency check (Run Pipreqs)
19-
run: |
20-
pipreqs --savepath src/reqs-check.txt --mode no-pin src/
21-
python requirements_check.py src/requirements.txt src/reqs-check.txt
22-
- name: Install Dependencies
23-
run: |
24-
pip install -r src/requirements.txt
25-
- name: Style check (Run Pylint)
26-
run: |
27-
pylint $(git ls-files 'src/*.py')
9+
- uses: actions/checkout@v2
10+
11+
- name: Set up Python 3.10
12+
uses: actions/setup-python@v2
13+
with:
14+
python-version: "3.10"
15+
16+
- name: Installation of testing utilities (Pipreqs, Pylint)
17+
run: |
18+
python -m pip install --upgrade pip
19+
pip install pipreqs pylint
20+
21+
- name: Dependency check (Run Pipreqs)
22+
run: |
23+
pipreqs --savepath src/reqs-check.txt --mode no-pin src/
24+
python requirements_check.py src/requirements.txt src/reqs-check.txt
25+
26+
- name: Install Dependencies
27+
run: |
28+
pip install -r src/requirements.txt
29+
30+
- name: Style check (Run Pylint)
31+
run: |
32+
pylint $(git ls-files 'src/*.py')

env_file

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@ LANGUAGE=ru
77
SAMPLE_RATE=48000
88
SPEAKER=baya
99
ASR_ENGINE=openai_whisper
10-
ASR_MODEL=base
10+
ASR_MODEL=base

src/databases/db.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -447,6 +447,7 @@ def get_users_not_finish_survey():
447447
survey_progress = get_survey_progress(user, last_focus)
448448
if survey_progress.need_answer:
449449
list_survey_progress = SurveyProgress.objects.raw({'survey_id': last_focus})
450+
start_time, time_not_finish = None, None
450451
for i in list_survey_progress:
451452
if i.user.id == user.id and i.survey_step == 0:
452453
start_time = i.time_send_question

0 commit comments

Comments
 (0)