mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-05 23:41:44 +00:00
07147f4b7f
Bumps [actions/checkout](https://github.com/actions/checkout) from 2 to 5. - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](https://github.com/actions/checkout/compare/v2...v5) --- updated-dependencies: - dependency-name: actions/checkout dependency-version: '5' dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com>
206 lines
7.5 KiB
YAML
206 lines
7.5 KiB
YAML
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@v5
|
|
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
|
|
pip install pytest-xdist==3.8.0
|
|
|
|
- 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 \
|
|
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
|
|
# TODO: temporarily pointing to 1.2.19 to get notified by dependabot when 1.2.20 is released
|
|
# to update hardcoded references to commits in some other workflows.
|
|
# Then we can switch back to 1.2 in all actions.
|
|
uses: hendrikmuhs/ccache-action@v1.2.19
|
|
with:
|
|
key: ubuntu-22.04-${{ runner.arch }}
|
|
|
|
# RTTI is only enabled by default in Debug builds of rocksdb.
|
|
# Distros are using Release builds, so we're compiling it ourselves with RTTI forced on.
|
|
# https://github.com/facebook/rocksdb/blob/a3aa44a7167b8336f9bc15c8aba063260268ff68/CMakeLists.txt#L433
|
|
- 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
|
|
|
|
# OpenCOLLADA is ancient, but we still have it in the main build.
|
|
# So adding it to CI to catch any breakages.
|
|
- name: build OpenCOLLADA
|
|
run: |
|
|
git clone https://github.com/KhronosGroup/OpenCOLLADA
|
|
cd OpenCOLLADA
|
|
git checkout v1.6.68
|
|
patch -p1 --batch --forward -i ../nix/patches/opencollada/pr622_and_disable_subdirs.patch
|
|
patch -p1 --batch --forward -i ../nix/patches/opencollada/allow_static_libraries_config_on_unix.patch
|
|
mkdir build && cd build
|
|
cmake .. \
|
|
-DCMAKE_BUILD_TYPE=Release \
|
|
-DCMAKE_POLICY_VERSION_MINIMUM=3.5 \
|
|
-DCMAKE_C_COMPILER_LAUNCHER=ccache \
|
|
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
|
|
-DCMAKE_CXX_FLAGS_INIT="-fPIC"
|
|
sudo make -j$(nproc) install
|
|
|
|
# Ubuntu has `swig` package, but we build it to match the version we use in the main build.
|
|
# To avoid failing tests when checking stub generation.
|
|
- name: build swig
|
|
run: |
|
|
# Remove default swig to avoid conflicts.
|
|
sudo apt remove --purge swig swig4.0
|
|
sudo apt-get install -y libpcre2-dev bison
|
|
git clone https://github.com/swig/swig
|
|
cd swig
|
|
git checkout v4.1.0
|
|
mkdir build && cd build
|
|
cmake .. \
|
|
-DCMAKE_BUILD_TYPE=Release \
|
|
-DCMAKE_C_COMPILER_LAUNCHER=ccache \
|
|
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache
|
|
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 \
|
|
-DUSE_MMAP=On \
|
|
"-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: Run IfcConvert on Sample file
|
|
run: |
|
|
IfcConvert test/input/acad2010_walls.ifc test/input/acad2010_walls.obj
|
|
|
|
- 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-parallel || 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
|