Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improving CI pipeline with more steps #64

Merged
merged 41 commits into from
Feb 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
71d4872
clang-format-lint build
BAILOOL Jan 25, 2024
b2e954c
cppcheck build step
BAILOOL Jan 27, 2024
4d114a4
fixing yaml
BAILOOL Jan 27, 2024
38001a8
docker volume mapping checking
BAILOOL Jan 27, 2024
1d7a81f
docker volume mapping checking
BAILOOL Jan 27, 2024
ca32e2b
docker volume mapping checking
BAILOOL Jan 27, 2024
1ad9394
docker volume mapping checking
BAILOOL Jan 27, 2024
df1ab07
cppcheck fix
BAILOOL Jan 27, 2024
a579c95
adding names to steps
BAILOOL Jan 27, 2024
3c63903
clang-tidy build step
BAILOOL Jan 27, 2024
22f6cfe
cppcheck add header files
BAILOOL Jan 27, 2024
5459c77
Adding unit-tests-with-sanitizers build step
BAILOOL Jan 29, 2024
3b84dd3
WIP checkout unit test data
BAILOOL Feb 3, 2024
2910599
WIP checkout unit test data
BAILOOL Feb 3, 2024
b297303
wip
BAILOOL Feb 3, 2024
04fd1c4
wip
BAILOOL Feb 3, 2024
c7e4fc6
wip
BAILOOL Feb 3, 2024
d2ca524
wip
BAILOOL Feb 3, 2024
f72c20e
wip
BAILOOL Feb 3, 2024
d2e4517
wip
BAILOOL Feb 3, 2024
4682f64
wip
BAILOOL Feb 3, 2024
7c04fd5
wip
BAILOOL Feb 3, 2024
1d15b0f
wip
BAILOOL Feb 3, 2024
1f1826d
wip
BAILOOL Feb 3, 2024
6942c83
wip
BAILOOL Feb 3, 2024
73b5b79
wip
BAILOOL Feb 3, 2024
2457ffc
wip
BAILOOL Feb 3, 2024
e5d7d9d
wip
BAILOOL Feb 3, 2024
85ed6c6
wip
BAILOOL Feb 3, 2024
bf6c367
wip
BAILOOL Feb 3, 2024
04c7509
wip
BAILOOL Feb 3, 2024
3715011
wip
BAILOOL Feb 3, 2024
1b4032e
wip
BAILOOL Feb 3, 2024
8766c78
Compressed data with GNU tar
BAILOOL Feb 3, 2024
757ffdc
Fixing image path compile error
BAILOOL Feb 3, 2024
ecc00ce
Fixing image path compile error
BAILOOL Feb 3, 2024
8baf6da
Adding valgrind step
BAILOOL Feb 3, 2024
b8f6251
Enabling all builds
BAILOOL Feb 3, 2024
be7ab5b
Testing conditional workflow
BAILOOL Feb 4, 2024
eb2f873
Disable address sanitizer and add build to run tests in release mode
BAILOOL Feb 4, 2024
3c32be7
Fixing clang-format-lint
BAILOOL Feb 4, 2024
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
169 changes: 156 additions & 13 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# This is a basic workflow to help you get started with Actions

name: CI

# Controls when the action will run.
Expand All @@ -9,23 +7,168 @@ on:
branches: [ master ]
pull_request:
branches: [ master ]
types:
- opened
- reopened
- synchronize
- ready_for_review

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
clang-format-lint:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2 # required to mount the Github Workspace to a volume

- name: Run clang-format-lint
uses: DoozyX/[email protected]
with:
source: '.'
exclude: './third_party ./external .git'
extensions: 'h,cpp'
clangFormatVersion: 11


cppcheck:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Run cppcheck
uses: addnab/docker-run-action@v3
with:
image: bailool/mc-calib-dev:latest
options: -v ${{ github.workspace }}:/home/MC-Calib
run: |
cppcheck MC-Calib/McCalib/include
cppcheck MC-Calib/McCalib/src


clang-tidy:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2

# Steps represent a sequence of tasks that will be executed as part of the job
- name: Run clang-tidy
uses: addnab/docker-run-action@v3
with:
image: bailool/mc-calib-dev:latest
options: -v ${{ github.workspace }}:/home/MC-Calib
run: |
mkdir MC-Calib/build && cd MC-Calib/build
cmake -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DCMAKE_BUILD_TYPE=Debug ..
run-clang-tidy


unit-tests-with-sanitizers:
if: ${{ false }} # TODO: disable for now until understand how to suppress leaks from external libraries like OpenCV
runs-on: ubuntu-latest
needs:
- clang-format-lint
- cppcheck
- clang-tidy
steps:
- uses: actions/checkout@v2
- uses: DoozyX/[email protected]
with:
source: '.'
exclude: './third_party ./external .git'
extensions: 'h,cpp'
clangFormatVersion: 11
- name: Checkout
uses: actions/checkout@v2

