Skip to content

release

release #36

Workflow file for this run

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}}
strategy:
matrix:
# os: [ubuntu-latest, windows-latest, macos-latest]
os: [ubuntu-latest]
version: ['3.11']
blender: ['4.2']
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
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@v3
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@v3
with:
path: ~/blender
key: ${{ runner.os }}-blender-${{ matrix.blender }}
- name: Install Blender
if: steps.cache-blender.outputs.cache-hit != 'true'
run: |
wget https://download.blender.org/release/Blender${{ matrix.blender }}/blender-${{ matrix.blender }}.0-linux-x64.tar.xz
mkdir ~/blender
tar -xf blender-${{ matrix.blender }}.0-linux-x64.tar.xz -C ~/blender --strip-components=1
- name: "Save Blender in cache"
if: steps.cache-blender.outputs.cache-hit != 'true'
uses: actions/cache/save@v3
with:
path: ~/blender
key: ${{ steps.cache-blender.outputs.cache-primary-key }}
- name: Install EGL mesa
run: |
sudo apt-get update -y -qq
sudo apt-get install -y -qq libegl1-mesa libegl1-mesa-dev
- name: Run integration tests
run: |
~/blender/blender --version
export PATH="$PATH:$HOME/blender"
poetry build
poetry run python scripts/bb_install.py
poetry run pytest -m integration -v
- uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
with:
name: distfiles
path: dist/
if-no-files-found: error
# https://github.com/python-poetry/poetry/blob/main/.github/workflows/release.yaml
upload-github:
name: Upload (GitHub)
runs-on: ubuntu-latest
permissions:
contents: write
needs: run-tests
steps:
# We need to be in a git repo for gh to work.
- uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4
- uses: actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e # v4.1.7
with:
name: distfiles
path: dist/
- run: gh release upload ${{ github.event.release.tag_name }} dist/*.{tar.gz,whl}
env:
GH_TOKEN: ${{ github.token }}