-
Notifications
You must be signed in to change notification settings - Fork 8
49 lines (39 loc) · 1.1 KB
/
tests.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
name: Tests
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.11'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install pytest pytest-asyncio pytest-cov black flake8 autoflake
- name: Create config file
run: |
cp config.yml.example config.yml
# - name: Check code style
# run: |
# autoflake --check --recursive .
- name: Check formatting
run: |
black --check . || echo "::error::Black check failed"
- name: Run linter
run: |
flake8 . --statistics --show-source --verbose || echo "::error::Flake8 check failed"
if [ -f flake8.log ]; then
echo "Flake8 log contents:"
cat flake8.log
fi
- name: Run tests
run: |
pytest tests/ -v --cov=src