-
Notifications
You must be signed in to change notification settings - Fork 0
77 lines (70 loc) · 1.87 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
name: Backend API
on:
push:
paths:
- "backend/**"
- ".github/workflows/backend.yml"
jobs:
test:
strategy:
fail-fast: false
matrix:
python-version: [3.10.0] # Updated to Python 3.10
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
code-quality:
strategy:
fail-fast: false
matrix:
python-version: [3.10]
poetry-version: [1.7.1]
os: [windows-latest]
runs-on: ${{ matrix.os }}
defaults:
run:
working-directory: backend/
steps:
- uses: actions/checkout@v1
- uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install poetry
run: |
python -m pip install poetry==1.7.1
- name: Install dependencies
run: |
python -m poetry install
# - name: Run automatically format code if not formatted
# run: bash format_code.sh
- 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 .