@@ -7,8 +7,7 @@ name: Test suite
77on :
88 push :
99 branches :
10- - " *"
11- - " !master"
10+ - master
1211 pull_request :
1312 branches : [ master ]
1413 workflow_call :
@@ -27,29 +26,34 @@ jobs:
2726 os : " ubuntu-latest" ,
2827 mitsuba-version : " 3.5.0"
2928 }
30- - {
31- os : " windows-latest" ,
32- mitsuba-version : " 3.5.0"
33- }
29+ # - {
30+ # os: "windows-latest",
31+ # mitsuba-version: "3.5.0"
32+ # }
3433 blender :
3534 - {
36- version : " 3.6"
35+ version : " 3.6" ,
36+ python-version : " 3.10"
3737 }
3838 - {
39- version : " 4.2"
40- }
41- - {
42- version : " 4.4"
39+ version : " 4.2" ,
40+ python-version : " 3.11"
4341 }
42+ # - {
43+ # version: "4.4",
44+ # python-version: "3.11"
45+ # }
4446 steps :
4547 - name : Git checkout
46- uses : actions/checkout@v2
48+ uses : actions/checkout@v4
4749
4850 - name : Setup Python
4951 uses : " actions/setup-python@v2"
52+ with :
53+ python-version : ${{ matrix.blender.python-version }}
5054
5155 - name : Install Python dependencies
52- run : python -m pip install --upgrade requests
56+ run : python -m pip install --upgrade requests
5357
5458 - name : Retrieve Blender full version
5559 id : blender-version
6872 if : steps.cache-blender.outputs.cache-hit != 'true'
6973 run : python scripts/blender_downloader.py ${{ matrix.blender.version }} -o blender
7074
75+ - name : Check if mitsuba_version branch
76+ id : check-branch
77+ shell : bash
78+ run : |
79+ if [[ "${{ github.head_ref || github.ref_name }}" == mitsuba_version* ]]; then
80+ echo "::set-output name=is_mitsuba_version::true"
81+ else
82+ echo "::set-output name=is_mitsuba_version::false"
83+ fi
84+
85+ - name : Build Mitsuba if needed (Ubuntu)
86+ if : steps.check-branch.outputs.is_mitsuba_version == 'true' && matrix.environment.os == 'ubuntu-latest'
87+ uses : ./.github/workflows/build_mitsuba_ubuntu
88+ with :
89+ github_token : ${{ secrets.GITHUB_TOKEN }}
90+
91+ - name : Build Mitsuba if needed (Windows)
92+ if : steps.check-branch.outputs.is_mitsuba_version == 'true' && matrix.environment.os == 'windows-latest'
93+ uses : ./.github/workflows/build_mitsuba_windows
94+
7195 - name : Install Blender dependencies
7296 shell : bash
7397 run : |
@@ -76,11 +100,23 @@ jobs:
76100 ./$BLENDER_PYTHON -m ensurepip
77101 ./$BLENDER_PYTHON -m pip install -U pip
78102 ./$BLENDER_PYTHON -m pip install --upgrade pytest pytest-cov
79- ./$BLENDER_PYTHON -m pip install mitsuba==${{ matrix.environment.mitsuba-version }} --force-reinstall
103+ if [[ "${{ steps.check-branch.outputs.is_mitsuba_version }}" == "true" ]]; then
104+ echo "Using local Mitsuba build"
105+ export PYTHONPATH="$PWD/mitsuba3/build/python:$PYTHONPATH"
106+ else
107+ echo "Using PyPI Mitsuba"
108+ ./$BLENDER_PYTHON -m pip install mitsuba==${{ matrix.environment.mitsuba-version }} --force-reinstall
109+ fi
80110
81111 - name : Run Addon test suite
82112 shell : bash
83113 run : |
84114 BLENDER_EXECUTABLE=$(find blender/ -maxdepth 1 -regextype posix-extended -regex '.*blender(.exe)?' -print -quit)
85115 echo "Blender Executable is $BLENDER_EXECUTABLE"
86- ./$BLENDER_EXECUTABLE -b -noaudio --factory-startup --python scripts/run_tests.py -- -v --cov=mitsuba-blender
116+ if [[ "${{ steps.check-branch.outputs.is_mitsuba_version }}" == "true" ]]; then
117+ echo "Running tests with local Mitsuba build"
118+ ./$BLENDER_EXECUTABLE -b -noaudio --factory-startup --python scripts/run_tests.py --mitsuba "$PWD/mitsuba3/build" -- -v --cov=mitsuba-blender
119+ else
120+ echo "Running tests with PyPI Mitsuba"
121+ ./$BLENDER_EXECUTABLE -b -noaudio --factory-startup --python scripts/run_tests.py -- -v --cov=mitsuba-blender
122+ fi
0 commit comments