From 3254f87b419e68862693e90ac5a3269202e5cee1 Mon Sep 17 00:00:00 2001 From: rohith-raju Date: Tue, 20 Jun 2023 13:46:54 +0000 Subject: [PATCH] new(ci): run tests for emscripten build Signed-off-by: rohith-raju Co-authored-by: Jason Dellaluce --- .github/workflows/ci.yml | 24 ++++++++++++++++++++++++ userspace/libsinsp/examples/test.cpp | 5 ----- 2 files changed, 24 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 83382bcb1ca..0a33e479db8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -383,3 +383,27 @@ jobs: name: ${{ matrix.name }}_report path: | ${{ github.workspace }}/build/report/ + + build-libs-emscripten: + name: build-libs-emscripten 🧐 + runs-on: ubuntu-latest + steps: + - name: Install deps ⛓️ + run: | + sudo apt update + sudo apt install -y --no-install-recommends ca-certificates cmake build-essential clang-14 llvm-14 git pkg-config autoconf automake libtool libelf-dev libcap-dev linux-headers-$(uname -r) emscripten + + - name: Checkout Libs ⤵️ + uses: actions/checkout@v3 + with: + fetch-depth: 0 + + - name: Git safe directory + run: | + git config --global --add safe.directory $GITHUB_WORKSPACE + + - name: Build and test 🏗️🧪 + run: | + mkdir -p build + cd build && emcmake cmake -DUSE_BUNDLED_DEPS=True ../ + KERNELDIR=/lib/modules/$(ls /lib/modules)/build emmake make run-unit-tests -j4 \ No newline at end of file diff --git a/userspace/libsinsp/examples/test.cpp b/userspace/libsinsp/examples/test.cpp index 2706eece690..4def6b05a8a 100644 --- a/userspace/libsinsp/examples/test.cpp +++ b/userspace/libsinsp/examples/test.cpp @@ -13,7 +13,6 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include #include #include #include @@ -578,7 +577,3 @@ void json_dump(sinsp& inspector) cout << output << std::endl; } - -EMSCRIPTEN_BINDINGS(my_module){ - emscripten::function("usage", &usage); -} \ No newline at end of file