[pre-commit.ci] pre-commit autoupdate #64
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
on: | |
pull_request: | |
workflow_dispatch: | |
name: Tests | |
jobs: | |
pytest: | |
strategy: | |
fail-fast: false | |
matrix: | |
pyversion: ['3.8', '3.9', '3.10', '3.11'] | |
runs-on: ubuntu-latest | |
env: | |
QT_QPA_PLATFORM: offscreen | |
MANIM_SLIDES_VERBOSITY: debug | |
PYTHONFAULTHANDLER: 1 | |
DISPLAY: :99 | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Install Poetry | |
run: pipx install poetry | |
- name: Install Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.pyversion }} | |
cache: poetry | |
- name: Run apt-get update on Ubuntu | |
run: sudo apt-get update | |
- name: Install manim dependencies on Ubuntu | |
run: | | |
sudo apt-get install libcairo2-dev libpango1.0-dev ffmpeg freeglut3-dev | |
- name: Install xvfb on Ubuntu | |
run: | | |
sudo apt-get install xvfb | |
nohup Xvfb $DISPLAY & | |
- name: Install Manim Slides | |
run: | | |
poetry install --with test | |
- name: Run pytest | |
run: poetry run pytest -x | |
build-examples: | |
strategy: | |
fail-fast: false | |
matrix: | |
manim: [manim, manimgl] | |
os: [macos-latest, ubuntu-latest, windows-latest] | |
pyversion: ['3.8', '3.9', '3.10', '3.11'] | |
exclude: | |
# excludes manimgl on Windows because if throws errors | |
# related to OpenGL, which seems hard to fix: | |
# Your graphics drivers do not support OpenGL 2.0. | |
- os: windows-latest | |
manim: manimgl | |
# We only test Python 3.11 on Windows and MacOS | |
- os: windows-latest | |
pyversion: '3.8' | |
- os: windows-latest | |
pyversion: '3.9' | |
- os: windows-latest | |
pyversion: '3.10' | |
manim: manim | |
- os: macos-latest | |
pyversion: '3.8' | |
- os: macos-latest | |
pyversion: '3.9' | |
- os: macos-latest | |
pyversion: '3.10' | |
manim: manim | |
runs-on: ${{ matrix.os }} | |
env: | |
QT_QPA_PLATFORM: offscreen | |
MANIM_SLIDES_VERBOSITY: debug | |
PYTHONFAULTHANDLER: 1 | |
DISPLAY: :99 | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Install Poetry | |
run: pipx install poetry | |
- name: Install Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.pyversion }} | |
cache: poetry | |
# Path related stuff | |
- name: Append to Path on MacOS | |
if: matrix.os == 'macos-latest' | |
run: | | |
echo "${HOME}/.local/bin" >> $GITHUB_PATH | |
echo "/Users/runner/Library/Python/${{ matrix.pyversion }}/bin" >> $GITHUB_PATH | |
- name: Append to Path on Ubuntu | |
if: matrix.os == 'ubuntu-latest' | |
run: echo "${HOME}/.local/bin" >> $GITHUB_PATH | |
- name: Append to Path on Windows | |
if: matrix.os == 'windows-latest' | |
run: echo "${HOME}/.local/bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append | |
# OS depedencies | |
- name: Install manim dependencies on MacOs | |
if: matrix.os == 'macos-latest' && matrix.manim == 'manim' | |
run: brew install ffmpeg py3cairo | |
- name: Install manimgl dependencies on MacOS | |
if: matrix.os == 'macos-latest' && matrix.manim == 'manimgl' | |
run: brew install ffmpeg | |
- name: Run apt-get update on Ubuntu | |
if: matrix.os == 'ubuntu-latest' | |
run: sudo apt-get update | |
- name: Install manim dependencies on Ubuntu | |
if: matrix.os == 'ubuntu-latest' && matrix.manim == 'manim' | |
run: | | |
sudo apt-get install libcairo2-dev libpango1.0-dev ffmpeg freeglut3-dev | |
- name: Install manimgl dependencies on Ubuntu | |
if: matrix.os == 'ubuntu-latest' && matrix.manim == 'manimgl' | |
run: | | |
sudo apt-get install libpango1.0-dev ffmpeg freeglut3-dev | |
- name: Install xvfb on Ubuntu | |
if: matrix.os == 'ubuntu-latest' && matrix.manim == 'manimgl' | |
run: | | |
sudo apt-get install xvfb | |
nohup Xvfb $DISPLAY & | |
- name: Install Windows dependencies | |
if: matrix.os == 'windows-latest' | |
run: choco install ffmpeg | |
# Install Manim Slides | |
- name: Install Manim Slides | |
run: | | |
poetry install --extras ${{ matrix.manim }} | |
# Render slides | |
- name: Render slides | |
if: matrix.manim == 'manim' | |
run: poetry run manim -ql example.py BasicExample ThreeDExample | |
- name: Render slides | |
if: matrix.manim == 'manimgl' | |
run: poetry run -v manimgl -l example.py BasicExample ThreeDExample | |
# Play slides | |
- name: Test slides | |
run: poetry run manim-slides BasicExample ThreeDExample --skip-all | |
# Test slides to html | |
- name: Test convert on Ubuntu | |
if: matrix.os == 'ubuntu-latest' && matrix.manim == 'manim' | |
run: | | |
poetry run manim -ql example.py ConvertExample | |
poetry run manim-slides convert --to=html ConvertExample index.html |