Add custom version of fake_bpy_modules
to the project
#44
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: Tests | |
on: | |
push: | |
branches: [ master ] | |
paths: | |
- '**.py' | |
- 'tests/data/**.json' | |
- '.github/workflows/**.yml' | |
pull_request: | |
branches: [ master ] | |
paths: | |
- '**.py' | |
- 'tests/data/**.json' | |
- '.github/workflows/**.yml' | |
workflow_dispatch: | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
steps: | |
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can | |
# access it | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
with: | |
submodules: recursive | |
- name: Cache git lfs | |
uses: actions/cache@v1.1.0 | |
with: | |
path: .git/lfs | |
key: .git/lfs | |
- name: Pull lfs data, if not cached | |
run: git lfs pull | |
# Python 3.10 for mypy testing | |
- name: Set up Python 3.10 | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.10' | |
- name: Install dependencies | |
run: | | |
sudo snap install blender --channel=3.3lts/stable --classic | |
pip install pyright pytest numpy fake-bpy-module-3.4 | |
- name: Build and install the addon | |
run: | | |
cd $GITHUB_WORKSPACE | |
python --version | |
zip_name=$(python build.py | grep 'mcblend_[0-9.]*.zip' -o) | |
blender -b --python ./blender_scripts/install.py -- "$GITHUB_WORKSPACE/$zip_name" | |
- name: Test syntax with mypy | |
run: | | |
cd $GITHUB_WORKSPACE | |
python -m pyright ./mcblend | |
- name: PyTest tests | |
run: | | |
cd $GITHUB_WORKSPACE | |
python -m pytest |