Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ Once you're done, someone will review your PR shortly (see the section "Who can

Fixes # (issue)


## Before submitting

- [ ] This PR fixes a typo or improves the docs (you can dismiss the other checks if that's the case).
- [ ] Did you make sure to update the documentation with your changes?
- [ ] Did you write any new necessary tests?
29 changes: 29 additions & 0 deletions .github/workflows/pre_commit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Pre-Commit Checks
permissions: read-all

on:
push:
branches:
- master
pull_request:
types:
- opened
- reopened
- synchronize
- ready_for_review
workflow_dispatch: # run on request (no need for PR)

jobs:
Code-Quality-Checks:
runs-on: ubuntu-20.04
steps:
- name: CHECKOUT REPOSITORY
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.10"
- name: Install dependencies
run: pip install 'model_api/python/.[full]'
- name: Run pre-commit checks
run: pre-commit run --all-files
70 changes: 35 additions & 35 deletions .github/workflows/test_accuracy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,38 +8,38 @@ jobs:
test_accuracy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: 3.9
cache: pip
- name: Create and start a virtual environment
run: |
python -m venv venv
source venv/bin/activate
- name: Install dependencies
run: |
source venv/bin/activate
python -m pip install --upgrade pip
pip install model_api/python/[tests] --extra-index-url https://download.pytorch.org/whl/cpu
- name: Prepare test data
run: |
source venv/bin/activate
python tests/python/accuracy/prepare_data.py -d data
- name: Run Python Test
run: |
source venv/bin/activate
pytest --data=./data tests/python/accuracy/test_accuracy.py
DATA=data pytest --data=./data tests/python/accuracy/test_YOLOv8.py
- name: Install CPP ependencies
run: |
sudo bash model_api/cpp/install_dependencies.sh
- name: Build CPP Test
run: |
mkdir build && cd build
cmake ../tests/cpp/accuracy/ -DCMAKE_CXX_FLAGS=-Werror
make -j
- name: Run CPP Test
run: |
build/test_accuracy -d data -p tests/python/accuracy/public_scope.json
DATA=data build/test_YOLOv8
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: 3.9
cache: pip
- name: Create and start a virtual environment
run: |
python -m venv venv
source venv/bin/activate
- name: Install dependencies
run: |
source venv/bin/activate
python -m pip install --upgrade pip
pip install model_api/python/[tests] --extra-index-url https://download.pytorch.org/whl/cpu
- name: Prepare test data
run: |
source venv/bin/activate
python tests/python/accuracy/prepare_data.py -d data
- name: Run Python Test
run: |
source venv/bin/activate
pytest --data=./data tests/python/accuracy/test_accuracy.py
DATA=data pytest --data=./data tests/python/accuracy/test_YOLOv8.py
- name: Install CPP ependencies
run: |
sudo bash model_api/cpp/install_dependencies.sh
- name: Build CPP Test
run: |
mkdir build && cd build
cmake ../tests/cpp/accuracy/ -DCMAKE_CXX_FLAGS=-Werror
make -j
- name: Run CPP Test
run: |
build/test_accuracy -d data -p tests/python/accuracy/public_scope.json
DATA=data build/test_YOLOv8
Loading
Loading