Skip to content

Commit

Permalink
Add setup opencv step in test wf
Browse files Browse the repository at this point in the history
  • Loading branch information
DarwinsBuddy committed Oct 8, 2023
1 parent 43cccdd commit 9b426ec
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 3 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@ jobs:

steps:
- uses: actions/checkout@v3
- name: Cache OpenCV
uses: UrielCh/opencv-cache-action@V1
with:
branch: 4.x
BUILD_LIST: core
NO_CONTRIB: ''
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
Expand Down
3 changes: 2 additions & 1 deletion foosball/hooks/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@

import urllib3
import yaml
from playsound import playsound

from foosball.models import Team

logger = logging.getLogger(__name__)


@dataclasses.dataclass
class Webhook:
method: str
Expand Down Expand Up @@ -66,6 +66,7 @@ def play_random_sound(folder: str, prefix: str = './assets/audio'):


def play_sound(sound_file: str):
from playsound import playsound
if os.path.isfile(sound_file):
playsound(sound_file, block=False)
else:
Expand Down
1 change: 0 additions & 1 deletion foosball/tracking/analyze.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ def goal_shot(self, goals: Goals, track: Track) -> Optional[Team]:
return Team.RED
except Exception as e:
self.logger.error(f"Error {e}")
self.logger.error(f"self.last_track: [{' '.join([f'{x}' for x in self.last_track])}]")
return None

def call_hooks(self, team: Team) -> None:
Expand Down
10 changes: 9 additions & 1 deletion requirements_dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,12 @@ coverage==7.2.3
pylint==2.17.2
pytest-timeout==2.1.0
pytest-httpserver==1.0.8
pytest-asyncio==0.21.1
pytest-asyncio==0.21.1

imutils==0.5.4
numpy==1.24.2
opencv-python==4.8.1.78
opencv-contrib-python==4.8.1.78
vidgear==0.3.2
PyYaml==6.0.1
tqdm==4.66.1

0 comments on commit 9b426ec

Please sign in to comment.