-
Notifications
You must be signed in to change notification settings - Fork 49
63 lines (49 loc) · 1.56 KB
/
backend.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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
name: backend
on: [push, workflow_dispatch]
jobs:
build:
runs-on: ubuntu-22.04
services:
postgres:
image: postgres
env:
POSTGRES_USER: bracket_ci
POSTGRES_PASSWORD: bracket_ci
POSTGRES_DB: bracket_ci
ports:
- 5532:5432
steps:
- uses: actions/checkout@v4
- name: Install pipenv
run: python3 -m pip install --upgrade pipenv wheel virtualenv
working-directory: backend
- id: cache-pipenv
uses: actions/cache@v3
with:
path: ~/.local/share/virtualenvs
key: ${{ runner.os }}-pipenv-${{ hashFiles('**/Pipfile.lock') }}
- name: Install dependencies
run: pipenv install -d
working-directory: backend
- name: Run tests
run: pipenv run pytest --cov --cov-report=xml .
working-directory: backend
env:
ENVIRONMENT: CI
- name: Upload coverage report to Codecov
uses: codecov/codecov-action@v3
- name: Run mypy
run: pipenv run mypy --version && pipenv run mypy .
working-directory: backend
- name: Run pylint
run: pipenv run pylint alembic bracket tests
working-directory: backend
- name: Run black
run: pipenv run black --check .
working-directory: backend
- name: Run ruff
run: pipenv run ruff check .
working-directory: backend
- name: Run vulture
run: '! pipenv run vulture |grep "unused function\|unused class\|unused method"'
working-directory: backend