Skip to content

Test on

Test on #106

Workflow file for this run

name: Run tests
on:
workflow_dispatch:
inputs:
blender_versions:
description: 'Blender version(s)'
required: false
default: '["4.1.1"]'
type: choice
options:
- '["4.1.1", "2.90.1", "3.6.5", "2.90.1", "2.28.3"]'
- '["4.1.1"]'
- '["3.6.5"]'
- '["2.90.1"]'
- '["2.28.3"]'
pull_request:
types: [opened, reopened, synchronize] # drop synchronize not run per commit
branches:
- dev
- master
paths:
- 'MCprep_addon/**'
#run-name: Test on ${{ inputs.blender_versions || true && "4.1.1" }}
run-name: Test on ${{ inputs.blender_versions }}
jobs:
test:
name: Test Blender
runs-on: ubuntu-latest
strategy:
matrix:
blender-version: ${{ github.event.inputs.blender_versions && fromJSON(github.event.inputs.blender_versions) || fromJSON('["4.1.1"]') }}
steps:
- uses: actions/checkout@v4
- run: |
echo "Running with blender: $BVERSION"
echo "event name is:" ${{ github.event_name }}
echo "event type is:" ${{ github.event.action }}
env:
BVERSION: ${{ matrix.blender-version }}
- name: Set up Python v3.9
uses: actions/setup-python@v5
with:
python-version: 3.9
- name: Pip installs
run: |
python -m pip install --upgrade pip
python -m pip install --upgrade blender-downloader
python -m pip install --upgrade -r requirements.txt
- name: Cache Blender ${{ matrix.blender-version }}
uses: actions/cache@v4
id: cache-blender
with:
path: |
blender-*
blender_execs.txt
key: ${{ runner.os }}-${{ matrix.blender-version }}
- name: Download Blender ${{ matrix.blender-version }}
if: steps.cache-blender.outputs.cache-hit != 'true'
id: download-blender
run: |
printf "%s" "$(blender-downloader \
${{ matrix.blender-version }} --extract --remove-compressed \
--quiet --print-blender-executable)" > blender_execs.txt
- name: Download assets
if: always()
run: |
# TODO: use git describe --tags or equivalent to automatically get latest stable.
wget -nv "https://github.com/Moo-Ack-Productions/MCprep/releases/download/3.5.3/MCprep_addon_3.5.3.zip"
git lfs pull
mkdir MCprep_stable_release
unzip -qq ./MCprep_addon_*.zip -d MCprep_stable_release
# Copy the checked-in data json to override the wget version
mv ./MCprep_addon/MCprep_resources/mcprep_data_update.json _tmp.json
mv -f ./MCprep_stable_release/MCprep_addon/MCprep_resources/** ./MCprep_addon/MCprep_resources
mv -f _tmp.json ./MCprep_addon/MCprep_resources/mcprep_data_update.json
echo "Prepare for install by creating addons folder"
mkdir -p /home/runner/.config/blender/4.1/scripts/addons
echo $(ls /home/runner/.config/blender/4.1/scripts/addons)
echo $(ls /home/runner/.config/blender/4.1/scripts/addons/MCprep_addon/MCprep_resources)
- name: Run tests
run: |
python run_tests.py
- name: Output results
run: cat test_results.csv