2
2
pull_request :
3
3
paths :
4
4
- ' **.py'
5
+ - ' .github/workflows/test_examples.yml'
5
6
workflow_dispatch :
6
7
7
8
name : Test Examples
8
9
9
10
env :
10
11
QT_QPA_PLATFORM : offscreen
11
12
MANIM_SLIDES_VERBOSITY : debug
13
+ PYTHONFAULTHANDLER : 1
14
+ DISPLAY : " :99"
12
15
13
16
jobs :
14
17
build-examples :
24
27
# Your graphics drivers do not support OpenGL 2.0.
25
28
- os : windows-latest
26
29
manim : manimgl
27
- # manimgl seems to have problems with Python 3.11
28
- - manim : manimgl
29
- pyversion : ' 3.11'
30
30
# We only test Python 3.11 on Windows and MacOS
31
31
- os : windows-latest
32
32
pyversion : ' 3.8'
@@ -46,64 +46,72 @@ jobs:
46
46
steps :
47
47
- name : Checkout repository
48
48
uses : actions/checkout@v3
49
+ - name : Install Poetry
50
+ run : pipx install poetry
49
51
- name : Install Python
50
52
uses : actions/setup-python@v4
51
53
with :
52
54
python-version : ${{ matrix.pyversion }}
53
- - name : Append to Path on MacOS and Ubuntu
54
- if : matrix.os == 'macos-latest' || matrix.os == 'ubuntu-latest'
55
+ cache : ' poetry'
56
+
57
+ # Path related stuff
58
+ - name : Append to Path on MacOS
59
+ if : matrix.os == 'macos-latest'
60
+ run : |
61
+ echo "${HOME}/.local/bin" >> $GITHUB_PATH
62
+ echo "/Users/runner/Library/Python/${{ matrix.pyversion }}/bin" >> $GITHUB_PATH
63
+ - name : Append to Path on Ubuntu
64
+ if : matrix.os == 'ubuntu-latest'
55
65
run : echo "${HOME}/.local/bin" >> $GITHUB_PATH
56
66
- name : Append to Path on Windows
57
67
if : matrix.os == 'windows-latest'
58
68
run : echo "${HOME}/.local/bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
59
- - name : Install MacOS dependencies (manim only)
69
+
70
+ # OS depedencies
71
+ - name : Install manim dependencies on MacOs
60
72
if : matrix.os == 'macos-latest' && matrix.manim == 'manim'
61
- run : brew install py3cairo
62
- - name : Install MacOS dependencies
63
- if : matrix.os == 'macos-latest'
73
+ run : brew install ffmpeg py3cairo
74
+ - name : Install manimgl dependencies on MacOS
75
+ if : matrix.os == 'macos-latest' && matrix.manim == 'manimgl'
64
76
run : brew install ffmpeg
65
- - name : Install Ubuntu dependencies
66
- if : matrix.os == 'ubuntu-latest'
67
- run : sudo apt install libcairo2-dev libpango1.0-dev ffmpeg freeglut3-dev xvfb
77
+ - name : Install manim dependencies on Ubuntu
78
+ if : matrix.os == 'ubuntu-latest' && matrix.manim == 'manim'
79
+ run : |
80
+ sudo apt-get install libcairo2-dev libpango1.0-dev ffmpeg freeglut3-dev
81
+ - name : Install manimgl dependencies on Ubuntu
82
+ if : matrix.os == 'ubuntu-latest' && matrix.manim == 'manimgl'
83
+ run : |
84
+ sudo apt-get install libpango1.0-dev ffmpeg freeglut3-dev
85
+ - name : Install xvfb on Ubuntu
86
+ if : matrix.os == 'ubuntu-latest' && matrix.manim == 'manimgl'
87
+ run : |
88
+ sudo apt-get install xvfb
89
+ nohup Xvfb $DISPLAY &
68
90
- name : Install Windows dependencies
69
91
if : matrix.os == 'windows-latest'
70
92
run : choco install ffmpeg
71
- - name : Install manim on MacOs
72
- if : matrix.manim == 'manim' && matrix.os == 'macos-latest'
73
- run : pip3 install --user manim
74
- - name : Install manim on Ubuntu and Windows
75
- if : matrix.manim == 'manim' && (matrix.os == 'ubuntu-latest' || matrix.os == 'windows-latest')
76
- run : python -m pip install --user manim
77
- - name : Install manimgl on MacOs
78
- if : matrix.manim == 'manimgl' && matrix.os == 'macos-latest'
79
- run : pip3 install --user manimgl
80
- - name : Install manimgl on Ubuntu and Windows
81
- if : matrix.manim == 'manimgl' && matrix.os != 'macos-latest'
82
- run : python -m pip install --user manimgl
83
- - name : Install manim-slides on MacOS
84
- if : matrix.os == 'macos-latest'
85
- run : pip3 install --user .
86
- - name : Install manim-slides on Ubuntu
87
- if : matrix.os == 'ubuntu-latest'
88
- run : xvfb-run -a -s "-screen 0 1400x900x24" python -m pip install --user .
89
- - name : Install manim-slides on Windows
90
- if : matrix.os == 'windows-latest'
91
- run : pip3 install -e .
92
- - name : Build slides with manim
93
+
94
+ # Install Manim Slides
95
+ - name : Install Manim Slides
96
+ run : |
97
+ poetry config experimental.new-installer false
98
+ poetry install
99
+
100
+ # Render slides
101
+ - name : Render slides
93
102
if : matrix.manim == 'manim'
94
- run : python -m manim -ql example.py Example ThreeDExample ConvertExample
95
- - name : Build slides with manimgl on Ubuntu
96
- if : matrix.manim == 'manimgl' && matrix.os == 'ubuntu-latest'
97
- run : xvfb-run -a -s "-screen 0 1400x900x24" manim-render -l example.py Example ThreeDExample
98
- - name : Build slides with manimgl on MacOS or Windows
99
- if : matrix.manim == 'manimgl' && (matrix.os == 'macos-latest' || matrix.os == 'windows-latest')
100
- run : manimgl -l example.py Example ThreeDExample
101
- - name : Test slides on Ubuntu
102
- if : matrix.os == 'ubuntu-latest'
103
- run : xvfb-run -a -s "-screen 0 1400x900x24" manim-slides Example ThreeDExample --skip-all
104
- - name : Test slides on MacOS or Windows
105
- if : matrix.os == 'macos-latest' || matrix.os == 'windows-latest'
106
- run : manim-slides Example ThreeDExample --skip-all
103
+ run : poetry run manim -ql example.py Example ThreeDExample
104
+ - name : Render slides
105
+ if : matrix.manim == 'manimgl'
106
+ run : poetry run -v manimgl -l example.py Example ThreeDExample
107
+
108
+ # Play slides
109
+ - name : Test slides
110
+ run : poetry run manim-slides Example ThreeDExample --skip-all
111
+
112
+ # Test slides to html
107
113
- name : Test convert on Ubuntu
108
114
if : matrix.os == 'ubuntu-latest' && matrix.manim == 'manim'
109
- run : manim-slides convert --to=html ConvertExample index.html
115
+ run : |
116
+ poetry run manim -ql example.py ConvertExample
117
+ poetry run manim-slides convert --to=html ConvertExample index.html
0 commit comments