-
Notifications
You must be signed in to change notification settings - Fork 9
97 lines (95 loc) · 3.03 KB
/
ci.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
85
86
87
88
89
90
91
92
93
94
95
96
97
name: Continuous Integration
on: [push]
jobs:
build:
name: "Build"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Build add-on
run: |
cp -R addon servo_animation
cp README.md LICENSE servo_animation
zip -r blender_servo_animation_addon servo_animation
- name: Archive add-on ZIP
uses: actions/upload-artifact@v3
with:
name: blender_servo_animation_addon.zip
path: |
blender_servo_animation_addon.zip
lint:
name: "Lint"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.10
uses: actions/setup-python@v3
with:
python-version: "3.10"
cache: "pip"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pylint
- name: Analysing the code with pylint
run: |
pylint addon
pylint -d duplicate-code tests
test:
name: "Test"
needs: build
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
blender:
- {version: "2.90.0", dir: "2.90"}
- {version: "3.1.0", dir: "3.1"}
- {version: "3.5.0", dir: "3.5"}
- {version: "4.0.0", dir: "4.0"}
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: "3.10"
cache: "pip"
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install --no-install-recommends -y unzip wget xz-utils libxi6 libxxf86vm1 libxfixes3 libxrender1 libgl1
- name: Restore Blender cache
id: restore-blender-cache
uses: actions/cache/restore@v3
with:
path: blender-${{ matrix.blender.version }}
key: blender-${{ matrix.blender.version }}
- name: Download Blender
if: steps.restore-blender-cache.outputs.cache-hit != 'true'
run: |
python -m pip install --upgrade pip
pip install blender-downloader
blender-downloader ${{ matrix.blender.version }}
mkdir -p blender-${{ matrix.blender.version }}
tar xf *.tar.xz -C blender-${{ matrix.blender.version }} --strip-components 1
- name: Cache Blender
uses: actions/cache/save@v3
if: steps.restore-blender-cache.outputs.cache-hit != 'true'
with:
path: blender-${{ matrix.blender.version }}
key: blender-${{ matrix.blender.version }}
- name: Create Blender symlink
run: |
sudo ln -s "$(pwd)/blender-${{ matrix.blender.version }}/blender" /usr/bin/blender
- name: Download add-on
uses: actions/download-artifact@v3
with:
name: blender_servo_animation_addon.zip
- name: Install add-on
run: |
unzip blender_servo_animation_addon.zip
sudo ln -s "$(pwd)/servo_animation" "$(pwd)/blender-${{ matrix.blender.version }}/${{ matrix.blender.dir }}/scripts/addons/servo_animation"
- name: Run tests inside Blender
run: |
./tests/prepare.sh
./tests/test.sh