-
Notifications
You must be signed in to change notification settings - Fork 0
55 lines (52 loc) · 1.54 KB
/
Copy pathci.yml
File metadata and controls
55 lines (52 loc) · 1.54 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
name: CI
on:
push:
branches: [main]
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.10"
cache: "pip"
cache-dependency-path: requirements-dev.txt
- name: Install lint tools
run: pip install -r requirements-dev.txt
- name: black --check
run: black --line-length 110 --check .
- name: flake8
run: flake8 .
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.10"
cache: "pip"
cache-dependency-path: |
requirements.txt
requirements-heavy.txt
# The app imports YOLO/EasyOCR (via opencv) at module scope in
# src/floorplan.py, so even importing the modules under test --
# let alone running them -- needs these system libs, same as the
# Dockerfile's apt-get step.
- name: Install system dependencies
run: |
sudo apt-get update
sudo apt-get install -y libgl1 libglib2.0-0 libsm6 libxext6 libxrender-dev
- name: Install dependencies
run: |
pip install -r requirements-heavy.txt
pip install -r requirements.txt
- name: Compile check
run: python -m compileall -q src tests
- name: Run tests
run: |
set -e
for f in tests/test_*.py; do
echo "== $f =="
python "$f"
done