-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added github workflow to build and run the tests in Ubuntu (#25)
* Added github workflow to build the project in Ubuntu * Run the tests in each CI run
- Loading branch information
1 parent
93accb7
commit 9d17aa4
Showing
1 changed file
with
60 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |