-
Notifications
You must be signed in to change notification settings - Fork 3
109 lines (94 loc) · 3.61 KB
/
tests.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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
name: Testing
on:
push:
branches:
- main
# Trigger each time HEAD branch is updated in a pull request
# see https://github.com/orgs/community/discussions/26366
pull_request:
types: [opened, reopened, synchronize, ready_for_review]
jobs:
test:
# Adapted from:
# https://code.visualstudio.com/api/working-with-extensions/continuous-integration#github-actions
name: Integration tests
environment: testing
strategy:
fail-fast: false
matrix:
os: [macos-latest, ubuntu-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: 22.x # LTS until Oct 2025
- run: npm install
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.13' # end of support: 2029-10
# hopefully, this can be cached in the future
# see: https://github.com/actions/setup-python/issues/991
- name: Install Mesa (Linux)
if: runner.os == 'Linux'
run: |
# Install OpenGL Mesa Utils
# https://idroot.us/install-mesa-drivers-ubuntu-24-04/
sudo add-apt-repository ppa:kisak/kisak-mesa
sudo apt-get update
sudo apt-get install mesa-utils -y
# Install Pango
sudo apt-get install libpango1.0-dev -y
# Work around 'NoneType' object has no attribute 'glGetError'
# https://github.com/MPI-IS/mesh/issues/23#issuecomment-607784234
sudo apt-get install python3-opengl
# Install copy-paste mechanism to avoid ClipboardUnavailable errors
# (python pyperclip makes use of xclip on Linux)
sudo apt-get install xclip -y
- name: Install Mesa (MinGW, Windows)
if: runner.os == 'Windows'
run: |
# Install OpenGL pre-built Mesa binaries from mesa-dist-win
Invoke-WebRequest -Uri https://github.com/pal1000/mesa-dist-win/releases/download/24.3.2/mesa3d-24.3.2-release-mingw.7z -OutFile mesa3d.7z
# Extract (on purpose no space between -o and mesa3d)
7z x mesa3d.7z -omesa3d
# Install system-wide (option 1: core desktop OpenGL drivers)
.\mesa3d\systemwidedeploy.cmd 1
- name: Test OpenGL
run: |
if [ "$RUNNER_OS" == "Linux" ]; then
xvfb-run -a glxinfo | grep "OpenGL version"
elif [ "$RUNNER_OS" == "macOS" ]; then
echo "We don't know a way to install the glxinfo command on macOS,"
echo "so we can't check the OpenGL version :("
elif [ "$RUNNER_OS" == "Windows" ]; then
# Download wglinfo (analogous to glxinfo)
curl -L -O https://github.com/gkv311/wglinfo/releases/latest/download/wglinfo64.exe
chmod +x wglinfo64.exe
./wglinfo64.exe | grep "OpenGL version"
else
echo "Unknown OS"
exit 1
fi
shell: bash
- name: Install Manim (pretest)
run: |
if [ "$RUNNER_OS" == "Linux" ]; then
xvfb-run -a npm run pretest
else
npm run pretest
fi
shell: bash
- name: Run tests
run: |
if [ "$RUNNER_OS" == "Linux" ]; then
# Start an X virtual framebuffer (Xvfb) server, which emulates a
# display server without requiring a physical display.
xvfb-run -a npm run testInGithubActions
else
npm run testInGithubActions
fi
shell: bash