Skip to content

Commit c7d0873

Browse files
committed
Separated blender tests per version
1 parent a29e5ec commit c7d0873

File tree

3 files changed

+133
-1
lines changed

3 files changed

+133
-1
lines changed
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
# SPDX-FileCopyrightText: 2025 Ivan Perevala <[email protected]>
2+
#
3+
# SPDX-License-Identifier: GPL-3.0-or-later
4+
5+
name: Blender 4.3.0
6+
description: |
7+
This workflow tests the Blender extension for multiple camera rendering.
8+
9+
on:
10+
push:
11+
branches: [main]
12+
pull_request:
13+
branches: [main]
14+
15+
jobs:
16+
test-addon:
17+
runs-on: ubuntu-latest
18+
19+
env:
20+
BLENDER_VERSION: "4.3.0"
21+
BLENDER_DIR: "${{ github.workspace }}/blender"
22+
23+
steps:
24+
- name: Checkout repository
25+
uses: actions/checkout@v4
26+
27+
- name: Cache Blender
28+
id: cache-blender
29+
uses: actions/cache@v4
30+
with:
31+
path: ${{ env.BLENDER_DIR }}
32+
key: blender-${{ env.BLENDER_VERSION }}
33+
34+
- name: Download Blender if not cached
35+
if: steps.cache-blender.outputs.cache-hit != 'true'
36+
run: |
37+
BLENDER_MAJOR_MINOR=$(echo "${{ env.BLENDER_VERSION }}" | cut -d. -f1,2)
38+
DOWNLOAD_URL="https://download.blender.org/release/Blender${BLENDER_MAJOR_MINOR}/blender-${{ env.BLENDER_VERSION }}-linux-x64.tar.xz"
39+
40+
mkdir -p "${{ env.BLENDER_DIR }}"
41+
wget -qO- "${DOWNLOAD_URL}" | tar -xJ --strip-components=1 -C "${{ env.BLENDER_DIR }}"
42+
43+
- name: Download wheels to build Blender extension
44+
run: |
45+
PYTHON_BIN=$(find "${{ env.BLENDER_DIR }}" -type f -name "python3*" | head -n 1)
46+
"${PYTHON_BIN}" -m pip download -r requirements-dev.txt --dest "src/multiple_camera_render/wheels"
47+
48+
- name: Build and install Blender extension
49+
run: |
50+
mkdir -p "${{ github.workspace }}/dist"
51+
52+
${{ env.BLENDER_DIR }}/blender --command extension build --source-dir="${{ github.workspace }}/src/multiple_camera_render" --output-dir="${{ github.workspace }}/dist"
53+
echo "Blender extension built successfully."
54+
EXTENSION_ZIP=$(find "${{ github.workspace }}/dist" -type f -name "*.zip" | head -n 1)
55+
echo "Extension zip file: ${EXTENSION_ZIP}"
56+
"${{ env.BLENDER_DIR }}/blender" --command extension install-file --repo user_default --enable "${EXTENSION_ZIP}"
57+
58+
- name: Install dependencies
59+
run: |
60+
python -m pip install --upgrade pip
61+
pip install pytest
62+
63+
- name: Run tests
64+
run: |
65+
pytest -s -v --blender="${{ env.BLENDER_DIR }}/blender" --background-only
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
# SPDX-FileCopyrightText: 2025 Ivan Perevala <[email protected]>
2+
#
3+
# SPDX-License-Identifier: GPL-3.0-or-later
4+
5+
name: Blender 4.4.0
6+
description: |
7+
This workflow tests the Blender extension for multiple camera rendering.
8+
9+
on:
10+
push:
11+
branches: [main]
12+
pull_request:
13+
branches: [main]
14+
15+
jobs:
16+
test-addon:
17+
runs-on: ubuntu-latest
18+
19+
env:
20+
BLENDER_VERSION: "4.4.0"
21+
BLENDER_DIR: "${{ github.workspace }}/blender"
22+
23+
steps:
24+
- name: Checkout repository
25+
uses: actions/checkout@v4
26+
27+
- name: Cache Blender
28+
id: cache-blender
29+
uses: actions/cache@v4
30+
with:
31+
path: ${{ env.BLENDER_DIR }}
32+
key: blender-${{ env.BLENDER_VERSION }}
33+
34+
- name: Download Blender if not cached
35+
if: steps.cache-blender.outputs.cache-hit != 'true'
36+
run: |
37+
BLENDER_MAJOR_MINOR=$(echo "${{ env.BLENDER_VERSION }}" | cut -d. -f1,2)
38+
DOWNLOAD_URL="https://download.blender.org/release/Blender${BLENDER_MAJOR_MINOR}/blender-${{ env.BLENDER_VERSION }}-linux-x64.tar.xz"
39+
40+
mkdir -p "${{ env.BLENDER_DIR }}"
41+
wget -qO- "${DOWNLOAD_URL}" | tar -xJ --strip-components=1 -C "${{ env.BLENDER_DIR }}"
42+
43+
- name: Download wheels to build Blender extension
44+
run: |
45+
PYTHON_BIN=$(find "${{ env.BLENDER_DIR }}" -type f -name "python3*" | head -n 1)
46+
"${PYTHON_BIN}" -m pip download -r requirements-dev.txt --dest "src/multiple_camera_render/wheels"
47+
48+
- name: Build and install Blender extension
49+
run: |
50+
mkdir -p "${{ github.workspace }}/dist"
51+
52+
${{ env.BLENDER_DIR }}/blender --command extension build --source-dir="${{ github.workspace }}/src/multiple_camera_render" --output-dir="${{ github.workspace }}/dist"
53+
echo "Blender extension built successfully."
54+
EXTENSION_ZIP=$(find "${{ github.workspace }}/dist" -type f -name "*.zip" | head -n 1)
55+
echo "Extension zip file: ${EXTENSION_ZIP}"
56+
"${{ env.BLENDER_DIR }}/blender" --command extension install-file --repo user_default --enable "${EXTENSION_ZIP}"
57+
58+
- name: Install dependencies
59+
run: |
60+
python -m pip install --upgrade pip
61+
pip install pytest
62+
63+
- name: Run tests
64+
run: |
65+
pytest -s -v --blender="${{ env.BLENDER_DIR }}/blender" --background-only

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@ SPDX-License-Identifier: GPL-3.0-or-later -->
66

