Image references now pointing to online resources, not relative repo … #4
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# SPDX-FileCopyrightText: 2025 Ivan Perevala <[email protected]> | |
# | |
# SPDX-License-Identifier: GPL-3.0-or-later | |
name: Blender 4.2.0 | |
description: | | |
This workflow tests the Blender extension for multiple camera rendering. | |
on: | |
push: | |
branches: [main] | |
pull_request: | |
branches: [main] | |
jobs: | |
test-addon: | |
runs-on: ubuntu-latest | |
env: | |
BLENDER_VERSION: "4.2.0" | |
BLENDER_DIR: "${{ github.workspace }}/blender" | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Cache Blender | |
id: cache-blender | |
uses: actions/cache@v4 | |
with: | |
path: ${{ env.BLENDER_DIR }} | |
key: blender-${{ env.BLENDER_VERSION }} | |
- name: Download Blender if not cached | |
if: steps.cache-blender.outputs.cache-hit != 'true' | |
run: | | |
BLENDER_MAJOR_MINOR=$(echo "${{ env.BLENDER_VERSION }}" | cut -d. -f1,2) | |
DOWNLOAD_URL="https://download.blender.org/release/Blender${BLENDER_MAJOR_MINOR}/blender-${{ env.BLENDER_VERSION }}-linux-x64.tar.xz" | |
mkdir -p "${{ env.BLENDER_DIR }}" | |
wget -qO- "${DOWNLOAD_URL}" | tar -xJ --strip-components=1 -C "${{ env.BLENDER_DIR }}" | |
- name: Download wheels to build Blender extension | |
run: | | |
PYTHON_BIN=$(find "${{ env.BLENDER_DIR }}" -type f -name "python3*" | head -n 1) | |
"${PYTHON_BIN}" -m pip download -r requirements-dev.txt --dest "src/multiple_camera_render/wheels" | |
- name: Build and install Blender extension | |
run: | | |
mkdir -p "${{ github.workspace }}/dist" | |
${{ env.BLENDER_DIR }}/blender --command extension build --source-dir="${{ github.workspace }}/src/multiple_camera_render" --output-dir="${{ github.workspace }}/dist" | |
echo "Blender extension built successfully." | |
EXTENSION_ZIP=$(find "${{ github.workspace }}/dist" -type f -name "*.zip" | head -n 1) | |
echo "Extension zip file: ${EXTENSION_ZIP}" | |
"${{ env.BLENDER_DIR }}/blender" --command extension install-file --repo user_default --enable "${EXTENSION_ZIP}" | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install pytest | |
- name: Run tests | |
run: | | |
pytest -s -v --blender="${{ env.BLENDER_DIR }}/blender" --background-only |