- name: Checkout MC-Calib-data
uses: actions/checkout@v4
with:
repository: BAILOOL/MC-Calib-data
path: ${{ github.workspace }}/data
lfs: 'true'

- name: Unzip MC-Calib-data
run: tar xf ${{ github.workspace }}/data/Blender_Images.tar.gz -C ${{ github.workspace }}/data

- name: Run tests
uses: addnab/docker-run-action@v3
with:
image: bailool/mc-calib-dev:latest
options: -v ${{ github.workspace }}:/home/MC-Calib
run: |
mkdir MC-Calib/build && cd MC-Calib/build
cmake -DCMAKE_BUILD_TYPE=Debug -DUSE_SANITIZERS=ON ..
make -j4
./tests/boost_tests_run


unit-tests-with-valgrind:
runs-on: ubuntu-latest
needs:
- clang-format-lint
- cppcheck
- clang-tidy
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Checkout MC-Calib-data
uses: actions/checkout@v4
with:
repository: BAILOOL/MC-Calib-data
path: ${{ github.workspace }}/data
lfs: 'true'

- name: Unzip MC-Calib-data
run: tar xf ${{ github.workspace }}/data/Blender_Images.tar.gz -C ${{ github.workspace }}/data

- name: Run tests
uses: addnab/docker-run-action@v3
with:
image: bailool/mc-calib-dev:latest
options: -v ${{ github.workspace }}:/home/MC-Calib
run: |
mkdir MC-Calib/build && cd MC-Calib/build
cmake -DCMAKE_BUILD_TYPE=Debug -DUSE_SANITIZERS=OFF ..
make -j4
valgrind --leak-check=full \
--leak-check=full \
--track-origins=yes \
--show-reachable=yes \
--error-limit=no \
--gen-suppressions=all \
--verbose \
--log-file=valgrind-out.txt \
--suppressions=../tests/valgrind_suppress/opencv_valgrind.supp \
--suppressions=../tests/valgrind_suppress/opencv_valgrind_3rdparty.supp \
--suppressions=../tests/valgrind_suppress/boost_valgrind.supp \
./apps/calibrate/calibrate ../tests/configs_for_end2end_tests/calib_param_synth_Scenario1.yml


unit-tests-in-release-mode:
runs-on: ubuntu-latest
needs:
- clang-format-lint
- cppcheck
- clang-tidy
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Checkout MC-Calib-data
uses: actions/checkout@v4
with:
repository: BAILOOL/MC-Calib-data
path: ${{ github.workspace }}/data
lfs: 'true'

- name: Unzip MC-Calib-data
run: tar xf ${{ github.workspace }}/data/Blender_Images.tar.gz -C ${{ github.workspace }}/data

- name: Run tests
uses: addnab/docker-run-action@v3
with:
image: bailool/mc-calib-prod:latest
options: -v ${{ github.workspace }}:/home/MC-Calib
run: |
mkdir MC-Calib/build && cd MC-Calib/build
cmake -DCMAKE_BUILD_TYPE=Release ..
make -j4
./tests/boost_tests_run
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ add_compile_options(-Wall -Wextra -Wpedantic -Werror)

if(USE_SANITIZERS)
# sanitizers https://www.jetbrains.com/help/clion/google-sanitizers.html#Configuration
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS_DEBUG} -fsanitize=address,leak")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS_DEBUG} -fsanitize=address")
endif()

include_directories(
Expand Down
10 changes: 9 additions & 1 deletion McCalib/src/McCalib.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,10 @@ void Calibration::detectBoardsWithCamera(const std::vector<cv::String> &fn,
std::size_t num_frames = fn.size();
if (num_frames > 0u) {
cv::Mat image = cv::imread(fn[0]);
if (image.empty()) {
LOG_ERROR << "Could not read the image :: " << fn[0];
assert((!image.empty()) && "Calibration cannot be done");
}
cams_[cam_idx]->im_cols_ = image.cols;
cams_[cam_idx]->im_rows_ = image.rows;
}
Expand Down Expand Up @@ -278,12 +282,16 @@ void Calibration::detectBoardsInImageWithCamera(const std::string frame_path,
const int cam_idx,
const int frame_idx) {
cv::Mat image = cv::imread(frame_path);
if (image.empty()) {
LOG_ERROR << "Could not read the image :: " << frame_path;
return;
}

// Greyscale image for subpixel refinement
cv::Mat graymat;
cv::cvtColor(image, graymat, cv::COLOR_BGR2GRAY);

// Datastructure to save the checkerboard corners

// key == board id, value == markersIDs on MARKERS markerIds
std::map<int, std::vector<int>> marker_idx;
// key == board id, value == 2d points visualized on MARKERS
Expand Down
Empty file added data/.gitkeep
Empty file.
Loading