-
Notifications
You must be signed in to change notification settings - Fork 0
52 lines (44 loc) · 1.42 KB
/
backend.yaml
File metadata and controls
52 lines (44 loc) · 1.42 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
name: Backend build
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
permissions:
contents: read
jobs:
build-backend:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.10
uses: actions/setup-python@v3
with:
python-version: "3.10"
- name: Install Python dependencies
run: |
python -m pip install --upgrade pip
pip install flake8 coverage
pip install -U sentence-transformers
if [ -f requirements.txt ]; then
pip install -r requirements.txt;
fi
working-directory: "backend"
- name: Install dependecies for test
run: |
pip install codecov
pip install numpy
- name: Linting Codice Python (Flake8)
run: |
flake8 backend/ --count --exit-zero --select=E9,F63,F7,F82 --show-source --max-line-length=127 --statistics
flake8 backend/ --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Run Python tests and generate coverage report
run: |
coverage run -m unittest discover -s backend\
- name: Upload backend coverage report to Codecov
uses: codecov/codecov-action@v4.0.1
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: tests/coverage.xml
flags: python
name: backend-coverage