From cc4d0c7a4fd8cf7f7250434d16597019a2528d53 Mon Sep 17 00:00:00 2001 From: CyrilWaechter Date: Mon, 14 Sep 2026 19:29:12 +0200 Subject: [PATCH] Add Bonsai tests to pull requests Bonsai tests currently only run after merge (ci-bonsai-daily on push to v0.9.0), so pull requests that touch src/bonsai are not tested until it is too late. Add a pull_request-triggered workflow that installs a working Bonsai/ifcopenshell from the public unstable repo and runs the Bonsai tool test suite against the PR source. Kept non-required initially because the suite has pre-existing failures unrelated to this change. Generated with the assistance of an AI coding tool. --- .github/workflows/ci-bonsai-pr.yml | 58 ++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 .github/workflows/ci-bonsai-pr.yml diff --git a/.github/workflows/ci-bonsai-pr.yml b/.github/workflows/ci-bonsai-pr.yml new file mode 100644 index 0000000000..b2e29add7a --- /dev/null +++ b/.github/workflows/ci-bonsai-pr.yml @@ -0,0 +1,58 @@ +# This file was generated with the assistance of an AI coding tool. +name: ci-bonsai-pr + +on: + pull_request: + paths: + - 'src/bonsai/**' + - '.github/workflows/ci-bonsai-pr.yml' + workflow_dispatch: + +jobs: + bonsai-tests: + runs-on: ubuntu-latest + steps: + - name: Checkout IfcOpenShell + uses: actions/checkout@v7 + + # The unstable repo provides a working Bonsai/ifcopenshell install; the + # tests themselves run against the source tree of this pull request. + - name: Checkout Bonsai unstable repo + uses: actions/checkout@v7 + with: + repository: IfcOpenShell/bonsai_unstable_repo + path: bonsai_unstable_repo + + - name: Download Blender + run: | + wget -q -O blender.tar.xz https://download.blender.org/release/Blender5.2/blender-5.2.0-linux-x64.tar.xz + tar -xf blender.tar.xz + + - name: Install Bonsai + run: | + set -x -e + BLENDER_PATH=$(find blender-*/ -maxdepth 0 -exec readlink -f {} \;) + export PATH="$PATH:$BLENDER_PATH" + blender --version + + cd bonsai_unstable_repo + pip install -r requirements.txt + python setup_extensions_repo.py --last-tag + cd .. + bonsai_zip="$(pwd)/$(ls bonsai_unstable_repo/bonsai_py313*-linux-x64.zip)" + + blender --command extension install-file -r user_default -e $bonsai_zip + blender --command extension list + + - name: Run Bonsai tests + run: | + set -x -e + BLENDER_PATH=$(find blender-*/ -maxdepth 0 -exec readlink -f {} \;) + export PATH="$PATH:$BLENDER_PATH" + blender --version + + cd src/bonsai + pip install -r requirements-dev.txt + blender --background --python-exit-code 1 --python scripts/setup_pytest.py + blender --python-exit-code 1 --python-expr "import bonsai; print(bonsai.bbim_semver); import ifcopenshell; print(ifcopenshell.version)" --background + make test-tool