Skip to content

Commit

Permalink
new(ci): run tests for emscripten build
Browse files Browse the repository at this point in the history
Signed-off-by: rohith-raju <rohithraju488@gmail.com>
Co-authored-by: Jason Dellaluce <jasondellaluce@gmail.com>
  • Loading branch information
Rohith-Raju and jasondellaluce committed Jun 20, 2023
1 parent 201671b commit a003251
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 6 deletions.
24 changes: 24 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
5 changes: 0 additions & 5 deletions userspace/libsinsp/examples/test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 <emscripten/bind.h>
#include <cstdlib>
#include <iostream>
#include <chrono>
Expand Down Expand Up @@ -578,7 +577,3 @@ void json_dump(sinsp& inspector)

cout << output << std::endl;
}

EMSCRIPTEN_BINDINGS(my_module){
emscripten::function("usage", &usage);
}
2 changes: 1 addition & 1 deletion userspace/libsinsp/sinsp.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ limitations under the License.

#include "capture_stats_source.h"

#if !defined(_WIN32) && !defined(__EMSCRIPTEN__)
#if !defined(__EMSCRIPTEN__)
#include "tbb/concurrent_queue.h"
#endif

Expand Down

0 comments on commit a003251

Please sign in to comment.