77
[![License: GPL v3](https://img.shields.io/badge/License-GPLv3-blue)](./LICENSE)
88
[![Spell Check](https://github.com/ivan-perevala/multiple_camera_render/actions/workflows/spellcheck.yml/badge.svg)](https://github.com/ivan-perevala/multiple_camera_render/actions/workflows/spellcheck.yml)
9-
[![Blender Test 4.2, 4.3, 4.4](https://github.com/ivan-perevala/multiple_camera_render/actions/workflows/blender-test.yml/badge.svg)](https://github.com/ivan-perevala/multiple_camera_render/actions/workflows/blender-test.yml)
9+
[![Blender 4.2.0](https://github.com/ivan-perevala/multiple_camera_render/actions/workflows/blender-test-4.2.0.yml/badge.svg)](https://github.com/ivan-perevala/multiple_camera_render/actions/workflows/blender-test-4.2.0.yml)
10+
[![Blender 4.3.0](https://github.com/ivan-perevala/multiple_camera_render/actions/workflows/blender-test-4.3.0.yml/badge.svg)](https://github.com/ivan-perevala/multiple_camera_render/actions/workflows/blender-test-4.3.0.yml)
11+
[![Blender 4.4.0](https://github.com/ivan-perevala/multiple_camera_render/actions/workflows/blender-test-4.4.0.yml/badge.svg)](https://github.com/ivan-perevala/multiple_camera_render/actions/workflows/blender-test-4.4.0.yml)
1012

1113
Extension for [Blender](https://www.blender.org/) for sequential rendering from multiple cameras.
1214

0 commit comments

Comments
 (0)