From 7c44ca24cb906c2a1ecd17cb2110c439269a8512 Mon Sep 17 00:00:00 2001 From: Kwabena N Amponsah Date: Tue, 19 Mar 2024 11:29:31 +0000 Subject: [PATCH] #20 test built module --- .github/workflows/build-and-test.yml | 34 ++++++++++++++++++++++++++-- 1 file changed, 32 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index 9a035be..d913c72 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -22,12 +22,17 @@ jobs: - name: Checkout uses: actions/checkout@v4 + - name: Install build dependencies + run: | + sudo apt-get update + sudo apt-get install cmake + - name: Setup Python ${{ matrix.python-version }} uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} - - name: Install dependencies + - name: Install pip dependencies run: | python -m pip install --upgrade pip pip install pyyaml pygccxml castxml @@ -36,5 +41,30 @@ jobs: run: | echo "PYTHONPATH=${{ github.workspace }}/cppwg:$PYTHONPATH" >> ${GITHUB_ENV} - - name: Run tests + - name: Test wrapper generation run: python -m unittest tests/test_shapes.py + + - name: Generate new wrappers + run: | + rm -rf shapes/wrapper/geometry \ + shapes/wrapper/math_funcs \ + shapes/wrapper/primitives + python shapes/wrapper/generate.py \ + --source_root shapes/src/ \ + --wrapper_root shapes/wrapper/ \ + --castxml_binary $(which castxml) \ + --package_info shapes/wrapper/package_info.yaml \ + --includes shapes/src/ + + - name: Build Python module + run: | + cd shapes + mkdir build + cd build + cmake .. + make -j $(nproc) + + - name: Test built module + run: | + python -m unittest test_functions.py + python -m unittest test_classes.py