-
Notifications
You must be signed in to change notification settings - Fork 0
114 lines (94 loc) · 2.69 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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
name: Backend API
on:
push:
paths:
- "backend/**"
- ".github/workflows/backend.yml"
env:
SECRET_KEY: ${{ secrets.SECRET_KEY }}
ENVIRONMENT: ${{ secrets.ENVIRONMENT }}
USE_S3: ${{ secrets.USE_S3 }}
REDIS_HOST: ${{ secrets.REDIS_HOST }}
REDIS_PORT: ${{ secrets.REDIS_PORT }}
REDIS_DB: ${{ secrets.REDIS_DB }}
STRIPE_PUBLISHABLE_KEY: ${{ secrets.STRIPE_PUBLISHABLE_KEY }}
STRIPE_SECRET_KEY: ${{ secrets.STRIPE_SECRET_KEY }}
jobs:
test:
strategy:
fail-fast: false
matrix:
python-version: [3.10.0]
poetry-version: [1.7.1]
os: [windows-latest]
runs-on: windows-latest
defaults:
run:
working-directory: backend/
steps:
- uses: actions/checkout@v1
- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: 3.10.0
- name: Install poetry
run: |
python -m pip install poetry==1.7.1
- name: Configure poetry
run: |
python -m poetry config virtualenvs.in-project true
- name: Cache the virtualenv
uses: actions/cache@v2
with:
path: ./.venv
key: ${{ runner.os }}-venv-${{ hashFiles('**/poetry.lock') }}
- name: Install dependencies
run: |
python -m poetry install
- name: Run tests paralel
run: poetry run pytest -n auto
- name: Run tests with pytest
run: poetry run pytest --cov=./ --cov-report=xml
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
code-quality:
strategy:
fail-fast: false
matrix:
python-version: [3.10.0]
poetry-version: [1.7.1]
os: [windows-latest]
runs-on: ${{ matrix.os }}
defaults:
run:
working-directory: backend/
steps:
- uses: actions/checkout@v1
- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: 3.10.0
- name: Install poetry
run: |
python -m pip install poetry==1.7.1
- name: Configure poetry
run: |
python -m poetry config virtualenvs.in-project true
- name: Cache the virtualenv
uses: actions/cache@v2
with:
path: ./.venv
key: ${{ runner.os }}-venv-${{ hashFiles('**/poetry.lock') }}
- name: Install dependencies
run: |
python -m poetry install
- name: Run black
run: poetry run black .
- name: Run isort
run: poetry run isort . --profile black
- name: Run flake8
run: poetry run flake8 .
- name: Run bandit
run: poetry run bandit .