Skip to content

Commit ffd9aca

Browse files
committed
Add CI test
1 parent 956aed9 commit ffd9aca

5 files changed

Lines changed: 49 additions & 2 deletions

File tree

.github/workflows/ci.yaml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: Code Quality and Tests
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- '**'
8+
pull_request:
9+
branches:
10+
- main
11+
12+
jobs:
13+
pr_checks:
14+
runs-on: ubuntu-latest
15+
16+
steps:
17+
- name: Checkout code
18+
uses: actions/checkout@v2
19+
20+
- name: Set up Python
21+
uses: actions/setup-python@v2
22+
with:
23+
python-version: '3.12'
24+
25+
- name: Install dependencies
26+
run: |
27+
pip install -r requirements.txt
28+
29+
- name: Download YOLOv7 pose model
30+
run: |
31+
curl -L -o yolov7-w6-pose.pt https://github.com/WongKinYiu/yolov7/releases/download/v0.1/yolov7-w6-pose.pt
32+
33+
- name: Check Python script for errors
34+
run: |
35+
CI_MODE=1 python video.py
36+
37+
- name: Run Black to check code style
38+
run: |
39+
black --check .

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ data/images/*
2828
!data/images/zidane.jpg
2929
!data/images/bus.jpg
3030
!data/*.sh
31+
!fall_dataset/ci_videos/**
32+
!.github/workflows/ci.yaml
3133

3234
results*.csv
3335

fall_dataset/ci_videos/video_1.mp4

983 KB
Binary file not shown.

requirements.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,4 +41,6 @@ thop~=0.1.1.post2209072238
4141
# roboflow
4242

4343
telepot~=12.7
44-
torchmetrics~=0.10.2
44+
torchmetrics~=0.10.2
45+
46+
black==24.8.0

video.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,11 @@ def process_video_file(video_path, output_dir):
5353

5454

5555
if __name__ == "__main__":
56-
videos_path = "fall_dataset/videos"
56+
if os.environ.get("CI_MODE") == "1":
57+
videos_path = "fall_dataset/ci_videos"
58+
print("[CI MODE] Only running on CI test videos...")
59+
else:
60+
videos_path = "fall_dataset/videos"
5761
output_dir = "output_videos"
5862
os.makedirs(output_dir, exist_ok=True)
5963

0 commit comments

Comments
 (0)