mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-21 08:35:14 +00:00
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.
This commit is contained in:
@@ -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
|
||||
Reference in New Issue
Block a user