Skip to content

test googletest

test googletest #4

Workflow file for this run

name: C/C++ CI
on:
push:
branches: ["master"]
pull_request:
branches: ["master"]
jobs:
build_on_ubuntu_22_04:
runs-on: [ubuntu-22.04]
steps:
- name: "Checkout"
uses: actions/checkout@v4
- name: "Checkout capicxx-core-runtime"
uses: actions/checkout@v4
with:
repository: COVESA/capicxx-core-runtime
path: "capicxx-core-runtime"
- name: "Install dbus and googletest"
run: |
wget http://dbus.freedesktop.org/releases/dbus/dbus-1.13.6.tar.gz
tar -xzf dbus-1.13.6.tar.gz
for patch in src/dbus-patches/*.patch
do
patch -d dbus-1.13.6 -Np1 -i "$PWD/$patch" || continue
done
cmake -B build-dbus/libdbus -D DBUS_BUILD_TESTS=N -D CMAKE_INSTALL_PREFIX=install -S dbus-1.13.6/cmake
cmake --build build-dbus/libdbus
cmake --install build-dbus/libdbus --strip
- name: "Checkout googletest"
uses: actions/checkout@v4
with:
repository: google/googletest
ref: v1.14.0
path: "googletest"
- name: "Build capicxx-core-runtime"
run: |
cmake -S capicxx-core-runtime -B build-core-runtime -D CMAKE_INSTALL_PREFIX=install
cmake --build build-core-runtime --target install
- name: "Build capicxx-dbus-runtime"
run: |
cmake -S . -B build-dbus-runtime -D GTEST_ROOT=${{ runner.workspace }}/capicxx-dbus-runtime/googletest -D CMAKE_PREFIX_PATH=install -D CMAKE_INSTALL_PREFIX=install
cmake --build build-dbus-runtime --target build_tests
cmake --install build-dbus-runtime --strip
- name: "Run tests"
run: |
ls -l ${{ github.workspace }}/install/lib
export LD_LIBRARY_PATH=${{ github.workspace }}/install/lib
export COMMONAPI_CONFIG=${{ github.workspace }}/src/test/commonapi-dbus.ini
env -C build-dbus-runtime ctest -V
build_on_windows_latest:
runs-on: windows-latest
steps:
- name: "Checkout"
uses: actions/checkout@v4
- name: "Checkout capicxx-core-runtime"
uses: actions/checkout@v4
with:
repository: COVESA/capicxx-core-runtime
path: "capicxx-core-runtime"
- name: "Checkout googletest"
uses: actions/checkout@v4
with:
repository: google/googletest
ref: v1.14.0
path: "googletest"
- name: "Checkout dbus"
uses: actions/checkout@v4
with:
repository: dbus/dbus
path: "dbus"
- name: List directory contents
run: ls $env:GITHUB_WORKSPACE
- name: Verify googletest contents
run: ls $env:GITHUB_WORKSPACE/dbus