mirror of
https://github.com/ManimCommunity/manim.git
synced 2026-06-22 10:01:47 +00:00
Includes the changes from PRs #4666, #4668, #4669, #4670, and #4671. Co-authored-by: Francisco Manríquez Novoa <49853152+chopan050@users.noreply.github.com>
168 lines
5.9 KiB
YAML
168 lines
5.9 KiB
YAML
name: CI
|
|
|
|
concurrency:
|
|
group: ${{ github.ref }}
|
|
cancel-in-progress: true
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
pull_request:
|
|
branches:
|
|
- main
|
|
|
|
jobs:
|
|
test:
|
|
runs-on: ${{ matrix.os }}
|
|
env:
|
|
DISPLAY: :0
|
|
PYTEST_ADDOPTS: "--color=yes" # colors in pytest
|
|
PYTHONIOENCODING: "utf8"
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
os: [ubuntu-22.04, macos-latest, windows-latest]
|
|
python: ["3.11", "3.12", "3.13", "3.14"]
|
|
include:
|
|
- os: macos-15-intel
|
|
python: "3.13"
|
|
|
|
steps:
|
|
- name: Checkout the repository
|
|
uses: actions/checkout@v6
|
|
|
|
- name: Setup Python ${{ matrix.python }}
|
|
uses: actions/setup-python@v6
|
|
with:
|
|
python-version: ${{ matrix.python }}
|
|
|
|
- name: Install uv
|
|
uses: astral-sh/setup-uv@v7
|
|
with:
|
|
enable-cache: true
|
|
|
|
- name: Setup cache variables
|
|
shell: bash
|
|
id: cache-vars
|
|
run: |
|
|
echo "date=$(/bin/date -u "+%m%w%Y")" >> $GITHUB_OUTPUT
|
|
|
|
- name: Install system dependencies (Linux)
|
|
if: runner.os == 'Linux'
|
|
uses: awalsh128/cache-apt-pkgs-action@latest
|
|
with:
|
|
packages: python3-opengl libpango1.0-dev xvfb freeglut3-dev
|
|
version: 1.0
|
|
|
|
- name: Install Texlive (Linux)
|
|
if: runner.os == 'Linux'
|
|
uses: zauguin/install-texlive@v4
|
|
with:
|
|
packages: >
|
|
scheme-basic latex fontspec tipa calligra xcolor
|
|
standalone preview doublestroke setspace rsfs relsize
|
|
ragged2e fundus-calligra microtype wasysym physics dvisvgm jknapltx
|
|
wasy cm-super babel-english gnu-freefont mathastext cbfonts-fd xetex
|
|
|
|
- name: Start virtual display (Linux)
|
|
if: runner.os == 'Linux'
|
|
run: |
|
|
# start xvfb in background
|
|
sudo /usr/bin/Xvfb $DISPLAY -screen 0 1280x1024x24 &
|
|
|
|
- name: Setup Cairo Cache
|
|
uses: actions/cache@v5
|
|
id: cache-cairo
|
|
if: runner.os == 'Linux' || runner.os == 'macOS'
|
|
with:
|
|
path: ${{ github.workspace }}/third_party
|
|
key: ${{ runner.os }}-${{ runner.arch }}-dependencies-cairo-${{ hashFiles('.github/scripts/ci_build_cairo.py') }}
|
|
|
|
- name: Build and install Cairo (Linux and macOS)
|
|
if: (runner.os == 'Linux' || runner.os == 'macOS') && steps.cache-cairo.outputs.cache-hit != 'true'
|
|
run: python .github/scripts/ci_build_cairo.py
|
|
|
|
- name: Set env vars for Cairo (Linux and macOS)
|
|
if: runner.os == 'Linux' || runner.os == 'macOS'
|
|
run: python .github/scripts/ci_build_cairo.py --set-env-vars
|
|
|
|
- name: Setup macOS cache
|
|
uses: actions/cache@v5
|
|
id: cache-macos
|
|
if: runner.os == 'macOS'
|
|
with:
|
|
path: ${{ github.workspace }}/macos-cache
|
|
key: ${{ runner.os }}-dependencies-tinytex-${{ hashFiles('.github/manimdependency.json') }}-${{ steps.cache-vars.outputs.date }}-1
|
|
|
|
- name: Install system dependencies (MacOS)
|
|
if: runner.os == 'macOS' && steps.cache-macos.outputs.cache-hit != 'true'
|
|
run: |
|
|
tinyTexPackages=$(python -c "import json;print(' '.join(json.load(open('.github/manimdependency.json'))['macos']['tinytex']))")
|
|
IFS=' '
|
|
read -a ttp <<< "$tinyTexPackages"
|
|
oriPath=$PATH
|
|
sudo mkdir -p $PWD/macos-cache
|
|
echo "Install TinyTeX"
|
|
sudo curl -L -o "/tmp/TinyTeX.tar.xz" "https://github.com/rstudio/tinytex-releases/releases/download/daily/TinyTeX-1-darwin.tar.xz"
|
|
sudo tar xJf "/tmp/TinyTeX.tar.xz" -C "$PWD/macos-cache"
|
|
export PATH="$PWD/macos-cache/TinyTeX/bin/universal-darwin:$PATH"
|
|
sudo tlmgr update --self
|
|
for i in "${ttp[@]}"; do
|
|
sudo tlmgr install "$i"
|
|
done
|
|
export PATH="$oriPath"
|
|
echo "Completed TinyTeX"
|
|
|
|
- name: Add macOS dependencies to PATH
|
|
if: runner.os == 'macOS'
|
|
shell: bash
|
|
run: |
|
|
echo "/Library/TeX/texbin" >> $GITHUB_PATH
|
|
echo "$PWD/macos-cache/TinyTeX/bin/universal-darwin" >> $GITHUB_PATH
|
|
|
|
- name: Setup Windows cache
|
|
id: cache-windows
|
|
if: runner.os == 'Windows'
|
|
uses: actions/cache@v5
|
|
with:
|
|
path: ${{ github.workspace }}\ManimCache
|
|
key: ${{ runner.os }}-dependencies-tinytex-${{ hashFiles('.github/manimdependency.json') }}-${{ steps.cache-vars.outputs.date }}-1
|
|
|
|
- uses: ssciwr/setup-mesa-dist-win@v3
|
|
|
|
- name: Install system dependencies (Windows)
|
|
if: runner.os == 'Windows' && steps.cache-windows.outputs.cache-hit != 'true'
|
|
run: |
|
|
$tinyTexPackages = $(python -c "import json;print(' '.join(json.load(open('.github/manimdependency.json'))['windows']['tinytex']))") -Split ' '
|
|
$OriPath = $env:PATH
|
|
echo "Install Tinytex"
|
|
Invoke-WebRequest "https://github.com/rstudio/tinytex-releases/releases/download/daily/TinyTeX-1-windows.exe" -OutFile "$($env:TMP)\TinyTex.exe"
|
|
.$env:TMP\TinyTex.exe -o"$($PWD)\ManimCache\LatexWindows"
|
|
$env:Path = "$($PWD)\ManimCache\LatexWindows\TinyTeX\bin\windows;$($env:PATH)"
|
|
tlmgr update --self
|
|
tlmgr install $tinyTexPackages
|
|
$env:PATH=$OriPath
|
|
echo "Completed Latex"
|
|
|
|
- name: Add Windows dependencies to PATH
|
|
if: runner.os == 'Windows'
|
|
run: |
|
|
$env:Path += ";" + "$($PWD)\ManimCache\LatexWindows\TinyTeX\bin\windows"
|
|
echo "$env:Path" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
|
|
|
|
- name: Install dependencies and manim
|
|
run: |
|
|
uv sync --all-extras --locked
|
|
|
|
- name: Run tests
|
|
run: |
|
|
uv run python -m pytest
|
|
|
|
- name: Run module doctests
|
|
run: |
|
|
uv run python -m pytest -v --cov-append --ignore-glob="*opengl*" --doctest-modules manim
|
|
|
|
- name: Run doctests in rst files
|
|
run: |
|
|
cd docs && uv run make doctest O=-tskip-manim
|