-
Notifications
You must be signed in to change notification settings - Fork 0
67 lines (58 loc) · 1.75 KB
/
frontend-ci.yml
File metadata and controls
67 lines (58 loc) · 1.75 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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
name: Frontend CI
on:
push:
branches: [ main, develop ]
paths:
- 'frontend/**'
- 'src/frontend/**'
- '.github/workflows/frontend-ci.yml'
pull_request:
branches: [ main, develop ]
paths:
- 'frontend/**'
- 'src/frontend/**'
- '.github/workflows/frontend-ci.yml'
jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
python-version: [3.11]
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
cd frontend
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install pytest pytest-cov pytest-flet
- name: Run tests and generate coverage report
run: |
cd frontend
export TESTING=True
export TEST_FRONTEND_WINDOW_WIDTH=1200
export TEST_FRONTEND_WINDOW_HEIGHT=800
export TEST_FRONTEND_THEME_MODE=light
export PYTHONPATH=src
python -m pytest tests/ -v --cov=src/frontend --cov-report=xml:coverage.xml --cov-report=term-missing --cov-report=html
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
file: frontend/coverage.xml
name: frontend
flags: frontend
fail_ci_if_error: true
- name: Run linting
run: |
cd frontend
pip install flake8 black isort
flake8 src/frontend --max-line-length=88 --extend-ignore=E203,W503 --exclude=*.pyc,__pycache__
black --check src/frontend
isort --check src/frontend