-
Notifications
You must be signed in to change notification settings - Fork 2.3k
976 lines (854 loc) · 32.6 KB
/
testing.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
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
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
name: Build and Test
on:
pull_request:
types: [opened, synchronize, reopened]
push:
branches:
- master
- rc-*
schedule:
- cron: '0 18 * * *' # For testing the offline cache, GMT 18 == GMT+8 02
concurrency:
group: ${{ github.event.number || github.run_id }}
cancel-in-progress: true
env:
TI_CI: "1"
TI_SKIP_VERSION_CHECK: 'ON'
TI_LITE_TEST: ${{ github.event_name == 'pull_request' && ! contains(github.event.pull_request.labels.*.name, 'full-ci') && ! startsWith(github.base_ref, 'rc-') && '1' || '' }}
TI_TEST_OFFLINE_CACHE: ${{ github.event.schedule == '0 18 * * *' && '1' || '' }}
CI_IMAGE_VERSION: '202305261112'
TI_USE_GIT_CACHE: ${{ vars.TI_USE_GIT_CACHE }}
jobs:
show_environ:
name: Show Environment Variables
# Disable this workflow on forks
if: github.repository_owner == 'taichi-dev'
runs-on: [self-hosted, Linux]
steps:
- name: Environment Variables
run: env
- name: Github Object
run: |
cat <<'EOF'
${{ toJson(github) }}
EOF
check_files:
name: Check files
# Disable this workflow on forks
if: github.repository_owner == 'taichi-dev'
outputs:
run_job: ${{ steps.check_files.outputs.run_job }}
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: '0'
- name: check modified files
id: check_files
run: |
echo "Concurrency group: ${{ github.event.number || github.run_id }}"
echo "=============== list modified files ==============="
git diff --name-only @^
chore_files=( LICENSE CONTRIBUTING.md README.md netlify.toml )
chore_dirs=( docs )
run_job=false
for file in $(git diff --name-only @^); do
is_chore=false
for chore_file in ${chore_files[*]}; do
[[ ${file} == ${chore_file} ]] && is_chore=true && break
done
for chore_dir in ${chore_dirs[*]}; do
[[ ${file} == ${chore_dir}/* ]] && is_chore=true && break
done
if ! ${is_chore}; then
run_job=true
break
fi
done
if ${run_job}; then
echo "run_job=true" >> $GITHUB_OUTPUT
else
echo "run_job=false" >> $GITHUB_OUTPUT
fi
check_static_analyzer:
name: Check Static Analyzer
runs-on: ubuntu-latest
needs: check_files
steps:
- uses: actions/checkout@v3
with:
submodules: 'recursive'
fetch-depth: '0'
- name: clang-tidy
run: |
if [[ ${{needs.check_files.outputs.run_job}} == false ]]; then
exit 0
fi
# https://docs.github.com/en/packages/managing-github-packages-using-github-actions-workflows/publishing-and-installing-a-package-with-github-actions#upgrading-a-workflow-that-accesses-ghcrio
echo $CR_PAT | docker login ghcr.io -u ${{ github.actor }} --password-stdin
docker pull ghcr.io/taichi-dev/taichidev-cpu-ubuntu18.04:v0.3.3
docker run -id --user dev --name check_clang_tidy ghcr.io/taichi-dev/taichidev-cpu-ubuntu18.04:v0.3.3 /bin/bash
tar -cf - ../${{ github.event.repository.name }} --mode u=+rwx,g=+rwx,o=+rwx --owner 1000 --group 1000 | docker cp - check_clang_tidy:/home/dev/
docker exec --user root check_clang_tidy apt-get update
docker exec --user root check_clang_tidy apt install -y clang-tidy-10 libx11-dev libxrandr-dev libxinerama-dev libxcursor-dev libxi-dev zlib1g-dev libglew-dev libglfw3-dev
docker exec --user dev check_clang_tidy /home/dev/taichi/.github/workflows/scripts/check_clang_tidy.sh "$CI_SETUP_CMAKE_ARGS"
env:
CR_PAT: ${{ secrets.GITHUB_TOKEN }}
CI_SETUP_CMAKE_ARGS: -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DTI_WITH_OPENGL:BOOL=ON -DTI_WITH_VULKAN:BOOL=ON -DTI_BUILD_TESTS:BOOL=ON -DTI_WITH_BACKTRACE:BOOL=ON
build_and_test_cpu_mac:
name: Build and Test macos (CPU)
needs: check_files
timeout-minutes: ${{ github.event.schedule != '0 18 * * *' && 120 || 180 }}
strategy:
matrix:
include:
- os: macos-10.15
python: 3.7
with_cpp_tests: ON
wanted_archs: 'cpu,vulkan'
runs-on:
- self-hosted
- ${{ matrix.os }}
env:
PY: ${{ matrix.python }}
TAICHI_CMAKE_ARGS: >-
-DTI_WITH_OPENGL:BOOL=OFF
-DTI_WITH_VULKAN:BOOL=ON
-DTI_WITH_C_API=ON
-DTI_BUILD_TESTS:BOOL=${{ matrix.with_cpp_tests }}
steps:
- name: Workaround checkout Needed single revision issue
run: git submodule foreach 'git rev-parse HEAD > /dev/null 2>&1 || rm -rf $PWD' || true
- uses: actions/checkout@v3
with:
fetch-depth: '0'
submodules: 'recursive'
- name: Prepare Environment
run: |
. .github/workflows/scripts/common-utils.sh
prepare-build-cache
env:
PLATFORM: 'macos'
- name: Build & Install
if: needs.check_files.outputs.run_job == 'true'
run: |
# Use the molten-vk v1.1.10 downloaded from taichi assets
brew uninstall molten-vk -f
.github/workflows/scripts/build.py
env:
CXX: clang++
# [DEBUG] Copy this step around to enable debugging inside Github Action instances.
#- name: Setup tmate session
# uses: mxschmitt/action-tmate@v3
# with:
# limit-access-to-actor: true
- name: Test
id: test
if: needs.check_files.outputs.run_job == 'true'
run: .github/workflows/scripts/unix_test.sh
env:
TI_WANTED_ARCHS: ${{ matrix.wanted_archs }}
TI_SKIP_CPP_TESTS: Disabled because Vulkan is supported but not working on buildbot4
- name: Save wheel if test failed
if: failure() && steps.test.conclusion == 'failure'
uses: actions/upload-artifact@v3
with:
name: broken-wheel
path: dist/*
retention-days: 7
build_and_test_gpu_linux:
name: Build and Test (GPU)
needs: check_files
timeout-minutes: ${{ github.event.schedule != '0 18 * * *' && 90 || 120 }}
strategy:
matrix:
extra_markers:
- sm70
- not sm70
driver:
- driver470
- driver510
runs-on:
- self-hosted
- cn
- cuda
- vulkan
- ${{ matrix.driver }}
- ${{ matrix.extra_markers == 'sm70' && 'sm70' || 'Linux' }}
env:
PY: '3.11'
PROJECT_NAME: taichi
TAICHI_CMAKE_ARGS: >-
-DTI_WITH_OPENGL:BOOL=ON
-DTI_WITH_VULKAN:BOOL=ON
-DTI_WITH_BACKTRACE:BOOL=ON
-DTI_BUILD_TESTS:BOOL=ON
TI_WANTED_ARCHS: 'cpu,cuda,vulkan,opengl,gles'
TI_DEVICE_MEMORY_GB: '1'
TI_RUN_RELEASE_TESTS: '1'
steps:
- name: Restart X Server
run: |
sudo systemctl restart xorg
- name: Workaround checkout Needed single revision issue
run: git submodule foreach 'git rev-parse HEAD > /dev/null 2>&1 || rm -rf $PWD' || true
- uses: actions/checkout@v3
with:
submodules: 'recursive'
fetch-depth: '0'
- name: Prepare Environment
run: |
. .github/workflows/scripts/common-utils.sh
prepare-build-cache
echo CI_DOCKER_RUN_EXTRA_ARGS="-v $(pwd):/home/dev/taichi" >> $GITHUB_ENV
- name: Build & Install
run: |
[[ ${{needs.check_files.outputs.run_job}} == false ]] && exit 0
. .github/workflows/scripts/common-utils.sh
ci-docker-run-gpu --name taichi-build \
registry.botmaster.tgr/taichi-build-cuda:${{ env.CI_IMAGE_VERSION }} \
/home/dev/taichi/.github/workflows/scripts/build.py
- name: Test
id: test
run: |
[[ ${{needs.check_files.outputs.run_job}} == false ]] && exit 0
. .github/workflows/scripts/common-utils.sh
ci-docker-run-gpu --name taichi-test \
registry.botmaster.tgr/taichi-test-cuda:${{ env.CI_IMAGE_VERSION }} \
/home/dev/taichi/.github/workflows/scripts/unix_test.sh
env:
EXTRA_TEST_MARKERS: ${{ matrix.extra_markers }}
- name: Save wheel if test failed
if: failure() && steps.test.conclusion == 'failure'
uses: actions/upload-artifact@v3
with:
name: broken-wheel
path: dist/*
retention-days: 7
- name: Save Bad Captures
if: failure() && steps.test.conclusion == 'failure'
uses: actions/upload-artifact@v3
with:
name: bad-captures
path: taichi-release-tests/bad-compare/*
retention-days: 7
build_and_test_manylinux2014:
name: Build and Test (manylinux2014)
needs: check_files
runs-on: [self-hosted, cuda, cn, release]
env:
PY: "3.8"
PROJECT_NAME: taichi
TI_WANTED_ARCHS: "cuda,cpu"
TAICHI_CMAKE_ARGS: >-
-DTI_WITH_OPENGL:BOOL=OFF
-DTI_WITH_VULKAN:BOOL=OFF
-DTI_BUILD_TESTS:BOOL=ON
steps:
- name: Restart X Server
run: |
sudo systemctl restart xorg
- uses: actions/checkout@v3
with:
submodules: 'recursive'
fetch-depth: '0'
- name: Prepare Environment
run: |
. .github/workflows/scripts/common-utils.sh
prepare-build-cache
echo CI_DOCKER_RUN_EXTRA_ARGS="-v $(pwd):/home/dev/taichi" >> $GITHUB_ENV
- name: Build
run: |
. .github/workflows/scripts/common-utils.sh
ci-docker-run-gpu --name taichi-test \
registry.botmaster.tgr/taichi-build-manylinux2014-cuda:${{ env.CI_IMAGE_VERSION }} \
/home/dev/taichi/.github/workflows/scripts/build.py
- name: Test
run: |
. .github/workflows/scripts/common-utils.sh
ci-docker-run-gpu --name taichi-test \
registry.botmaster.tgr/taichi-test-manylinux2014-cuda:${{ env.CI_IMAGE_VERSION }} \
/home/dev/taichi/.github/workflows/scripts/unix_test.sh
build_and_test_amdgpu_linux:
name: Build and Test (AMDGPU)
needs: check_files
timeout-minutes: ${{ github.event.schedule != '0 18 * * *' && 90 || 120 }}
runs-on: [self-hosted, amdgpu]
env:
PY: '3.8'
PROJECT_NAME: taichi
TI_WANTED_ARCHS: 'cpu,amdgpu'
TI_DEVICE_MEMORY_GB: '1'
TI_RUN_RELEASE_TESTS: '0'
TAICHI_CMAKE_ARGS: >-
-DTI_WITH_CUDA:BOOL=OFF
-DTI_WITH_VULKAN:BOOL=OFF
-DTI_WITH_OPENGL:BOOL=OFF
-DTI_BUILD_TESTS:BOOL=ON
-DTI_WITH_AMDGPU:BOOL=ON
steps:
- name: Workaround checkout Needed single revision issue
run: git submodule foreach 'git rev-parse HEAD > /dev/null 2>&1 || rm -rf $PWD' || true
- uses: actions/checkout@v3
with:
submodules: 'recursive'
fetch-depth: '0'
- name: Prepare Environment
run: |
. .github/workflows/scripts/common-utils.sh
prepare-build-cache
echo CI_DOCKER_RUN_EXTRA_ARGS="-v $(pwd):/home/dev/taichi" >> $GITHUB_ENV
- name: Build & Install
run: |
[[ ${{needs.check_files.outputs.run_job}} == false ]] && exit 0
. .github/workflows/scripts/common-utils.sh
ci-docker-run-amdgpu --name taichi-build \
registry.botmaster.tgr/taichi-build-amdgpu:${{ env.CI_IMAGE_VERSION }} \
/home/dev/taichi/.github/workflows/scripts/build.py
- name: Test
id: test
run: |
[[ ${{needs.check_files.outputs.run_job}} == false ]] && exit 0
. .github/workflows/scripts/common-utils.sh
ci-docker-run-amdgpu --name taichi-test \
registry.botmaster.tgr/taichi-test-amdgpu:${{ env.CI_IMAGE_VERSION }} \
/home/dev/taichi/.github/workflows/scripts/unix_test.sh
- name: Save wheel if test failed
if: failure() && steps.test.conclusion == 'failure'
uses: actions/upload-artifact@v3
with:
name: broken-wheel
path: dist/*
retention-days: 7
- name: Save Bad Captures
if: failure() && steps.test.conclusion == 'failure'
uses: actions/upload-artifact@v3
with:
name: bad-captures
path: taichi-release-tests/bad-compare/*
retention-days: 7
build_and_test_windows:
name: Build and Test Windows
needs: check_files
strategy:
matrix:
extra_markers:
- sm70
- not sm70
runs-on:
- self-hosted
- cn
- windows
- cuda
- OpenGL
- ${{ matrix.extra_markers == 'sm70' && 'sm70' || 'windows' }}
timeout-minutes: ${{ github.event.schedule != '0 18 * * *' && 90 || 180 }}
env:
PY: "3.7"
TAICHI_CMAKE_ARGS: >-
-DTI_WITH_OPENGL:BOOL=ON
-DTI_WITH_VULKAN:BOOL=ON
-DTI_WITH_DX11:BOOL=ON
-DTI_WITH_DX12:BOOL=ON
-DTI_BUILD_TESTS:BOOL=ON
-DTI_WITH_BACKTRACE=ON
-DTI_WITH_C_API=ON
TI_WANTED_ARCHS: cpu,cuda,vulkan,opengl,gles
TI_SKIP_VERSION_CHECK: ON
TI_DEVICE_MEMORY_GB: '1'
TI_RUN_RELEASE_TESTS: '1'
steps:
- name: Workaround checkout Needed single revision issue
run: |
git config --system core.longpaths true
git submodule foreach 'git rev-parse HEAD > /dev/null 2>&1 || rm -rf $PWD' # no '|| true' here
- uses: actions/checkout@v3
with:
fetch-depth: '0'
submodules: 'recursive'
- uses: actions/setup-python@v4
with:
python-version: 3.7
- name: Build
if: ${{ needs.check_files.outputs.run_job != 'false' }}
shell: cmd
run: |
python .\.github\workflows\scripts\build.py
- name: Test
id: test
shell: pwsh
if: ${{ needs.check_files.outputs.run_job != 'false' }}
run: |
.\.github\workflows\scripts\win_test.ps1 -libsDir "$env:LocalAppData/buildbot"
env:
EXTRA_TEST_MARKERS: ${{ matrix.extra_markers }}
- name: Save wheel if test failed
if: failure() && steps.test.conclusion == 'failure'
uses: actions/upload-artifact@v3
with:
name: broken-wheel
path: dist/*
retention-days: 7
- name: Cleanup Git Cache Configs
shell: pwsh
if: always()
run: |
. .github/workflows/scripts/common-utils.ps1
UnsetGitCachingProxy
exit 0
build_and_test_m1:
name: Build and Test (Apple M1)
needs: check_files
timeout-minutes: ${{ github.event.schedule != '0 18 * * *' && 60 || 120 }}
strategy:
matrix:
include:
- os: macos-latest
python: 3.8
defaults:
run:
# https://github.com/actions/runner/issues/805#issuecomment-844426478
shell: '/usr/bin/arch -arch arm64e /bin/bash --noprofile --norc -eo pipefail {0}'
runs-on: [self-hosted, m1]
env:
CXX: clang++
PY: ${{ matrix.python }}
TAICHI_CMAKE_ARGS: >-
-DTI_WITH_OPENGL:BOOL=OFF
-DTI_WITH_CUDA:BOOL=OFF
-DTI_WITH_VULKAN:BOOL=ON
-DTI_BUILD_TESTS:BOOL=ON
-DTI_WITH_C_API=ON
-DTI_WITH_STATIC_C_API=ON
TI_WANTED_ARCHS: 'cpu,metal,vulkan'
PLATFORM: 'm1'
TI_RUN_RELEASE_TESTS: '1'
steps:
- name: Workaround checkout Needed single revision issue
run: git submodule foreach 'git rev-parse HEAD > /dev/null 2>&1 || rm -rf $PWD' || true
- uses: actions/checkout@v3
with:
fetch-depth: '0'
submodules: 'recursive'
- name: Build
if: ${{ needs.check_files.outputs.run_job != 'false' }}
run: |
. .github/workflows/scripts/common-utils.sh
prepare-build-cache
brew install molten-vk
brew install llvm@15
.github/workflows/scripts/build.py
env:
CXX: clang++
- name: Check C-API Export Symbols
if: ${{ needs.check_files.outputs.run_job != 'false' }}
run: |
. .github/workflows/scripts/common-utils.sh
.github/workflows/scripts/aot-demo.sh check-c-api-export-symbols
- name: Test
id: test
if: ${{ needs.check_files.outputs.run_job != 'false' }}
run: |
.github/workflows/scripts/unix_test.sh
- name: Save wheel if test failed
if: failure() && steps.test.conclusion == 'failure'
uses: actions/upload-artifact@v3
with:
name: broken-wheel
path: dist/*
retention-days: 7
- name: Save Bad Captures
if: failure() && steps.test.conclusion == 'failure'
uses: actions/upload-artifact@v3
with:
name: bad-captures
path: taichi-release-tests/bad-compare/*
retention-days: 7
build_ios_capi:
name: Build iOS C-API Static Library
needs: check_files
timeout-minutes: ${{ github.event.schedule != '0 18 * * *' && 60 || 120 }}
runs-on: [self-hosted, m1]
env:
PY: "3.10"
steps:
- name: Workaround checkout Needed single revision issue
run: git submodule foreach 'git rev-parse HEAD > /dev/null 2>&1 || rm -rf $PWD' || true
- uses: actions/checkout@v3
with:
fetch-depth: '0'
submodules: 'recursive'
- name: Build
if: ${{ needs.check_files.outputs.run_job != 'false' }}
run: .github/workflows/scripts/build.py ios
- name: Save Compiled Static Library
if: ${{ needs.check_files.outputs.run_job != 'false' }}
uses: actions/upload-artifact@v3
with:
name: libtaichi_c_api.iOS.a
path: 'dist/C-API-iOS/*.a'
retention-days: 7
build_and_test_docs:
name: Build and Test (Docs)
needs: check_files
timeout-minutes: ${{ github.event.schedule != '0 18 * * *' && 90 || 120 }}
runs-on: [self-hosted, Linux, cuda, vulkan, cn]
env:
PY: '3.8'
PROJECT_NAME: taichi
TI_WANTED_ARCHS: 'cpu,cuda,vulkan,opengl,gles'
TI_DEVICE_MEMORY_GB: '1'
TI_RUN_RELEASE_TESTS: '1'
TAICHI_CMAKE_ARGS: >-
-DTI_WITH_OPENGL:BOOL=ON
-DTI_WITH_VULKAN:BOOL=ON
-DTI_WITH_BACKTRACE:BOOL=ON
-DTI_BUILD_TESTS:BOOL=ON
-DTI_WITH_C_API=ON
steps:
- name: Workaround checkout Needed single revision issue
run: git submodule foreach 'git rev-parse HEAD > /dev/null 2>&1 || rm -rf $PWD' || true
- uses: actions/checkout@v3
with:
submodules: 'recursive'
fetch-depth: '0'
- name: Check if there is anything Markdown modified but not covered by CI
if: ${{ github.event_name == 'pull_request' }}
run: |
set +e
sort docs/cover-in-ci.lst > /tmp/sorted-cover-list
git diff --name-only $BASE_SHA $HEAD_SHA | grep '\.md$' | sort > /tmp/sorted-modified-list
diff -u /tmp/sorted-cover-list /tmp/sorted-modified-list | grep '^\+docs' > /tmp/uncovered-list
if [ -s /tmp/uncovered-list ]; then
echo Please add modified docs to docs/cover-in-ci.lst!
echo
cat /tmp/uncovered-list
exit 1
else
echo No modified docs, or modified docs are all covered in the list
fi
env:
BASE_SHA: ${{ github.event.pull_request.base.sha }}
HEAD_SHA: ${{ github.event.pull_request.head.sha }}
- name: Prepare Environment
run: |
. .github/workflows/scripts/common-utils.sh
prepare-build-cache
echo CI_DOCKER_RUN_EXTRA_ARGS="-v $(pwd):/home/dev/taichi" >> $GITHUB_ENV
- name: Build & Install
run: |
. .github/workflows/scripts/common-utils.sh
ci-docker-run-gpu --name taichi-build \
registry.botmaster.tgr/taichi-build-cuda:${{ env.CI_IMAGE_VERSION }} \
/home/dev/taichi/.github/workflows/scripts/build.py
- name: Test
id: test
run: |
. .github/workflows/scripts/common-utils.sh
ci-docker-run-gpu --name taichi-test \
registry.botmaster.tgr/taichi-test-cuda:${{ env.CI_IMAGE_VERSION }} \
/home/dev/taichi/.github/workflows/scripts/unix-test-docs.sh
aot_build_and_test_android_apps:
name: AOT Build and Test Android Apps
# Skip this job when testing the offline cache
if: ${{ github.event.schedule != '0 18 * * *' }}
needs: check_files
runs-on: [self-hosted, Linux, cn]
timeout-minutes: 60
permissions:
packages: read
contents: read
env:
REDIS_HOST: 172.16.5.1
PY: '3.9'
steps:
- name: Workaround checkout Needed single revision issue
run: git submodule foreach 'git rev-parse HEAD > /dev/null 2>&1 || rm -rf $PWD' || true
- uses: actions/checkout@v3
name: Checkout taichi
with:
fetch-depth: '0'
submodules: "recursive"
- name: Prepare Environment
if: ${{ needs.check_files.outputs.run_job != 'false' }}
run: >-
. .github/workflows/scripts/common-utils.sh;
prepare-build-cache;
TAICHI_WHEEL_DIR=$(mktemp -d);
echo TAICHI_WHEEL_DIR=$TAICHI_WHEEL_DIR >> $GITHUB_ENV;
chmod 0777 $TAICHI_WHEEL_DIR;
echo CI_DOCKER_RUN_EXTRA_ARGS="
-e REDIS_HOST
-v $(pwd):/home/dev/taichi
-v $TAICHI_WHEEL_DIR:/taichi-wheel
" >> $GITHUB_ENV;
- name: Build Host Taichi
if: ${{ needs.check_files.outputs.run_job != 'false' }}
run: |
. .github/workflows/scripts/common-utils.sh
ci-docker-run --name taichi-build-host \
-v $TAICHI_WHEEL_DIR:/home/dev/taichi/dist \
registry.botmaster.tgr/taichi-build-cuda:${{ env.CI_IMAGE_VERSION }} \
/home/dev/taichi/.github/workflows/scripts/build.py
env:
TAICHI_CMAKE_ARGS: >-
-DTI_WITH_OPENGL:BOOL=ON
-DTI_WITH_VULKAN:BOOL=ON
-DTI_WITH_C_API=OFF
- name: Build For Android
if: ${{ needs.check_files.outputs.run_job != 'false' }}
run: |
. .github/workflows/scripts/common-utils.sh
git clean -fxd
ci-docker-run --name taichi-build-android \
registry.botmaster.tgr/taichi-build-android:${{ env.CI_IMAGE_VERSION }} \
/home/dev/taichi/.github/workflows/scripts/build.py android
env:
TAICHI_CMAKE_ARGS: >-
-DTI_WITH_OPENGL:BOOL=ON
-DTI_WITH_VULKAN:BOOL=ON
-DTI_WITH_LLVM:BOOL=OFF
-DTI_WITH_C_API:BOOL=ON
- name: Test For Android AOT
if: ${{ needs.check_files.outputs.run_job != 'false' }}
run: |
. .github/workflows/scripts/common-utils.sh
ci-docker-run-gpu --name taichi-test-android \
registry.botmaster.tgr/taichi-test-android:${{ env.CI_IMAGE_VERSION }} \
/home/dev/taichi/.github/workflows/scripts/aot-demo.sh build-and-smoke-test-android-aot-demo
env:
TI_DEVICE_MEMORY_GB: '0.1'
aot_build_and_test_android_headless_demos:
name: AOT Build and Test Android Headless Demos
# Skip this job when testing the offline cache
if: ${{ github.event.schedule != '0 18 * * *' }}
needs: check_files
runs-on: [self-hosted, Linux, cn]
timeout-minutes: 60
permissions:
packages: read
contents: read
env:
REDIS_HOST: 172.16.5.1
PY: '3.9'
steps:
- name: Workaround checkout Needed single revision issue
run: git submodule foreach 'git rev-parse HEAD > /dev/null 2>&1 || rm -rf $PWD' || true
- uses: actions/checkout@v3
name: Checkout taichi
with:
fetch-depth: '0'
submodules: "recursive"
- name: Prepare Environment
if: ${{ needs.check_files.outputs.run_job != 'false' }}
run: >-
. .github/workflows/scripts/common-utils.sh;
prepare-build-cache;
TAICHI_WHEEL_DIR=$(mktemp -d);
echo TAICHI_WHEEL_DIR=$TAICHI_WHEEL_DIR >> $GITHUB_ENV;
chmod 0777 $TAICHI_WHEEL_DIR;
echo CI_DOCKER_RUN_EXTRA_ARGS="
-e REDIS_HOST
-v $(pwd):/home/dev/taichi
-v $TAICHI_WHEEL_DIR:/taichi-wheel
" >> $GITHUB_ENV;
- name: Build Host Taichi
if: ${{ needs.check_files.outputs.run_job != 'false' }}
run: |
. .github/workflows/scripts/common-utils.sh
ci-docker-run --name taichi-build-host \
-v $TAICHI_WHEEL_DIR:/home/dev/taichi/dist \
registry.botmaster.tgr/taichi-build-cuda:${{ env.CI_IMAGE_VERSION }} \
/home/dev/taichi/.github/workflows/scripts/build.py
env:
TAICHI_CMAKE_ARGS: >-
-DTI_WITH_OPENGL:BOOL=ON
-DTI_WITH_VULKAN:BOOL=ON
-DTI_WITH_C_API=OFF
- name: Build For Android
if: ${{ needs.check_files.outputs.run_job != 'false' }}
run: |
. .github/workflows/scripts/common-utils.sh
git clean -fxd
ci-docker-run --name taichi-build-android \
registry.botmaster.tgr/taichi-build-android:${{ env.CI_IMAGE_VERSION }} \
/home/dev/taichi/.github/workflows/scripts/build.py android
env:
TAICHI_CMAKE_ARGS: >-
-DTI_WITH_OPENGL:BOOL=ON
-DTI_WITH_VULKAN:BOOL=ON
-DTI_WITH_LLVM:BOOL=OFF
-DTI_WITH_C_API=ON
- name: Build & Run C-API Headless Demos (Android)
if: ${{ needs.check_files.outputs.run_job != 'false' }}
run: |
. .github/workflows/scripts/common-utils.sh
ci-docker-run-gpu --name taichi-test-capi-headless-demo \
registry.botmaster.tgr/taichi-build-android:${{ env.CI_IMAGE_VERSION }} \
/home/dev/taichi/.github/workflows/scripts/aot-demo.sh build-and-test-headless-demo
env:
TI_DEVICE_MEMORY_GB: '0.1'
aot_build_and_test_android_unity_examples:
name: AOT Build and Test Android Unity Examples
# Skip this job when testing the offline cache
if: ${{ github.event.schedule != '0 18 * * *' }}
needs: check_files
runs-on: [self-hosted, Linux, cn]
timeout-minutes: 60
permissions:
packages: read
contents: read
env:
REDIS_HOST: 172.16.5.1
PY: '3.9'
steps:
- name: Workaround checkout Needed single revision issue
run: git submodule foreach 'git rev-parse HEAD > /dev/null 2>&1 || rm -rf $PWD' || true
- uses: actions/checkout@v3
name: Checkout taichi
with:
fetch-depth: '0'
submodules: "recursive"
- name: Prepare Environment
if: ${{ needs.check_files.outputs.run_job != 'false' }}
run: >-
. .github/workflows/scripts/common-utils.sh;
prepare-build-cache;
TAICHI_WHEEL_DIR=$(mktemp -d);
echo TAICHI_WHEEL_DIR=$TAICHI_WHEEL_DIR >> $GITHUB_ENV;
chmod 0777 $TAICHI_WHEEL_DIR;
echo CI_DOCKER_RUN_EXTRA_ARGS="
-e REDIS_HOST
-v $(pwd):/home/dev/taichi
-v $TAICHI_WHEEL_DIR:/taichi-wheel
" >> $GITHUB_ENV;
- name: Build Host Taichi
if: ${{ needs.check_files.outputs.run_job != 'false' }}
run: |
. .github/workflows/scripts/common-utils.sh
ci-docker-run --name taichi-build-host \
-v $TAICHI_WHEEL_DIR:/home/dev/taichi/dist \
registry.botmaster.tgr/taichi-build-cuda:${{ env.CI_IMAGE_VERSION }} \
/home/dev/taichi/.github/workflows/scripts/build.py
env:
TAICHI_CMAKE_ARGS: >-
-DTI_WITH_OPENGL:BOOL=ON
-DTI_WITH_VULKAN:BOOL=ON
-DTI_WITH_C_API=OFF
- name: Build For Android
if: ${{ needs.check_files.outputs.run_job != 'false' }}
run: |
. .github/workflows/scripts/common-utils.sh
git clean -fxd
ci-docker-run --name taichi-build-android \
registry.botmaster.tgr/taichi-build-android:${{ env.CI_IMAGE_VERSION }} \
/home/dev/taichi/.github/workflows/scripts/build.py android
env:
TAICHI_CMAKE_ARGS: >-
-DTI_WITH_OPENGL:BOOL=ON
-DTI_WITH_VULKAN:BOOL=ON
-DTI_WITH_LLVM:BOOL=OFF
-DTI_WITH_C_API=ON
- name: Prepare Unity Build Environment
if: ${{ needs.check_files.outputs.run_job != 'false' }}
run: |
. .github/workflows/scripts/common-utils.sh
ci-docker-run --name taichi-prepare-unity-build-env \
registry.botmaster.tgr/taichi-build-android:${{ env.CI_IMAGE_VERSION }} \
/home/dev/taichi/.github/workflows/scripts/aot-demo.sh prepare-unity-build-env
- name: Build Taichi-UnityExample
if: ${{ needs.check_files.outputs.run_job != 'false' }}
run: |
. .github/workflows/scripts/common-utils.sh
ci-docker-run --name taichi-build-unity-demo \
registry.taichigraphics.com/unityci-editor:ubuntu-2020.3.14f1-android-1-with-secret-sauce \
/home/dev/taichi/.github/workflows/scripts/aot-demo.sh build-unity-demo
- name: Run Taichi-UnityExample (C-API)
if: ${{ needs.check_files.outputs.run_job != 'false' }}
run: |
. .github/workflows/scripts/common-utils.sh
ci-docker-run --name taichi-run-unity-demo \
registry.botmaster.tgr/taichi-test-android:${{ env.CI_IMAGE_VERSION }} \
/home/dev/taichi/.github/workflows/scripts/aot-demo.sh smoke-test-unity-demo
aot_build_and_test_gpu_linux:
name: AOT Build and Test (GPU)
needs: check_files
timeout-minutes: ${{ github.event.schedule != '0 18 * * *' && 90 || 120 }}
# TODO(proton): do we need to test both drivers?
strategy:
matrix:
tags:
- [self-hosted, cuda, vulkan, cn, driver470]
- [self-hosted, cuda, vulkan, cn, driver510]
env:
PY: '3.8'
PROJECT_NAME: taichi
TAICHI_CMAKE_ARGS: >-
-DTI_WITH_OPENGL:BOOL=ON
-DTI_WITH_VULKAN:BOOL=ON
-DTI_WITH_BACKTRACE:BOOL=ON
-DTI_BUILD_TESTS:BOOL=ON
-DTI_WITH_C_API=ON
runs-on: ${{ matrix.tags }}
steps:
- name: Restart X Server
run: |
sudo systemctl restart xorg
- name: Workaround checkout Needed single revision issue
run: git submodule foreach 'git rev-parse HEAD > /dev/null 2>&1 || rm -rf $PWD' || true
- uses: actions/checkout@v3
with:
submodules: 'recursive'
fetch-depth: '0'
- name: Prepare Environment
run: |
. .github/workflows/scripts/common-utils.sh
prepare-build-cache
echo CI_DOCKER_RUN_EXTRA_ARGS="-v $(pwd):/home/dev/taichi" >> $GITHUB_ENV
- name: Build & Install
run: |
[[ ${{needs.check_files.outputs.run_job}} == false ]] && exit 0
. .github/workflows/scripts/common-utils.sh
ci-docker-run-gpu --name taichi-build \
registry.botmaster.tgr/taichi-build-cuda:${{ env.CI_IMAGE_VERSION }} \
/home/dev/taichi/.github/workflows/scripts/build.py
- name: Check C-API Export Symbols
run: |
[[ ${{needs.check_files.outputs.run_job}} == false ]] && exit 0
. .github/workflows/scripts/common-utils.sh
ci-docker-run-gpu --name taichi-test-check-c-api-export-symbols \
registry.botmaster.tgr/taichi-build-cuda:${{ env.CI_IMAGE_VERSION }} \
/home/dev/taichi/.github/workflows/scripts/aot-demo.sh check-c-api-export-symbols
- name: Build & Run C-API Headless Demos (Desktop)
run: |
[[ ${{needs.check_files.outputs.run_job}} == false ]] && exit 0
. .github/workflows/scripts/common-utils.sh
chown -R 1000:1000 .
ci-docker-run-gpu --name taichi-test-capi-headless-demo-desktop \
registry.botmaster.tgr/taichi-build-cuda:${{ env.CI_IMAGE_VERSION }} \
/home/dev/taichi/.github/workflows/scripts/aot-demo.sh build-and-test-headless-demo-desktop
env:
TI_DEVICE_MEMORY_GB: '0.1'
- name: Compatibility Test
id: test
run: |
[[ ${{needs.check_files.outputs.run_job}} == false ]] && exit 0
. .github/workflows/scripts/common-utils.sh
ci-docker-run-gpu --name taichi-test \
registry.botmaster.tgr/taichi-build-cuda:${{ env.CI_IMAGE_VERSION }} \
/home/dev/taichi/.github/workflows/scripts/unix_aot_compat_test.sh
- name: Save wheel if test failed
if: failure() && steps.test.conclusion == 'failure'
uses: actions/upload-artifact@v3
with:
name: broken-wheel
path: dist/*
retention-days: 7
- name: Save Bad Captures
if: failure() && steps.test.conclusion == 'failure'
uses: actions/upload-artifact@v3
with:
name: bad-captures
path: taichi-release-tests/bad-compare/*
retention-days: 7