diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 867d5cc..4f3484e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -23,6 +23,26 @@ jobs: sudo apt-get update sudo apt-get install -y cmake libnetfilter-queue-dev libmnl-dev libnetfilter-conntrack-dev + - name: Build and install libubox + run: | + git clone https://github.com/openwrt/libubox.git + cd libubus + mkdir build + cd build + cmake .. -DBUILD_LUA=OFF -DBUILD_EXAMPLES=OFF + make + sudo make install + + - name: Build and install libuci + run: | + git clone https://github.com/openwrt/uci.git + cd uci + mkdir build + cd build + cmake .. -DBUILD_LUA=OFF + make + sudo make install + - name: Run unit tests run: | cmake -S . -B build -DUA2F_BUILD_TESTS=ON diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index d384c1d..ead75b4 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -38,6 +38,25 @@ jobs: sudo apt-get update sudo apt-get install -y cmake libnetfilter-queue-dev libmnl-dev libnetfilter-conntrack-dev + - name: Build and install libubox + run: | + git clone https://github.com/openwrt/libubox.git + cd libubus + mkdir build + cd build + cmake .. -DBUILD_LUA=OFF -DBUILD_EXAMPLES=OFF + make + sudo make instal + - name: Build and install libuci + run: | + git clone https://github.com/openwrt/uci.git + cd uci + mkdir build + cd build + cmake .. -DBUILD_LUA=OFF + make + sudo make install + - name: Autobuild uses: github/codeql-action/autobuild@v2 diff --git a/CMakeLists.txt b/CMakeLists.txt index 8bdf4b0..fc76170 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -3,6 +3,8 @@ project(UA2F LANGUAGES C CXX) set(CMAKE_C_STANDARD 17) +OPTION(UA2F_BUILD_TESTS "Build tests" OFF) + find_package(Git) if(GIT_FOUND) execute_process(