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

Run Unit and BenchMark tests #699

Merged
merged 1 commit into from
May 16, 2024
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
86 changes: 46 additions & 40 deletions .github/workflows/c-cpp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,61 +2,67 @@ name: C/C++ CI

on:
push:
branches: [ master ]
branches: [master]
pull_request:
branches: [ master ]
branches: [master]

jobs:
build_on_ubuntu_boost_183_gcc_x86:
runs-on: ubuntu-latest
steps:
- name: Ubuntu - Install boost 1.83.0 with gcc and x86
uses: MarkusJx/[email protected]
id: ubuntu-gcc-1_83-x86
with:
boost_version: 1.83.0
platform_version: 20.04
boost_install_dir: /home/runner
toolset: gcc
arch: x86
cache: true

- uses: actions/checkout@v3

- name: install dependencies
run: |
sudo apt-get update -qq
sudo apt-get install -y googletest asciidoc source-highlight doxygen graphviz
- name: Run CMake config
run: cmake -Bbuild -DBOOST_ROOT=/home/runner/boost/boost/ -DGTEST_ROOT=/usr/src/googletest/googletest/ -DCMAKE_INSTALL_PREFIX=${{ runner.workspace }}/install .

- name: Build CMake
run: cmake --build build -t all build_tests doc install

- uses: actions/upload-artifact@v2
with:
name: vsomeip
path: '${{ runner.workspace }}/install/**/*'
- name: Ubuntu - Install boost 1.83.0 with gcc and x86
uses: MarkusJx/[email protected]
id: ubuntu-gcc-1_83-x86
with:
boost_version: 1.83.0
platform_version: 20.04
boost_install_dir: /home/runner
toolset: gcc
arch: x86
cache: true

- uses: actions/checkout@v4

- name: install dependencies
run: |
sudo apt-get update -qq
sudo apt-get install -y googletest asciidoc source-highlight doxygen graphviz libbenchmark-dev
- name: Run CMake config
run: cmake -Bbuild -DBOOST_ROOT=/home/runner/boost/boost/ -DGTEST_ROOT=/usr/src/googletest

- name: Build CMake
run: cmake --build build --target build_tests

- name: Run Unit tests
run: ctest --test-dir build --tests-regex '^unit_' --verbose

- name: Run BenchMark tests
run: env -C build test/benchmark_tests/benchmark_tests_bin

- uses: actions/upload-artifact@v4
with:
name: vsomeip
path: "${{ runner.workspace }}/install/**/*"

build_on_windows_boost_183_gcc_x86:
runs-on: windows-latest
steps:
- name: Windows - Install boost 1.83.0 with gcc and x86
uses: MarkusJx/[email protected]
id: windows-gcc-1_83-x86
with:
- name: Windows - Install boost 1.83.0 with gcc and x86
uses: MarkusJx/[email protected]
id: windows-gcc-1_83-x86
with:
boost_version: 1.83.0
platform: windows
boost_install_dir: C:\runner
toolset: msvc
arch: x86
cache: true

- uses: actions/checkout@v3

- name: Run CMake
run: cmake -Bbuild -D BOOST_ROOT=C:\runner\boost/boost\ .
- uses: actions/checkout@v4

- name: Run CMake
run: cmake -Bbuild -D BOOST_ROOT=C:\runner\boost/boost\ .

- name: Build CMake
run: cmake --build build
- name: Build CMake
run: cmake --build build
2 changes: 2 additions & 0 deletions test/unit_tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,7 @@ target_link_libraries (
gtest
vsomeip_utilities
)
enable_testing()
add_test(NAME ${PROJECT_NAME} COMMAND $<TARGET_FILE:${PROJECT_NAME}> WORKING_DIRECTORY ${CMAKE_BINARY_DIR})

add_dependencies(build_unit_tests ${PROJECT_NAME})
Loading