Add cleanup on Connection destruction #32
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
name: Test xapi-cpp | |
on: | |
push: | |
branches: [ "main" ] | |
pull_request: | |
branches: [ "main" ] | |
jobs: | |
build: | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu-22.04, ubuntu-24.04] | |
compiler: [g++, clang++] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set reusable strings | |
id: strings | |
shell: bash | |
run: | | |
echo "build-output-dir=${{ github.workspace }}/build" >> "$GITHUB_OUTPUT" | |
- name: Install dependencies | |
run: | | |
sudo apt-get update | |
if [ ${{ matrix.os }} == 'ubuntu-22.04' ]; then | |
sudo add-apt-repository ppa:mhier/libboost-latest -y | |
fi | |
sudo apt install libboost-system1.83-dev | |
sudo apt install libboost-url1.83-dev | |
sudo apt install libboost-json1.83-dev | |
sudo apt install libssl-dev libgtest-dev | |
- name: Configure CMake | |
run: > | |
cmake -B ${{ steps.strings.outputs.build-output-dir }} \ | |
-DCMAKE_CXX_COMPILER=${{ matrix.compiler }} \ | |
-DBUILD_TESTS=ON \ | |
-S ${{ github.workspace }} | |
- name: Build unit tests | |
run: cmake --build ${{ steps.strings.outputs.build-output-dir }} | |
- name: Run unit tests | |
run: | | |
cd ${{ steps.strings.outputs.build-output-dir }} | |
./test/tests | |
- name: Install Xapi library | |
run: sudo cmake --install ${{ steps.strings.outputs.build-output-dir }} | |
- name: Compile examples | |
run: | | |
cd ${{ github.workspace }}/examples | |
mkdir build | |
cmake -B ${{ github.workspace }}/examples/build \ | |
-DCMAKE_CXX_COMPILER=${{ matrix.compiler }} \ | |
-S ${{ github.workspace }}/examples | |
cmake --build ${{ github.workspace }}/examples/build | |