Test on #38
Workflow file for this run
This file contains 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
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 | |
- main | |
#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 | |
run: | | |
# TODO: use git describe --tags or equivalent to automatically get latest stable. | |
# or at least hard code this more recent one: | |
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_v*.zip -d MCprep_stable_release | |
# copy the checked-in json file | |
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 | |
- name: Run tests | |
run: | | |
ls -lta /home/runner/work/MCprep/MCprep/test_files/test_resource_pack/materials.blend | |
python run_tests.py | |
echo "Addon was installed?" | |
echo $(ls /home/runner/.config/blender/4.1/scripts/addons) | |
echo $(ls /home/runner/.config/blender/4.1/scripts/addons/MCprep_addon/MCprep_resources) | |