Skip to content

Update test_detector.cpp #48

Update test_detector.cpp

Update test_detector.cpp #48

##############################################################################
#
# 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: 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
if: success() # Save the cache only if the previous steps were successful
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