Skip to content

Commit

Permalink
Added github workflow to build and run the tests in Ubuntu (#25)
Browse files Browse the repository at this point in the history
* Added github workflow to build the project in Ubuntu

* Run the tests in each CI run
  • Loading branch information
goncaloalmeida authored Nov 13, 2023
1 parent 93accb7 commit 9d17aa4
Showing 1 changed file with 60 additions and 0 deletions.
60 changes: 60 additions & 0 deletions .github/workflows/makefile.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: C/C++ CI

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

jobs:
build:
runs-on: [ubuntu-22.04]

steps:
- name: "Checkout"
uses: actions/checkout@v3

- name: "Checkout capicxx-core-runtime"
uses: actions/checkout@v3
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
sudo apt-get install libgtest-dev
cd /usr/src/gtest
sudo cmake CMakeLists.txt
sudo make
sudo cp lib/*.a /usr/lib
sudo ln -s /usr/lib/libgtest.a /usr/local/lib/libgtest.a
sudo ln -s /usr/lib/libgtest_main.a /usr/local/lib/libgtest_main.a
- 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=/usr/src/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

0 comments on commit 9d17aa4

Please sign in to comment.