-
Notifications
You must be signed in to change notification settings - Fork 5
64 lines (56 loc) · 1.51 KB
/
tests.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
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.11 for mypy testing
- name: Set up Python 3.11
uses: actions/setup-python@v4
with:
python-version: '3.11'
- name: Install dependencies
run: |
sudo snap install blender --channel=4.2lts/stable --classic
cd $GITHUB_WORKSPACE
pip install pyright pytest numpy ./fake_bpy_modules
- 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: Static Type Checking (Pyright)
run: |
cd $GITHUB_WORKSPACE
python -m pyright ./mcblend
- name: Tests (Pytest)
run: |
cd $GITHUB_WORKSPACE
python -m pytest