-
Notifications
You must be signed in to change notification settings - Fork 3
executable file
·63 lines (60 loc) · 1.8 KB
/
python-app.yml
File metadata and controls
executable file
·63 lines (60 loc) · 1.8 KB
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
name: Quality&Tests
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
env:
LANG: ru_RU.UTF-8
jobs:
build:
runs-on: ubuntu-latest
services:
postgres:
image: postgres:14.3-alpine
ports:
- "5432:5432"
env:
POSTGRES_DB: bot_test
POSTGRES_USER: bot
POSTGRES_PASSWORD: password
env:
DATABASE_URL: "postgres://bot:password@localhost:5432/bot_test"
steps:
- uses: actions/checkout@v2
- name: Set up locale
run: |
sudo locale-gen ru_RU.UTF-8
sudo update-locale LANG=ru_RU.UTF-8
- name: Set up Python 3.11
uses: actions/setup-python@v2
with:
python-version: 3.11
- name: Install dependencies
run: |
pip install flake8
pip install -r tests/requirements.txt
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# The GitHub editor is 127 chars wide
flake8 . --count --max-complexity=10 --max-line-length=127 --statistics --exclude handlers/__init__.py
- name: Test with pytest
run: |
pytest --cov-report=xml --cov=. tests/
env:
API_BOT_TOKEN: ${{ secrets.API_BOT_TOKEN }}
OWM_TOKEN: ${{ secrets.OWM_TOKEN }}
WEBHOOK: ${{ secrets.WEBHOOK }}
VK_SERVICE_TOKEN: ${{ secrets.VK_SERVICE_TOKEN }}
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./coverage.xml
directory: ./coverage/reports/
name: codecov-umbrella
fail_ci_if_error: true
path_to_write_report: ./coverage/codecov_report.txt
verbose: false