Update detector.cpp #46
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
############################################################################## | |
# | |
# GitGub CI workflow syntax spec: | |
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions | |
# | |
# CodeCov github action setup: | |
# https://github.com/codecov/codecov-action | |
# | |
# CodeCov badge setup: | |
# https://docs.codecov.com/docs/status-badges | |
# | |
# version 1.1 | |
############################################################################## | |
name: Run Unit Test and Upload Coverage Report | |
on: | |
push: | |
branches: [ "main" ] | |
pull_request: | |
branches: [ "main" ] | |
types: [opened] | |
workflow_dispatch: | |
jobs: | |
build-run-upload: | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Install build packages | |
run: | | |
sudo apt update | |
sudo apt install -y software-properties-common | |
sudo apt install -y doxygen lcov gcovr | |
- name: Install build dependencies | |
run: | | |
sudo apt-get update | |
sudo apt-get install build-essential cmake git libgtk2.0-dev pkg-config libavcodec-dev libavformat-dev libswscale-dev | |
- name: Set up OpenCV | |
id: opencv | |
run: | | |
echo "::set-output name=cache-key::opencv-4.5.0-cuda-off" | |
- name: Restore Cache | |
uses: actions/cache@v2 | |
with: | |
path: /home/runner/work/ENPM808X-Human-Detection-and-Tracking/ENPM808X-Human-Detection-and-Tracking/opencv/build | |
key: ${{ steps.opencv.outputs.cache-key }} | |
- name: Install OpenCV | |
run: | | |
git clone https://github.com/opencv/opencv.git | |
cd opencv | |
git checkout 4.5.0 | |
cd .. | |
git clone https://github.com/opencv/opencv_contrib.git | |
cd opencv_contrib | |
git checkout 4.5.0 | |
cd .. | |
cd opencv | |
mkdir build | |
cd build | |
cmake -D CMAKE_BUILD_TYPE=RELEASE \ | |
-D BUILD_EXAMPLES=OFF \ | |
-D BUILD_opencv_apps=OFF \ | |
-D OPENCV_EXTRA_MODULES_PATH=../../opencv_contrib/modules \ | |
-D BUILD_DOCS=OFF \ | |
-D BUILD_PERF_TESTS=OFF \ | |
-D BUILD_TESTS=OFF \ | |
-D WITH_CUDA=OFF \ | |
-D CMAKE_INSTALL_PREFIX=/usr/local .. | |
make | |
sudo make install | |
sudo sh -c 'echo "/usr/local/lib" >> /etc/ld.so.conf.d/opencv.conf' | |
sudo ldconfig | |
- name: Configure CMake flags and build executables | |
run: | | |
cmake -D WANT_COVERAGE=ON -D CMAKE_BUILD_TYPE=Debug -S ./ -B build/ | |
cmake --build build/ --clean-first --target all test_coverage | |
- name: Save Cache | |
uses: actions/cache@v2 | |
with: | |
path: /home/runner/work/ENPM808X-Human-Detection-and-Tracking/ENPM808X-Human-Detection-and-Tracking/opencv/build | |
key: ${{ steps.opencv.outputs.cache-key }} | |
- name: Upload coverage result to CodeCov | |
uses: codecov/codecov-action@v3 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
files: ${{github.workspace}}/build/test_coverage.info | |
fail_ci_if_error: true | |
verbose: true |