-
Notifications
You must be signed in to change notification settings - Fork 0
78 lines (65 loc) · 2.19 KB
/
tests-run.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
name: Run tests
on:
pull_request:
types: [ opened, synchronize, reopened ]
push:
branches: [ main ]
concurrency:
group: ${{ github.ref }}-${{ github.workflow }}
cancel-in-progress: true
jobs:
run-tests:
runs-on: ${{matrix.os}}
env:
BB_BLENDER_TEST_HOME: "~/blender"
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
version: ['3.11']
blender: ['4.2.0']
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.version }}
- name: Install poetry
uses: abatilo/actions-poetry@v2
- name: Setup a local virtual environment
run: |
poetry config virtualenvs.create true --local
poetry config virtualenvs.in-project true --local
- uses: actions/cache@v4
name: Define a cache for the virtual environment based on the dependencies lock file
with:
path: ./.venv
key: venv-${{ runner.os }}-${{ matrix.version }}-${{ hashFiles('poetry.lock') }}
- name: Install the project dependencies
run: poetry install
- name: Run tests
run: poetry run pytest -v
- name: Restore Blender from cache
id: cache-blender
uses: actions/cache/restore@v4
with:
path: ~/blender
key: ${{ runner.os }}-blender-${{ matrix.blender }}
- name: Install Blender
if: steps.cache-blender.outputs.cache-hit != 'true'
run: |
poetry run python scripts/blender_install.py ${{ matrix.blender }}
- name: "Save Blender in cache"
if: steps.cache-blender.outputs.cache-hit != 'true'
uses: actions/cache/save@v4
with:
path: ~/blender
key: ${{ steps.cache-blender.outputs.cache-primary-key }}
- name: Install EGL mesa
if: "startsWith (matrix.os, 'ubuntu')"
run: |
sudo apt-get update -y -qq
sudo apt-get install -y -qq libegl1-mesa libegl1-mesa-dev
- name: Run integration tests
run: |
poetry build
poetry run python scripts/bb_package_install.py
poetry run pytest --integration -v