-
Notifications
You must be signed in to change notification settings - Fork 37
84 lines (74 loc) · 2.67 KB
/
test.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
# This workflow runs on every pull request and push on any other branch other than master.
# It executes the test suite on different environments to validate the add-on.
name: Test suite
# Triggers the workflow on pull requests created for the master branch as well as
# push events on other branches than master.
on:
push:
branches:
- "*"
- "!master"
pull_request:
branches: [ master ]
workflow_call:
# Workflow steps
jobs:
build:
name: "${{ matrix.environment.os }} | Blender ${{ matrix.blender.version }}"
runs-on: ${{ matrix.environment.os }}
strategy:
# Do not stop other jobs if one fails
fail-fast: false
matrix:
environment:
- {
os: "ubuntu-latest",
mitsuba-version: "3.0.1"
}
- {
os: "windows-latest",
mitsuba-version: "3.0.1"
}
blender:
- {
version: "2.93"
}
- {
version: "3.3"
}
steps:
- name: Git checkout
uses: actions/checkout@v2
- name: Setup Python
uses: "actions/setup-python@v2"
- name: Install Python dependencies
run: python -m pip install --upgrade requests
- name: Retrieve Blender full version
id: blender-version
shell: bash
run: |
echo "::set-output name=BLENDER_VERSION::$(python scripts/blender_downloader.py ${{ matrix.blender.version }} --print-version)"
- name: Cache Blender archive
id: cache-blender
uses: actions/cache@v3
with:
path: blender
key: ${{ matrix.environment.os }}-${{ steps.blender-version.outputs.BLENDER_VERSION }}-v1
- name: Download Blender
if: steps.cache-blender.outputs.cache-hit != 'true'
run: python scripts/blender_downloader.py ${{ matrix.blender.version }} -o blender
- name: Install Blender dependencies
shell: bash
run: |
BLENDER_PYTHON=$(find blender/ -regextype posix-extended -regex '.*bin\/python(.exe|[0-9].[0-9]{1,2}m?)' -print -quit)
echo "Blender Python is $BLENDER_PYTHON"
./$BLENDER_PYTHON -m ensurepip
./$BLENDER_PYTHON -m pip install -U pip
./$BLENDER_PYTHON -m pip install --upgrade pytest pytest-cov
./$BLENDER_PYTHON -m pip install mitsuba==${{ matrix.environment.mitsuba-version }} --force-reinstall
- name: Run Addon test suite
shell: bash
run: |
BLENDER_EXECUTABLE=$(find blender/ -maxdepth 1 -regextype posix-extended -regex '.*blender(.exe)?' -print -quit)
echo "Blender Executable is $BLENDER_EXECUTABLE"
./$BLENDER_EXECUTABLE -b -noaudio --factory-startup --python scripts/run_tests.py -- -v --cov=mitsuba-blender