name: ci on: push: paths: - 'src/ifcblender/**' - 'src/ifcconvert/**' - 'src/ifcgeom/**' - 'src/ifcgeom_schema_agnostic/**' - 'src/ifcgeomserver/**' - 'src/ifcjni/**' - 'src/ifcmax/**' - 'src/ifcopenshell-python/**' - '!src/ifcopenshell-python/docs/**' - 'src/ifcparse/**' - 'src/ifcwrap/**' - 'src/qtviewer/**' - 'src/svgfill/**' - 'src/serializers/**' - 'conda/**' - 'cmake/**' - '.github/workflows/ci.yml' pull_request: jobs: activate: runs-on: ubuntu-22.04 if: | github.repository == 'IfcOpenShell/IfcOpenShell' && !contains(github.event.head_commit.message, 'skip ci') steps: - run: echo ok go compile-and-test: runs-on: ubuntu-22.04 needs: activate steps: - uses: actions/checkout@v4 with: submodules: recursive - name: Set up Python uses: actions/setup-python@v5 with: python-version: 3.11 - name: Install dependencies run: | python -m pip install --upgrade pip pip install xmlschema xsdata numpy lxml pytest isodate lark networkx tabulate python-dateutil shapely pip install src/bcf --no-deps pip install git+https://github.com/zdhoward/aud - name: Install C++ dependencies run: | sudo apt update sudo apt-get install --no-install-recommends \ git cmake gcc g++ \ libboost-date-time-dev \ libboost-filesystem-dev \ libboost-iostreams-dev \ libboost-program-options-dev \ libboost-regex-dev \ libboost-system-dev \ libboost-thread-dev \ swig libpcre3-dev libxml2-dev \ libtbb-dev nlohmann-json3-dev \ libocct-foundation-dev libocct-modeling-algorithms-dev libocct-modeling-data-dev libocct-ocaf-dev libocct-visualization-dev libocct-data-exchange-dev \ libhdf5-dev libcgal-dev libeigen3-dev - name: ccache uses: hendrikmuhs/ccache-action@v1.2 with: key: ubuntu-22.04-${{ runner.arch }} # rocksdb on debian distros misses RTTI? - name: build rocksdb run: | git clone https://github.com/facebook/rocksdb --branch v9.11.2 cd rocksdb mkdir build && cd build # rocksdb is using ccache automatically. cmake -DFAIL_ON_WARNINGS=Off \ -DCMAKE_BUILD_TYPE=Release \ -DCMAKE_INSTALL_PREFIX=/usr/local \ -DWITH_TESTS=OFF \ -DWITH_TOOLS=OFF \ -DWITH_GFLAGS=OFF \ -DWITH_BENCHMARK_TOOLS=OFF \ -DWITH_CORE_TOOLS=OFF \ -DROCKSDB_BUILD_SHARED=Off \ -DCMAKE_POSITION_INDEPENDENT_CODE=On \ -DUSE_RTTI=On \ .. sudo make -j$(nproc) install - name: Build ifcopenshell run: | echo $Python3_ROOT_DIR echo ${{ env.pythonLocation }} mkdir build && cd build # Ubuntu 22.04's libocct-foundation-dev package doesn't have Config.cmake, so we provide OCC paths directly. # In later versions of Ubuntu, this can be simplified and the OCC paths can be removed. cmake \ -DCMAKE_CXX_STANDARD=17 \ -DCMAKE_BUILD_TYPE=Release \ -DCMAKE_PREFIX_PATH=/usr \ -DCMAKE_SYSTEM_PREFIX_PATH=/usr \ -DOCC_INCLUDE_DIR=/usr/include/opencascade \ -DOCC_LIBRARY_DIR=/usr/lib/x86_64-linux-gnu \ -DPYTHON_EXECUTABLE:FILEPATH=${{ env.pythonLocation }}/bin/python \ -DPYTHON_INCLUDE_DIR:PATH=${{ env.pythonLocation }}/include/python3.11 \ -DPYTHON_LIBRARY:FILEPATH=${{ env.pythonLocation }}/lib/libpython3.11.so \ -DCOLLADA_SUPPORT=Off \ "-DSCHEMA_VERSIONS=2x3;4;4x3_add2" \ -DGLTF_SUPPORT=On \ -DWITH_ROCKSDB=On \ ../cmake sudo make -j $(nproc) sudo make install - name: Run IfcConvert on Sample files run: | (find test/input src/bonsai/test/files -name '*.ifc' | while read i; do \ echo $i | tee -a log; \ timeout 1m "$(which IfcConvert)" -yv "$i" "$i.obj" --validate >> log 2>&1; \ echo $i $? >> statuses; \ done) || true echo Failed grep -v 0$ statuses grep -v 0$ statuses | wc -l echo Succeeded grep 0$ statuses grep 0$ statuses | wc -l - name: Test ifcopenshell-python run: | cd test python tests.py cd ../src/ifcopenshell-python mv ifcopenshell ifcopenshell-local # Force testing on installed module pip install -e ../ifcpatch --no-deps # Needed for sql.py tests. ERROR=0 make test || ERROR=1 cd ../bcf && make test || ERROR=1 pip install requests cd ../bsdd && make test || ERROR=1 pip install deepdiff cd ../ifcdiff && make test || ERROR=1 cd ../ifcpatch && make test || ERROR=1 pip install -e ../ifctester --no-deps cd ../ifctester && make test || ERROR=1 # Run mathutils related tests at the end to ensure no other code is relying on mathutils. cd ../ifcopenshell-python pip install mathutils make test-mathutils || ERROR=1 if [ $ERROR -ne 0 ]; then echo "One or more tests failed"; exit 1; fi