diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 289ced346c049..8f5e6f4cdb1bb 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -120,51 +120,51 @@ jobs: env: PY: ${{ matrix.python }} - build_and_test_mac: - name: Build and Upload (macOS only) - needs: matrix_prep - strategy: - fail-fast: false - matrix: ${{ fromJson(needs.matrix_prep.outputs.matrix_osx) }} - runs-on: [self-hosted, macos-11] - env: - PY: ${{ matrix.python }} - CXX: clang++ - TAICHI_CMAKE_ARGS: >- - -DTI_WITH_VULKAN:BOOL=ON - -DTI_WITH_OPENGL:BOOL=OFF - -DTI_BUILD_TESTS:BOOL=ON - steps: - - uses: actions/checkout@v3 - with: - submodules: 'recursive' - fetch-depth: '0' - - - name: Prepare Environment - run: | - . .github/workflows/scripts/common-utils.sh - prepare-build-cache - - - name: Create Python Wheel - run: | - # Use the molten-vk v1.1.10 downloaded from taichi assets - brew uninstall molten-vk -f - .github/workflows/scripts/build.py $NIGHTLY - env: - PROJECT_NAME: ${{ matrix.name }} - - - name: Archive Wheel Artifacts - uses: actions/upload-artifact@v3 - with: - name: dist - path: dist/*.whl - retention-days: 20 - - - name: Test - run: .github/workflows/scripts/unix_test.sh - env: - TI_WANTED_ARCHS: 'cpu' - TI_SKIP_CPP_TESTS: Disabled because Vulkan is supported but not working on buildbot4 + # build_and_test_mac: + # name: Build and Upload (macOS only) + # needs: matrix_prep + # strategy: + # fail-fast: false + # matrix: ${{ fromJson(needs.matrix_prep.outputs.matrix_osx) }} + # runs-on: [self-hosted, macos-11] + # env: + # PY: ${{ matrix.python }} + # CXX: clang++ + # TAICHI_CMAKE_ARGS: >- + # -DTI_WITH_VULKAN:BOOL=ON + # -DTI_WITH_OPENGL:BOOL=OFF + # -DTI_BUILD_TESTS:BOOL=ON + # steps: + # - uses: actions/checkout@v3 + # with: + # submodules: 'recursive' + # fetch-depth: '0' + + # - name: Prepare Environment + # run: | + # . .github/workflows/scripts/common-utils.sh + # prepare-build-cache + + # - name: Create Python Wheel + # run: | + # # Use the molten-vk v1.1.10 downloaded from taichi assets + # brew uninstall molten-vk -f + # .github/workflows/scripts/build.py $NIGHTLY + # env: + # PROJECT_NAME: ${{ matrix.name }} + + # - name: Archive Wheel Artifacts + # uses: actions/upload-artifact@v3 + # with: + # name: dist + # path: dist/*.whl + # retention-days: 20 + + # - name: Test + # run: .github/workflows/scripts/unix_test.sh + # env: + # TI_WANTED_ARCHS: 'cpu' + # TI_SKIP_CPP_TESTS: Disabled because Vulkan is supported but not working on buildbot4 build_and_test_m1: name: Build and Upload (Apple M1) @@ -241,6 +241,8 @@ jobs: run: | git config --system core.longpaths true git submodule foreach 'git rev-parse HEAD > /dev/null 2>&1 || rm -rf $PWD' + . .github/workflows/scripts/common-utils.ps1 + UnsetGitCachingProxy - uses: actions/checkout@v3 with: @@ -256,6 +258,8 @@ jobs: run: | $nightlyFlag = $null if ($env:NIGHTLY) { $nightlyFlag = "--nightly" } + . .github/workflows/scripts/common-utils.ps1 + SetGitCachingProxy python .\.github\workflows\scripts\build.py $nightlyFlag - name: Archive Wheel Artifacts @@ -268,6 +272,8 @@ jobs: - name: Test shell: pwsh run: | + . .github/workflows/scripts/common-utils.ps1 + SetGitCachingProxy .\.github\workflows\scripts\win_test.ps1 env: PY: ${{ matrix.python }} diff --git a/.github/workflows/scripts/aot-demo.sh b/.github/workflows/scripts/aot-demo.sh index 14ecf441f9aa9..df00bc259d385 100755 --- a/.github/workflows/scripts/aot-demo.sh +++ b/.github/workflows/scripts/aot-demo.sh @@ -122,7 +122,6 @@ function build-and-test-headless-demo { export PATH=/android-sdk/platform-tools:$PATH grab-android-bot - trap release-android-bot EXIT adb connect $BOT # Clear temporary test folder diff --git a/.github/workflows/scripts/common-utils.ps1 b/.github/workflows/scripts/common-utils.ps1 index c1d19d0753f75..3d9343cf2cb56 100644 --- a/.github/workflows/scripts/common-utils.ps1 +++ b/.github/workflows/scripts/common-utils.ps1 @@ -1,14 +1,16 @@ function UnsetGitCachingProxy { Write-Host "Unsetting git caching proxy" git config --global --unset-all url.http://git-cdn-github.botmaster.tgr/.insteadOf - git config --global --unset-all url.http://git-cdn-gitlab.botmaster.tgr/.insteadOf + # git config --global --unset-all url.http://git-cdn-gitlab.botmaster.tgr/.insteadOf } function SetGitCachingProxy { Write-Host "Setting up git caching proxy" git config --global --add url.http://git-cdn-github.botmaster.tgr/.insteadOf https://github.com/ git config --global --add url.http://git-cdn-github.botmaster.tgr/.insteadOf git@github.com: - git config --global --add url.http://git-cdn-gitlab.botmaster.tgr/.insteadOf https://gitlab.com/ + # git config --global --add url.http://git-cdn-gitlab.botmaster.tgr/.insteadOf https://gitlab.com/ + git config --global credential.helper "store --file $env:TEMP\.git-credentials" + "http://oauth2:${env:GITHUB_TOKEN}@git-cdn-github.botmaster.tgr" | Out-File -FilePath $env:TEMP\.git-credentials } if($env:TI_USE_GIT_CACHE) { @@ -242,6 +244,7 @@ function CIDockerRun { -e PIP_CACHE_DIR=X:/pip-cache ` -e GIT_ALTERNATE_OBJECT_DIRECTORIES=X:/git-cache/objects ` -e TI_CI=1 ` + -e GITHUB_TOKEN ` @TiEnvs ` -v (($env:LocalAppData -replace "\\", "/") + "/build-cache:X:") ` @extraArgs ` diff --git a/.github/workflows/scripts/common-utils.sh b/.github/workflows/scripts/common-utils.sh index ddba260fa2be1..a9d33fda3297c 100644 --- a/.github/workflows/scripts/common-utils.sh +++ b/.github/workflows/scripts/common-utils.sh @@ -5,7 +5,8 @@ set -x function unset-git-caching-proxy { echo "Unsetting git caching proxy" git config --global --unset-all url.http://git-cdn-github.botmaster.tgr/.insteadOf || true - git config --global --unset-all url.http://git-cdn-gitlab.botmaster.tgr/.insteadOf || true + # git config --global --unset-all url.http://git-cdn-gitlab.botmaster.tgr/.insteadOf || true + rm -f ~/.git-credentials } function set-git-caching-proxy { @@ -13,7 +14,9 @@ function set-git-caching-proxy { echo "Setting git caching proxy" git config --global --add url.http://git-cdn-github.botmaster.tgr/.insteadOf https://github.com/ git config --global --add url.http://git-cdn-github.botmaster.tgr/.insteadOf git@github.com: - git config --global --add url.http://git-cdn-gitlab.botmaster.tgr/.insteadOf https://gitlab.com/ + # git config --global --add url.http://git-cdn-gitlab.botmaster.tgr/.insteadOf https://gitlab.com/ + git config --global credential.helper store + echo "http://oauth2:$GITHUB_TOKEN@git-cdn-github.botmaster.tgr" > ~/.git-credentials } if [ ! -z "$TI_USE_GIT_CACHE" ]; then @@ -136,6 +139,7 @@ function ci-docker-run { -e SCCACHE_ROOT=/var/lib/sccache \ -e CACHE_HOME=/var/lib/cache-home \ -e GIT_ALTERNATE_OBJECT_DIRECTORIES=/var/lib/git-cache/objects \ + -e GITHUB_TOKEN \ -v $(readlink -f $CACHE_HOME):/var/lib/cache-home \ -v $(readlink -f $CACHE_HOME/sccache):/var/lib/sccache \ -v $(readlink -f $CACHE_HOME/git-cache):/var/lib/git-cache \ @@ -210,6 +214,7 @@ function grab-android-bot { export BOT_LOCK_KEY="android-bot-lock:$bot" LOCKED=$(redis-cli -h $REDIS_HOST --raw setnx $BOT_LOCK_KEY $BOT_LOCK_COOKIE) if [ $LOCKED -eq 1 ]; then + trap release-android-bot EXIT redis-cli -h $REDIS_HOST --raw expire android-bot-lock:$bot 300 > /dev/null break fi @@ -247,7 +252,6 @@ function run-android-app { /android-sdk/platform-tools/adb shell am force-stop $(echo $ACTIVITY | sed 's#/.*$##g') /android-sdk/platform-tools/adb disconnect - release-android-bot if [ -s logcat.log ]; then echo "!!!!!!!!!!!!!! Something is wrong !!!!!!!!!!!!!!" exit 1 diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index ca6cf26797cbf..55f96c2f2ba26 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -21,6 +21,7 @@ env: CI_IMAGE_VERSION: '202311231829' # TI_USE_GIT_CACHE: ${{ vars.TI_USE_GIT_CACHE }} TI_USE_GIT_CACHE: '1' # variables are also not populated on forked PRs + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} jobs: show_environ: @@ -111,73 +112,76 @@ jobs: 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.11 - 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_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.11 + # 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 issues + # run: | + # . .github/workflows/scripts/common-utils.sh + # git submodule foreach 'git rev-parse HEAD > /dev/null 2>&1 || rm -rf $PWD' || true + # unset-git-caching-proxy + + # - 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) @@ -367,10 +371,12 @@ jobs: TI_RUN_RELEASE_TESTS: '1' steps: - - name: Workaround checkout Needed single revision issue + - name: Workaround checkout issues run: | + . .github/workflows/scripts/common-utils.ps1 git config --system core.longpaths true git submodule foreach 'git rev-parse HEAD > /dev/null 2>&1 || rm -rf $PWD' # no '|| true' here + UnsetGitCachingProxy - uses: actions/checkout@v3 with: @@ -385,6 +391,8 @@ jobs: if: ${{ needs.check_files.outputs.run_job != 'false' }} shell: cmd run: | + . .github/workflows/scripts/common-utils.ps1 + SetGitCachingProxy python .\.github\workflows\scripts\build.py - name: Test @@ -392,6 +400,8 @@ jobs: shell: pwsh if: ${{ needs.check_files.outputs.run_job != 'false' }} run: | + . .github/workflows/scripts/common-utils.ps1 + SetGitCachingProxy .\.github\workflows\scripts\win_test.ps1 -libsDir "$env:LocalAppData/buildbot" env: EXTRA_TEST_MARKERS: ${{ matrix.extra_markers }} @@ -586,254 +596,254 @@ jobs: 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_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)