forked from panda3d/panda3d
-
Notifications
You must be signed in to change notification settings - Fork 0
768 lines (688 loc) · 28.8 KB
/
Copy pathci.yml
File metadata and controls
768 lines (688 loc) · 28.8 KB
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
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
name: Continuous Integration
on: [push, pull_request]
jobs:
cmake:
name: CMake Buildsystem
if: "!contains(github.event.head_commit.message, '[skip ci]') && !contains(github.event.head_commit.message, '[ci skip]')"
strategy:
fail-fast: false
matrix:
profile:
- ubuntu-bionic-double-standard-unity-makefile
- ubuntu-bionic-coverage-ninja
- macos-coverage-unity-xcode
- macos-nometa-standard-makefile
- windows-standard-unity-msvc
- windows-nopython-nometa-standard-msvc
include:
- profile: ubuntu-bionic-double-standard-unity-makefile
os: ubuntu-24.04
config: Standard
unity: YES
generator: Unix Makefiles
compiler: Default
metalibs: YES
python: YES
eigen: NO
double: YES
asan: YES
- profile: ubuntu-bionic-coverage-ninja
os: ubuntu-24.04
config: Coverage
unity: NO
generator: Ninja
compiler: Clang
metalibs: YES
python: YES
eigen: NO
double: NO
asan: YES
- profile: macos-coverage-unity-xcode
os: macOS-15
config: Coverage
unity: YES
generator: Xcode
compiler: Default
metalibs: YES
python: YES
eigen: NO
double: NO
- profile: macos-nometa-standard-makefile
os: macOS-15
config: Standard
unity: NO
generator: Unix Makefiles
compiler: Default
metalibs: NO
python: YES
eigen: NO
double: NO
asan: YES
- profile: windows-standard-unity-msvc
os: windows-2022
config: Standard
unity: YES
generator: Visual Studio 17 2022
compiler: Default
metalibs: YES
python: YES
eigen: NO
double: NO
- profile: windows-nopython-nometa-standard-msvc
os: windows-2022
config: Standard
unity: NO
generator: Visual Studio 17 2022
compiler: Default
metalibs: NO
python: NO
eigen: NO
double: NO
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v7
with:
fetch-depth: 10
- name: Self-destruct makepanda
run: python3 makepanda/selfdestruct.py --yes
- name: Install dependencies (macOS)
if: runner.os == 'macOS'
run: |
curl -O https://www.panda3d.org/download/panda3d-1.10.16/panda3d-1.10.16-tools-mac.tar.gz
tar -xf panda3d-1.10.16-tools-mac.tar.gz
mv panda3d-1.10.16/thirdparty thirdparty
rmdir panda3d-1.10.16
# Temporary hack so that pzip can run, since we are about to remove Cg anyway.
install_name_tool -id "$(pwd)/thirdparty/darwin-libs-a/nvidiacg/lib/libCg.dylib" thirdparty/darwin-libs-a/nvidiacg/lib/libCg.dylib
brew install ccache
- name: Set up XCode (macOS)
if: runner.os == 'macOS'
run: sudo xcode-select -s /Applications/Xcode_16.app/Contents/Developer
- name: Install dependencies (Ubuntu)
if: startsWith(matrix.os, 'ubuntu')
run: >
sudo apt-get update
sudo apt-get install
build-essential ninja-build clang llvm ccache
bison flex
libeigen3-dev libfreetype6-dev libjpeg-dev libode-dev
libopenal-dev libpng-dev libssl-dev libvorbis-dev libx11-dev
libxcursor-dev libxrandr-dev nvidia-cg-toolkit zlib1g-dev
libgl1-mesa-dev libegl1-mesa-dev libgl1-mesa-dri mesa-utils-extra
python3-setuptools python3-tk
- name: Cache dependencies (Windows)
if: runner.os == 'Windows'
uses: actions/cache@v5
with:
path: thirdparty
key: ci-cmake-${{ runner.OS }}-thirdparty-v1.10.16-r1
- name: Install dependencies (Windows)
if: runner.os == 'Windows'
shell: bash
run: |
if [ ! -d thirdparty/win-libs-vc14-x64 ]; then
curl --retry 5 --retry-delay 10 --retry-all-errors -fLo thirdparty-tools.zip "https://www.panda3d.org/download/panda3d-1.10.16/panda3d-1.10.16-tools-win64.zip"
unzip -q thirdparty-tools.zip -d thirdparty-tools
mv thirdparty-tools/panda3d-1.10.16/thirdparty .
fi
- name: ccache (non-Windows)
if: runner.os != 'Windows'
uses: actions/cache@v5
with:
path: ccache
key: ci-cmake-ccache-${{ matrix.profile }}
- name: Configure
shell: bash
env:
CMAKE_GENERATOR: "${{ matrix.generator }}"
run: >
mkdir -p build
cd build
if ${{ matrix.compiler == 'Clang' }}; then
if [[ "$CMAKE_GENERATOR" =~ Studio.+20(19|22) ]]; then
export CMAKE_GENERATOR_TOOLSET=ClangCL
elif [[ "$CMAKE_GENERATOR" == *Studio* ]]; then
export CMAKE_GENERATOR_TOOLSET=LLVM
else
export CC=clang CXX=clang++
fi
fi
if ${{ runner.os != 'Windows' }}; then
compilerLauncher=$(echo -DCMAKE_C{,XX}_COMPILER_LAUNCHER=ccache)
export CCACHE_DIR="$(dirname $PWD)/ccache"
echo "CCACHE_DIR=$(dirname $PWD)/ccache" >> $GITHUB_ENV
fi
cmake
${compilerLauncher:-}
-D CMAKE_UNITY_BUILD=${{ matrix.unity }}
-D CMAKE_BUILD_TYPE="${{ matrix.config }}"
-D BUILD_METALIBS=${{ matrix.metalibs }}
-D HAVE_PYTHON=${{ runner.os != 'Windows' && matrix.python || 'NO' }}
-D HAVE_EIGEN=${{ matrix.eigen }}
-D STDFLOAT_DOUBLE=${{ matrix.double }}
-D ENABLE_ASAN=${{ matrix.asan || 'NO' }}
..
echo "$PWD/${{ matrix.config }}/bin" >> $GITHUB_PATH
echo "$PWD/bin" >> $GITHUB_PATH
- name: Configure headless OpenGL
if: matrix.os == 'ubuntu-24.04'
run: |
echo "LIBGL_ALWAYS_SOFTWARE=1" >> $GITHUB_ENV
echo "EGL_PLATFORM=surfaceless" >> $GITHUB_ENV
echo "EGL_LOG_LEVEL=debug" >> $GITHUB_ENV
mkdir -p build/etc/panda3d
echo "load-display p3headlessgl" >> build/etc/panda3d/10_ci.prc
eglinfo || true
- name: Build (no Python)
if: contains(matrix.python, 'NO')
# BEGIN A
working-directory: build
run: cmake --build . --config ${{ matrix.config }} --parallel 4
# END A
- name: Setup Python (Python 3.8)
if: contains(matrix.python, 'YES')
uses: actions/setup-python@v6
with:
python-version: '3.8'
- name: Configure (Python 3.8)
if: contains(matrix.python, 'YES')
working-directory: build
shell: bash
run: >
cmake -DWANT_PYTHON_VERSION=3.8 -DHAVE_PYTHON=YES
-DPython_FIND_REGISTRY=NEVER -DPython_ROOT="$pythonLocation" .
- name: Build (Python 3.8)
if: contains(matrix.python, 'YES')
# BEGIN A
working-directory: build
run: cmake --build . --config ${{ matrix.config }} --parallel 4
# END A
- name: Test (Python 3.8)
# BEGIN B
if: contains(matrix.python, 'YES')
working-directory: build
shell: bash
env:
PYTHONPATH: ${{ matrix.config }}
ASAN_OPTIONS: detect_leaks=0:detect_odr_violation=0:log_path=asan.log.py38
run: |
PYTHON_EXECUTABLE=$(grep 'Python_EXECUTABLE:' CMakeCache.txt | sed 's/.*=//')
$PYTHON_EXECUTABLE -m pip install -r ../requirements-test.txt
export COVERAGE_FILE=.coverage.$RANDOM LLVM_PROFILE_FILE=$PWD/pid-%p.profraw
run_pytest ../tests --cov=.
# END B
- name: Setup Python (Python 3.9)
if: contains(matrix.python, 'YES')
uses: actions/setup-python@v6
with:
python-version: '3.9'
- name: Configure (Python 3.9)
if: contains(matrix.python, 'YES')
working-directory: build
shell: bash
run: >
cmake -DWANT_PYTHON_VERSION=3.9 -DHAVE_PYTHON=YES
-DPython_FIND_REGISTRY=NEVER -DPython_ROOT="$pythonLocation" .
- name: Build (Python 3.9)
if: contains(matrix.python, 'YES')
# BEGIN A
working-directory: build
run: cmake --build . --config ${{ matrix.config }} --parallel 4
# END A
- name: Test (Python 3.9)
# BEGIN B
if: contains(matrix.python, 'YES')
working-directory: build
shell: bash
env:
PYTHONPATH: ${{ matrix.config }}
ASAN_OPTIONS: detect_leaks=0:detect_odr_violation=0:log_path=asan.log.py39
run: |
PYTHON_EXECUTABLE=$(grep 'Python_EXECUTABLE:' CMakeCache.txt | sed 's/.*=//')
$PYTHON_EXECUTABLE -m pip install -r ../requirements-test.txt
export COVERAGE_FILE=.coverage.$RANDOM LLVM_PROFILE_FILE=$PWD/pid-%p.profraw
run_pytest ../tests --cov=.
# END B
- name: Setup Python (Python 3.10)
if: contains(matrix.python, 'YES')
uses: actions/setup-python@v6
with:
python-version: '3.10'
- name: Configure (Python 3.10)
if: contains(matrix.python, 'YES')
working-directory: build
shell: bash
run: >
cmake -DWANT_PYTHON_VERSION=3.10 -DHAVE_PYTHON=YES
-DPython_FIND_REGISTRY=NEVER -DPython_ROOT="$pythonLocation" .
- name: Build (Python 3.10)
if: contains(matrix.python, 'YES')
# BEGIN A
working-directory: build
run: cmake --build . --config ${{ matrix.config }} --parallel 4
# END A
- name: Test (Python 3.10)
# BEGIN B
if: contains(matrix.python, 'YES')
working-directory: build
shell: bash
env:
PYTHONPATH: ${{ matrix.config }}
ASAN_OPTIONS: detect_leaks=0:detect_odr_violation=0:log_path=asan.log.py310
run: |
PYTHON_EXECUTABLE=$(grep 'Python_EXECUTABLE:' CMakeCache.txt | sed 's/.*=//')
$PYTHON_EXECUTABLE -m pip install -r ../requirements-test.txt
export COVERAGE_FILE=.coverage.$RANDOM LLVM_PROFILE_FILE=$PWD/pid-%p.profraw
run_pytest ../tests --cov=.
# END B
- name: Setup Python (Python 3.11)
if: contains(matrix.python, 'YES')
uses: actions/setup-python@v6
with:
python-version: '3.11'
- name: Configure (Python 3.11)
if: contains(matrix.python, 'YES')
working-directory: build
shell: bash
run: >
cmake -DWANT_PYTHON_VERSION=3.11 -DHAVE_PYTHON=YES
-DPython_FIND_REGISTRY=NEVER -DPython_ROOT="$pythonLocation" .
- name: Build (Python 3.11)
if: contains(matrix.python, 'YES')
# BEGIN A
working-directory: build
run: cmake --build . --config ${{ matrix.config }} --parallel 4
# END A
- name: Test (Python 3.11)
# BEGIN B
if: contains(matrix.python, 'YES')
working-directory: build
shell: bash
env:
PYTHONPATH: ${{ matrix.config }}
ASAN_OPTIONS: detect_leaks=0:detect_odr_violation=0:log_path=asan.log.py311
run: |
PYTHON_EXECUTABLE=$(grep 'Python_EXECUTABLE:' CMakeCache.txt | sed 's/.*=//')
$PYTHON_EXECUTABLE -m pip install -r ../requirements-test.txt
export COVERAGE_FILE=.coverage.$RANDOM LLVM_PROFILE_FILE=$PWD/pid-%p.profraw
run_pytest ../tests --cov=.
# END B
- name: Setup Python (Python 3.12)
if: contains(matrix.python, 'YES')
uses: actions/setup-python@v6
with:
python-version: '3.12'
- name: Configure (Python 3.12)
if: contains(matrix.python, 'YES')
working-directory: build
shell: bash
run: >
cmake -DWANT_PYTHON_VERSION=3.12 -DHAVE_PYTHON=YES
-DPython_FIND_REGISTRY=NEVER -DPython_ROOT="$pythonLocation" .
- name: Build (Python 3.12)
if: contains(matrix.python, 'YES')
# BEGIN A
working-directory: build
run: cmake --build . --config ${{ matrix.config }} --parallel 4
# END A
- name: Test (Python 3.12)
# BEGIN B
if: contains(matrix.python, 'YES')
working-directory: build
shell: bash
env:
PYTHONPATH: ${{ matrix.config }}
ASAN_OPTIONS: detect_leaks=0:detect_odr_violation=0:log_path=asan.log.py312
run: |
PYTHON_EXECUTABLE=$(grep 'Python_EXECUTABLE:' CMakeCache.txt | sed 's/.*=//')
$PYTHON_EXECUTABLE -m pip install -r ../requirements-test.txt
export COVERAGE_FILE=.coverage.$RANDOM LLVM_PROFILE_FILE=$PWD/pid-%p.profraw
run_pytest ../tests --cov=.
# END B
- name: Show ASan errors
if: failure() && contains(matrix.asan, 'YES')
working-directory: build
run: |
ls -lAh asan.log.* || true
if cat asan.log.* 2>/dev/null | grep -q .; then
echo '### Address Sanitizer Report' >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY
cat asan.log.* >> $GITHUB_STEP_SUMMARY 2>/dev/null || echo "No ASan errors found"
echo '```' >> $GITHUB_STEP_SUMMARY
fi
- name: Upload coverage reports
if: always() && matrix.config == 'Coverage'
working-directory: build
shell: bash
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
run: |
shopt -s expand_aliases
if ${{ runner.os == 'macOS' }}; then alias llvm-profdata='xcrun llvm-profdata' llvm-cov='xcrun llvm-cov'; fi
python -m pip install coverage
python -m coverage combine $(find . -name '.coverage.*')
TOTAL=$(python -m coverage report --format=total)
echo '### Coverage Report' >> $GITHUB_STEP_SUMMARY
echo "<details><summary>Coverage: <b>${TOTAL}%</b></summary>" >> $GITHUB_STEP_SUMMARY
echo '' >> $GITHUB_STEP_SUMMARY
python -m coverage report --format=markdown >> $GITHUB_STEP_SUMMARY
echo '</details>' >> $GITHUB_STEP_SUMMARY
llvm-profdata merge pid-*.profraw -o coverage.profdata
llvm-cov show $(grep -Rl LLVM_PROFILE_FILE . | sed 's/^/-object /') -instr-profile=coverage.profdata > coverage.txt
bash <(curl -s https://codecov.io/bash) -y ../.github/codecov.yml
makepanda:
if: "!contains(github.event.head_commit.message, '[skip ci]') && !contains(github.event.head_commit.message, '[ci skip]')"
strategy:
matrix:
os: [ubuntu-24.04, windows-2022, macOS-15]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v7
- name: Install dependencies (Ubuntu)
if: matrix.os == 'ubuntu-24.04'
run: |
sudo apt-get update
sudo apt-get install build-essential bison flex libfreetype6-dev libgl1-mesa-dev libegl1-mesa-dev libgl1-mesa-dri mesa-utils-extra libjpeg-dev libode-dev libopenal-dev libpng-dev libssl-dev libvorbis-dev libx11-dev libxcursor-dev libxrandr-dev nvidia-cg-toolkit zlib1g-dev
- name: Cache thirdparty packages (Windows)
if: runner.os == 'Windows'
uses: actions/cache@v5
with:
path: thirdparty
key: ci-makepanda-${{ runner.OS }}-thirdparty-v1.10.16
- name: Get thirdparty packages (Windows)
if: runner.os == 'Windows'
shell: bash
run: |
if [ ! -d thirdparty/win-libs-vc14-x64 ]; then
curl --retry 5 --retry-delay 10 --retry-all-errors -fLo thirdparty-tools.zip "https://www.panda3d.org/download/panda3d-1.10.16/panda3d-1.10.16-tools-win64.zip"
unzip -q thirdparty-tools.zip -d thirdparty-tools
mv thirdparty-tools/panda3d-1.10.16/thirdparty .
fi
- name: Get thirdparty packages (macOS)
if: runner.os == 'macOS'
run: |
curl -O https://www.panda3d.org/download/panda3d-1.10.16/panda3d-1.10.16-tools-mac.tar.gz
tar -xf panda3d-1.10.16-tools-mac.tar.gz
mv panda3d-1.10.16/thirdparty thirdparty
rmdir panda3d-1.10.16
(cd thirdparty/darwin-libs-a && rm -rf rocket)
(cd thirdparty/darwin-libs-a && rm -rf openexr)
- name: Set up XCode (macOS)
if: runner.os == 'macOS'
run: sudo xcode-select -s /Applications/Xcode_16.app/Contents/Developer
- name: Configure headless OpenGL
if: matrix.os == 'ubuntu-24.04'
run: |
echo "LIBGL_ALWAYS_SOFTWARE=1" >> $GITHUB_ENV
echo "EGL_PLATFORM=surfaceless" >> $GITHUB_ENV
echo "EGL_LOG_LEVEL=debug" >> $GITHUB_ENV
mkdir -p built/etc
mkdir -p built_dbl/etc
echo "load-display p3headlessgl" >> built/etc/ci.prc
echo "load-display p3headlessgl" >> built_dbl/etc/ci.prc
- name: Set up Python 3.13
uses: actions/setup-python@v6
with:
python-version: '3.13'
- name: Build Python 3.13
shell: bash
run: |
python makepanda/makepanda.py --git-commit=${{github.sha}} --outputdir=built --everything --no-eigen --python-incdir="$pythonLocation/include" --python-libdir="$pythonLocation/lib" --verbose --threads=4 --windows-sdk=10 --msvc-version=14.3
- name: Test Python 3.13
shell: bash
run: |
python -m pip install -r requirements-test.txt
PYTHONPATH=built LD_LIBRARY_PATH=built/lib:$pythonLocation/lib DYLD_LIBRARY_PATH=built/lib python -m pytest
- name: Set up Python 3.12
uses: actions/setup-python@v6
with:
python-version: '3.12'
- name: Build Python 3.12 (double)
shell: bash
run: |
python makepanda/makepanda.py --override STDFLOAT_DOUBLE=1 --git-commit=${{github.sha}} --outputdir=built_dbl --everything --no-eigen --python-incdir="$pythonLocation/include" --python-libdir="$pythonLocation/lib" --verbose --threads=4 --windows-sdk=10 --msvc-version=14.3
- name: Test Python 3.12 (double)
shell: bash
run: |
python -m pip install -r requirements-test.txt
PYTHONPATH=built_dbl LD_LIBRARY_PATH=built_dbl/lib:$pythonLocation/lib DYLD_LIBRARY_PATH=built_dbl/lib python -m pytest
- name: Make installer
run: |
python makepanda/makepackage.py --verbose --lzma --outputdir=built_dbl
- name: Set up Python 3.11
uses: actions/setup-python@v6
with:
python-version: '3.11'
- name: Build Python 3.11
shell: bash
run: |
python makepanda/makepanda.py --git-commit=${{github.sha}} --outputdir=built --everything --no-eigen --python-incdir="$pythonLocation/include" --python-libdir="$pythonLocation/lib" --verbose --threads=4 --windows-sdk=10 --msvc-version=14.3
- name: Test Python 3.11
shell: bash
run: |
python -m pip install -r requirements-test.txt
PYTHONPATH=built LD_LIBRARY_PATH=built/lib:$pythonLocation/lib DYLD_LIBRARY_PATH=built/lib python -m pytest
- name: Set up Python 3.10
uses: actions/setup-python@v6
with:
python-version: '3.10'
- name: Build Python 3.10
shell: bash
run: |
python makepanda/makepanda.py --git-commit=${{github.sha}} --outputdir=built --everything --no-eigen --python-incdir="$pythonLocation/include" --python-libdir="$pythonLocation/lib" --verbose --threads=4 --windows-sdk=10 --msvc-version=14.3
- name: Test Python 3.10
shell: bash
run: |
python -m pip install -r requirements-test.txt
PYTHONPATH=built LD_LIBRARY_PATH=built/lib:$pythonLocation/lib DYLD_LIBRARY_PATH=built/lib python -m pytest
- name: Set up Python 3.9
uses: actions/setup-python@v6
with:
python-version: '3.9'
- name: Build Python 3.9
shell: bash
run: |
python makepanda/makepanda.py --git-commit=${{github.sha}} --outputdir=built --everything --no-eigen --python-incdir="$pythonLocation/include" --python-libdir="$pythonLocation/lib" --verbose --threads=4 --windows-sdk=10 --msvc-version=14.3
- name: Test Python 3.9
shell: bash
run: |
python -m pip install -r requirements-test.txt
PYTHONPATH=built LD_LIBRARY_PATH=built/lib:$pythonLocation/lib DYLD_LIBRARY_PATH=built/lib python -m pytest
- name: Set up Python 3.8
uses: actions/setup-python@v6
with:
python-version: '3.8'
- name: Build Python 3.8
shell: bash
run: |
python makepanda/makepanda.py --git-commit=${{github.sha}} --outputdir=built --everything --no-eigen --python-incdir="$pythonLocation/include" --python-libdir="$pythonLocation/lib" --verbose --threads=4 --windows-sdk=10 --msvc-version=14.3
- name: Test Python 3.8
shell: bash
run: |
python -m pip install -r requirements-test.txt
PYTHONPATH=built LD_LIBRARY_PATH=built/lib:$pythonLocation/lib DYLD_LIBRARY_PATH=built/lib python -m pytest
- name: Make installer
run: |
python makepanda/makepackage.py --verbose --lzma
emscripten:
if: "!contains(github.event.head_commit.message, '[skip ci]') && !contains(github.event.head_commit.message, '[ci skip]')"
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v7
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install build-essential ninja-build bison flex nodejs python3-pip
- name: Setup emsdk
uses: mymindstorm/setup-emsdk@v14
with:
version: 4.0.2
actions-cache-folder: 'emsdk-cache'
- name: Restore Python build cache
id: cache-emscripten-python-restore
uses: actions/cache/restore@v5
with:
path: ~/python
key: cache-emscripten-python-3.12.8
- name: Build Python 3.12
if: steps.cache-emscripten-python-restore.outputs.cache-hit != 'true'
run: |
wget https://www.python.org/ftp/python/3.12.8/Python-3.12.8.tar.xz
tar -xJf Python-3.12.8.tar.xz
(cd Python-3.12.8 && EM_CONFIG=$EMSDK/.emscripten python3 Tools/wasm/wasm_build.py emscripten-browser)
(cd Python-3.12.8/builddir/emscripten-browser && make install DESTDIR=~/python)
cp Python-3.12.8/builddir/emscripten-browser/Modules/_hacl/libHacl_Hash_SHA2.a ~/python/usr/local/lib
cp Python-3.12.8/builddir/emscripten-browser/Modules/_decimal/libmpdec/libmpdec.a ~/python/usr/local/lib
cp Python-3.12.8/builddir/emscripten-browser/Modules/expat/libexpat.a ~/python/usr/local/lib
rm -rf Python-3.12.8
- name: Save Python build cache
id: cache-emscripten-python-save
if: steps.cache-emscripten-python-restore.outputs.cache-hit != 'true'
uses: actions/cache/save@v5
with:
path: ~/python
key: ${{ steps.cache-emscripten-python-restore.outputs.cache-primary-key }}
- name: Build for Emscripten
shell: bash
run: |
python3 makepanda/makepanda.py --git-commit=${{github.sha}} --target emscripten --python-incdir=~/python/usr/local/include --python-libdir=~/python/usr/local/lib --static --everything --no-pandatool --no-deploytools --verbose --threads=4
- name: Install test dependencies
shell: bash
run: |
python3 -m pip install -t ~/python/usr/local/lib/python3.12/site-packages -r requirements-test.txt
- name: Test in node.js
shell: bash
run: |
PYTHONHOME=~/python/usr/local PYTHONPATH=built node built/bin/run_tests.js tests
android:
if: "!contains(github.event.head_commit.message, '[skip ci]') && !contains(github.event.head_commit.message, '[ci skip]')"
strategy:
fail-fast: false
matrix:
include:
- android-abi: arm64-v8a
android-arch: arm64
android-triple: aarch64-linux-android
ndk-version: 29.0.14206865
runner: ubuntu-latest
- android-abi: armeabi-v7a
android-arch: arm
android-triple: arm-linux-androideabi
ndk-version: 29.0.14206865
runner: ubuntu-latest
- android-abi: x86_64
android-arch: x86_64
android-triple: x86_64-linux-android
ndk-version: 29.0.14206865
runner: ubuntu-latest
- android-abi: x86
android-arch: x86
android-triple: i686-linux-android
ndk-version: 29.0.14206865
runner: ubuntu-latest
runs-on: ${{ matrix.runner }}
steps:
- uses: actions/checkout@v7
- name: Setup Android SDK
uses: android-actions/setup-android@v4
with:
packages: 'tools platform-tools platforms;android-21 ndk;${{ matrix.ndk-version }}'
- name: Set up Android NDK
run: |
echo "ANDROID_NDK_ROOT=$ANDROID_SDK_ROOT/ndk/${{ matrix.ndk-version }}" >> $GITHUB_ENV
- uses: actions/setup-python@v6
with:
python-version: '3.13'
- name: Restore Python build cache
id: cache-android-python-restore
uses: actions/cache/restore@v5
with:
path: ~/python-prefix
key: cache-android-python-3.13.9-${{ matrix.android-abi }}-ndk${{ matrix.ndk-version }}
- name: Build Python 3.13
if: steps.cache-android-python-restore.outputs.cache-hit != 'true'
run: |
wget https://www.python.org/ftp/python/3.13.9/Python-3.13.9.tar.xz
tar -xJf Python-3.13.9.tar.xz
sed -i.bak "s/aarch64-linux-android/${{ matrix.android-triple }}/" Python-3.13.9/Android/android.py
sed -i.bak "s/ndk_version=[0-9.]\{1,\}/ndk_version=${{ matrix.ndk-version }}/" Python-3.13.9/Android/android-env.sh
(cd Python-3.13.9/Android && python3 android.py build ${{ matrix.android-triple }})
cp -R Python-3.13.9/cross-build/${{ matrix.android-triple }}/prefix ~/python-prefix
rm -rf Python-3.13.9
- name: Save Python build cache
id: cache-android-python-save
if: steps.cache-android-python-restore.outputs.cache-hit != 'true'
uses: actions/cache/save@v5
with:
path: ~/python-prefix
key: ${{ steps.cache-android-python-restore.outputs.cache-primary-key }}
- name: Restore thirdparty build cache
id: cache-android-thirdparty-restore
uses: actions/cache/restore@v5
with:
path: ./thirdparty
key: cache-android-thirdparty-935c80380ca171e08587c570e9dad678d29db3c8-${{ matrix.android-abi }}-ndk${{ matrix.ndk-version }}
- name: Install yasm
if: steps.cache-android-thirdparty-restore.outputs.cache-hit != 'true'
run: ${{runner.os == 'macOS' && 'brew' || 'sudo apt-get'}} install yasm
- name: Build thirdparty packages
if: steps.cache-android-thirdparty-restore.outputs.cache-hit != 'true'
run: |
git clone --revision=935c80380ca171e08587c570e9dad678d29db3c8 --depth=1 https://github.com/rdb/panda3d-thirdparty.git thirdparty
cd thirdparty
cmake -B build \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_TOOLCHAIN_FILE=$ANDROID_NDK_ROOT/build/cmake/android.toolchain.cmake \
-DCMAKE_ANDROID_ARCH_ABI=${{ matrix.android-abi }} \
-DCMAKE_ANDROID_ARCH=${{ matrix.android-arch }} \
-DCMAKE_SYSTEM_VERSION=21 \
-DANDROID_ABI=${{ matrix.android-abi }} \
-DANDROID_PLATFORM=android-21 \
-DBUILD_FCOLLADA=OFF \
-DBUILD_OPENSSL=OFF \
-DBUILD_VRPN=OFF \
-DBUILD_ARTOOLKIT=OFF
cmake --build build --config Release -j4
rm -rf build
- name: Save thirdparty build cache
id: cache-android-thirdparty-save
if: steps.cache-android-thirdparty-restore.outputs.cache-hit != 'true'
uses: actions/cache/save@v5
with:
path: ./thirdparty
key: ${{ steps.cache-android-thirdparty-restore.outputs.cache-primary-key }}
- name: Build for Android
shell: bash
run: |
python makepanda/makepanda.py --git-commit=${{github.sha}} --target android-21 --python-incdir=~/python-prefix/include --python-libdir=~/python-prefix/lib --arch ${{ matrix.android-arch }} --everything --no-openssl --no-tinydisplay --no-pandatool --verbose --threads=4
- name: Install test dependencies
shell: bash
run: |
python -m pip install -t ~/python-prefix/lib/python3.13/site-packages -r requirements-test.txt
- name: Enable KVM group perms
if: startsWith(matrix.runner, 'ubuntu')
run: |
echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules
sudo udevadm control --reload-rules
sudo udevadm trigger --name-match=kvm
- name: Setup Android Emulator and Run Tests
if: startsWith(matrix.android-abi, 'x86')
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: 27
arch: ${{ matrix.android-abi }}
target: default
profile: pixel_6
script: |
adb shell "rm -rf /data/local/tmp/panda3d-tests"
adb push built/bin/run_tests /data/local/tmp/panda3d-tests/run_tests
adb shell "mkdir /data/local/tmp/panda3d-tests/lib"
adb push built/lib/*.so /data/local/tmp/panda3d-tests/lib
adb push ~/python-prefix/lib/*.so /data/local/tmp/panda3d-tests/lib
adb push ~/python-prefix/lib/python3.13 /data/local/tmp/panda3d-tests/lib/python3.13
adb push built/panda3d /data/local/tmp/panda3d-tests/lib/python3.13/site-packages/
adb push built/direct /data/local/tmp/panda3d-tests/lib/python3.13/site-packages/
adb push built/models /data/local/tmp/panda3d-tests/models
adb push built/etc /data/local/tmp/panda3d-tests/etc
adb push tests /data/local/tmp/panda3d-tests/tests
adb shell "cd /data/local/tmp/panda3d-tests && LD_LIBRARY_PATH=/data/local/tmp/panda3d-tests/lib PYTHONPATH=/data/local/tmp/panda3d-tests/lib/python3.13/site-packages ./run_tests -v tests"