Skip to content

Update github actions/checkout to v3 #735

Update github actions/checkout to v3

Update github actions/checkout to v3 #735

Workflow file for this run

name: Code-coverage
# https://www.jeffgeerling.com/blog/2020/running-github-actions-workflow-on-schedule-and-other-events
on:
push:
pull_request:
schedule:
- cron: '0 2 * * SUN'
jobs:
build:
runs-on: ubuntu-latest
steps:
# https://github.com/marketplace/actions/cancel-workflow-action
- name: Cancel Previous Runs
uses: styfle/[email protected]
with:
access_token: ${{ github.token }}
- name: Checkout repository
uses: actions/checkout@v3
- name: Print system information
run: lscpu
- name: Print OS information
run: lsb_release -a
- name: Print compiler information
run: dpkg --list | grep compiler
- name: Install dependencies
run: sudo apt-get update && sudo apt-get install -y libx11-dev libdc1394-dev libv4l-dev liblapack-dev libopenblas-dev libeigen3-dev libopencv-dev nlohmann-json3-dev lcov gcovr
- name: Clone visp-images
env:
BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
# https://remarkablemark.org/blog/2022/09/25/check-git-branch-exists-in-remote-repository/
run: |
git clone --depth 1 https://github.com/lagadic/visp-images ${HOME}/visp-images
echo "VISP_INPUT_IMAGE_PATH=$HOME" >> $GITHUB_ENV
echo ${VISP_INPUT_IMAGE_PATH}
- name: Configure CMake
run: |
mkdir build
cd build
cmake .. -DCMAKE_BUILD_TYPE=Release -DBUILD_COVERAGE=ON -DBUILD_DEPRECATED_FUNCTIONS=OFF
cat ViSP-third-party.txt
- name: Compile
working-directory: build
run: make -j$(nproc)
# https://blog.ineat-group.com/2020/07/exploiter-votre-code-coverage-avec-codecov-io-flutter-tips-of-the-month-5/
- name: Run code coverage
working-directory: build
run: |
lcov --zerocounters --directory .
cmake --build . --target all -j$(nproc)
cmake --build . --target test -j$(nproc)
lcov --directory . --capture --output-file visp-coverage.info
lcov --remove visp-coverage.info \
'/usr/*' \
'*/private/*' \
'*/test/*' \
"/home/runner/work/visp/visp/3rdparty/*" \
"/home/runner/work/visp/visp/demo/*" \
"/home/runner/work/visp/visp/example/*" \
"/home/runner/work/visp/visp/samples/*" \
"/home/runner/work/visp/visp/modules/gui*" \
"/home/runner/work/visp/visp/modules/io/src/parallel-port*" \
"/home/runner/work/visp/visp/modules/robot*" \
"/home/runner/work/visp/visp/modules/sensor*" \
--output-file visp-coverage.cleaned
- name: Upload report to Codecov
uses: codecov/codecov-action@v2
with:
files: ./build/visp-coverage.cleaned
fail_ci_if_error: true
verbose: true