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