Add D3D12 GPU backend. #5967
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: build | |
| on: | |
| pull_request: | |
| branches: [ main ] | |
| push: | |
| branches: [ main ] | |
| jobs: | |
| ios: | |
| runs-on: macos-latest | |
| steps: | |
| - name: Check Out Repo | |
| uses: actions/checkout@v4 | |
| - name: Get Third-Party Cache | |
| id: third-party-cache | |
| uses: actions/cache/restore@v4 | |
| with: | |
| path: | | |
| third_party | |
| key: third-party-ios-${{ hashFiles('DEPS') }}-${{ hashFiles('vendor.json') }} | |
| restore-keys: third-party-ios- | |
| - uses: tecolicom/actions-use-homebrew-tools@v1 | |
| with: | |
| tools: ninja yasm | |
| - name: Install Build Tools | |
| run: | | |
| chmod +x install_tools.sh | |
| ./install_tools.sh | |
| shell: bash | |
| - name: Run depsync | |
| run: | | |
| npm install depsync -g | |
| depsync | |
| shell: bash | |
| - name: Build iOS | |
| run: | | |
| cd ios | |
| node gen_ios -DTGFX_BUILD_LAYERS=ON -DTGFX_BUILD_SVG=ON -DTGFX_BUILD_PDF=ON | |
| xcodebuild -workspace opengl/Hello2D.xcworkspace -scheme Hello2D -configuration Release -sdk iphoneos -arch arm64 CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO | |
| xcodebuild -workspace metal/Hello2D.xcworkspace -scheme Hello2D -configuration Release -sdk iphoneos -arch arm64 CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO | |
| - name: Save Third-Party Cache | |
| if: ${{ (github.event_name == 'push') && (steps.third-party-cache.outputs.cache-hit != 'true') }} | |
| uses: actions/cache/save@v4 | |
| with: | |
| path: | | |
| third_party | |
| key: third-party-ios-${{ hashFiles('DEPS') }}-${{ hashFiles('vendor.json') }} | |
| - name: Job Failed | |
| if: ${{ failure() }} | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: ios_build | |
| path: ios | |
| android-opengles: | |
| name: android (opengles) | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Check Out Repo | |
| uses: actions/checkout@v4 | |
| - name: Get Third-Party Cache | |
| id: third-party-cache | |
| uses: actions/cache/restore@v4 | |
| with: | |
| path: | | |
| third_party | |
| key: third-party-android-${{ hashFiles('DEPS') }}-${{ hashFiles('vendor.json') }} | |
| restore-keys: third-party-android- | |
| - name: Run depsync | |
| run: | | |
| npm install depsync -g | |
| depsync | |
| - name: Install Ninja | |
| run: sudo apt-get update && sudo apt-get install -y ninja-build | |
| - uses: actions/setup-java@v4 | |
| with: | |
| distribution: 'temurin' | |
| java-version: '17' | |
| cache: 'gradle' | |
| - name: Build Android | |
| run: | | |
| cd android | |
| ./gradlew assembleRelease -Parm64-only --no-daemon -PcmakeArgs="-DTGFX_BUILD_LAYERS=ON -DTGFX_BUILD_SVG=ON -DTGFX_BUILD_PDF=ON" | |
| - name: Save Third-Party Cache | |
| if: ${{ (github.event_name == 'push') && (steps.third-party-cache.outputs.cache-hit != 'true') }} | |
| uses: actions/cache/save@v4 | |
| with: | |
| path: | | |
| third_party | |
| key: third-party-android-${{ hashFiles('DEPS') }}-${{ hashFiles('vendor.json') }} | |
| - name: Job Failed | |
| if: ${{ failure() }} | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: android_opengles_build | |
| path: android | |
| android-vulkan: | |
| name: android (vulkan) | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Check Out Repo | |
| uses: actions/checkout@v4 | |
| - name: Get Third-Party Cache | |
| id: third-party-cache | |
| uses: actions/cache/restore@v4 | |
| with: | |
| path: | | |
| third_party | |
| key: third-party-android-${{ hashFiles('DEPS') }}-${{ hashFiles('vendor.json') }} | |
| restore-keys: third-party-android- | |
| - name: Run depsync | |
| run: | | |
| npm install depsync -g | |
| depsync | |
| - name: Install Ninja | |
| run: sudo apt-get update && sudo apt-get install -y ninja-build | |
| - uses: actions/setup-java@v4 | |
| with: | |
| distribution: 'temurin' | |
| java-version: '17' | |
| cache: 'gradle' | |
| - name: Build Android | |
| run: | | |
| cd android | |
| ./gradlew assembleRelease -Parm64-only --no-daemon -PcmakeArgs="-DTGFX_USE_VULKAN=ON -DTGFX_BUILD_LAYERS=ON -DTGFX_BUILD_SVG=ON -DTGFX_BUILD_PDF=ON" | |
| - name: Save Third-Party Cache | |
| if: ${{ (github.event_name == 'push') && (steps.third-party-cache.outputs.cache-hit != 'true') }} | |
| uses: actions/cache/save@v4 | |
| with: | |
| path: | | |
| third_party | |
| key: third-party-android-${{ hashFiles('DEPS') }}-${{ hashFiles('vendor.json') }} | |
| - name: Job Failed | |
| if: ${{ failure() }} | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: android_vulkan_build | |
| path: android | |
| web-webgl: | |
| name: web (webgl) | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Check Out Repo | |
| uses: actions/checkout@v4 | |
| - name: Get Environment Cache | |
| id: environment-cache | |
| uses: actions/cache/restore@v4 | |
| with: | |
| path: | | |
| web/emsdk | |
| web/node_modules | |
| key: tgfx-environment-web-linux-20260608 | |
| restore-keys: tgfx-environment-web-linux- | |
| - name: Get Third-Party Cache | |
| id: third-party-cache | |
| uses: actions/cache/restore@v4 | |
| with: | |
| path: | | |
| third_party | |
| key: third-party-web-${{ hashFiles('DEPS') }}-${{ hashFiles('vendor.json') }} | |
| restore-keys: third-party-web- | |
| - name: Install Build Tools | |
| if: ${{ (steps.environment-cache.outputs.cache-hit != 'true') }} | |
| run: | | |
| cd web | |
| npm install | |
| if [ ! -d "emsdk" ]; then | |
| git clone https://github.com/emscripten-core/emsdk.git | |
| else | |
| cd emsdk | |
| git pull | |
| cd .. | |
| fi | |
| cd emsdk | |
| ./emsdk install 4.0.15 | |
| ./emsdk activate 4.0.15 | |
| - name: Run depsync | |
| run: | | |
| npm install depsync -g | |
| depsync | |
| - name: Build WebGL | |
| run: | | |
| cd web | |
| source emsdk/emsdk_env.sh | |
| npm run build:st | |
| - name: Save Environment Cache | |
| if: ${{ (github.event_name == 'push') && (steps.environment-cache.outputs.cache-hit != 'true') }} | |
| uses: actions/cache/save@v4 | |
| with: | |
| path: | | |
| web/emsdk | |
| web/node_modules | |
| key: tgfx-environment-web-linux-20260608 | |
| - name: Save Third-Party Cache | |
| if: ${{ (github.event_name == 'push') && (steps.third-party-cache.outputs.cache-hit != 'true') }} | |
| uses: actions/cache/save@v4 | |
| with: | |
| path: | | |
| third_party | |
| key: third-party-web-${{ hashFiles('DEPS') }}-${{ hashFiles('vendor.json') }} | |
| - name: Job Failed | |
| if: ${{ failure() }} | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: web_webgl_build | |
| path: | | |
| web | |
| !web/emsdk | |
| !web/node_modules | |
| web-webgpu: | |
| # NOTE: This job only verifies compilation. WebGPU runtime tests are not run because GitHub | |
| # Actions Linux runners lack GPU hardware and headless Chrome WebGPU support is unreliable in CI. | |
| name: web (webgpu) | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Check Out Repo | |
| uses: actions/checkout@v4 | |
| - name: Get Environment Cache | |
| id: environment-cache | |
| uses: actions/cache/restore@v4 | |
| with: | |
| path: | | |
| web/emsdk | |
| web/node_modules | |
| key: tgfx-environment-web-linux-20260608 | |
| restore-keys: tgfx-environment-web-linux- | |
| - name: Get Third-Party Cache | |
| id: third-party-cache | |
| uses: actions/cache/restore@v4 | |
| with: | |
| path: | | |
| third_party | |
| key: third-party-web-webgpu-${{ hashFiles('DEPS') }}-${{ hashFiles('vendor.json') }} | |
| restore-keys: third-party-web-webgpu- | |
| - name: Install Build Tools | |
| if: ${{ (steps.environment-cache.outputs.cache-hit != 'true') }} | |
| run: | | |
| cd web | |
| npm install | |
| if [ ! -d "emsdk" ]; then | |
| git clone https://github.com/emscripten-core/emsdk.git | |
| else | |
| cd emsdk | |
| git pull | |
| cd .. | |
| fi | |
| cd emsdk | |
| ./emsdk install 4.0.15 | |
| ./emsdk activate 4.0.15 | |
| - name: Run depsync | |
| run: | | |
| npm install depsync -g | |
| depsync | |
| - name: Sync shaderc sub-dependencies | |
| run: python3 third_party/shaderc/utils/git-sync-deps | |
| - name: Build WebGPU | |
| run: | | |
| cd web | |
| source emsdk/emsdk_env.sh | |
| npm run build:webgpu | |
| - name: Save Environment Cache | |
| if: ${{ (github.event_name == 'push') && (steps.environment-cache.outputs.cache-hit != 'true') }} | |
| uses: actions/cache/save@v4 | |
| with: | |
| path: | | |
| web/emsdk | |
| web/node_modules | |
| key: tgfx-environment-web-linux-20260608 | |
| - name: Save Third-Party Cache | |
| if: ${{ (github.event_name == 'push') && (steps.third-party-cache.outputs.cache-hit != 'true') }} | |
| uses: actions/cache/save@v4 | |
| with: | |
| path: | | |
| third_party | |
| key: third-party-web-webgpu-${{ hashFiles('DEPS') }}-${{ hashFiles('vendor.json') }} | |
| - name: Job Failed | |
| if: ${{ failure() }} | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: web_webgpu_build | |
| path: | | |
| web | |
| !web/emsdk | |
| !web/node_modules | |
| win: | |
| runs-on: windows-latest | |
| steps: | |
| - name: Check Out Repo | |
| uses: actions/checkout@v4 | |
| - name: Get Third-Party Cache | |
| id: third-party-cache | |
| uses: actions/cache/restore@v4 | |
| with: | |
| path: | | |
| third_party | |
| key: third-party-windows-${{ hashFiles('DEPS') }}-${{ hashFiles('vendor.json') }} | |
| restore-keys: third-party-windows- | |
| - name: Run depsync | |
| run: | | |
| npm install depsync -g | |
| depsync | |
| shell: bash | |
| - name: Build Windows | |
| run: | | |
| node build_tgfx -s ./win Hello2D -DTGFX_BUILD_LAYERS=ON -DTGFX_BUILD_SVG=ON -DTGFX_BUILD_PDF=ON -o ./out/release/win -a x64 -d | |
| - name: Save Third-Party Cache | |
| if: ${{ (github.event_name == 'push') && (steps.third-party-cache.outputs.cache-hit != 'true') }} | |
| uses: actions/cache/save@v4 | |
| with: | |
| path: | | |
| third_party | |
| key: third-party-windows-${{ hashFiles('DEPS') }}-${{ hashFiles('vendor.json') }} | |
| - name: Job Failed | |
| if: ${{ failure() }} | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: win_build | |
| path: out | |
| linux: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Check Out Repo | |
| uses: actions/checkout@v4 | |
| - name: Get Third-Party Cache | |
| id: third-party-cache | |
| uses: actions/cache/restore@v4 | |
| with: | |
| path: | | |
| third_party | |
| key: third-party-linux-${{ hashFiles('DEPS') }}-${{ hashFiles('vendor.json') }} | |
| restore-keys: third-party-linux- | |
| - name: Install Ninja | |
| run: sudo apt-get update && sudo apt-get install -y ninja-build | |
| - name: Run depsync | |
| run: | | |
| npm install depsync -g | |
| depsync | |
| shell: bash | |
| - uses: awalsh128/cache-apt-pkgs-action@latest | |
| with: | |
| packages: libx11-dev | |
| version: 1.0 | |
| - name: Build Linux | |
| run: | | |
| node build_tgfx -s ./linux Hello2D -DTGFX_BUILD_LAYERS=ON -DTGFX_BUILD_SVG=ON -DTGFX_BUILD_PDF=ON -o ./out/release/linux -a x64 -d | |
| - name: Save Third-Party Cache | |
| if: ${{ (github.event_name == 'push') && (steps.third-party-cache.outputs.cache-hit != 'true') }} | |
| uses: actions/cache/save@v4 | |
| with: | |
| path: | | |
| third_party | |
| key: third-party-linux-${{ hashFiles('DEPS') }}-${{ hashFiles('vendor.json') }} | |
| - name: Job Failed | |
| if: ${{ failure() }} | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: linux_build | |
| path: out | |
| qt: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Check Out Repo | |
| uses: actions/checkout@v4 | |
| - name: Get Third-Party Cache | |
| id: third-party-cache | |
| uses: actions/cache/restore@v4 | |
| with: | |
| path: | | |
| third_party | |
| key: third-party-qt-${{ hashFiles('DEPS') }}-${{ hashFiles('vendor.json') }} | |
| restore-keys: third-party-qt- | |
| - name: Install Ninja | |
| run: sudo apt-get update && sudo apt-get install -y ninja-build | |
| - name: Run depsync | |
| run: | | |
| npm install depsync -g | |
| depsync | |
| shell: bash | |
| - name: Install Qt | |
| uses: jurplel/install-qt-action@v4 | |
| with: | |
| host: 'linux' | |
| target: 'desktop' | |
| version: '6.8.3' | |
| dir: '${{github.workspace}}/qt/' | |
| install-deps: 'true' | |
| cache: 'true' | |
| aqtversion: '==3.2.1' | |
| cache-key-prefix: 'install-qt-action' | |
| - name: Build QT | |
| run: | | |
| node build_tgfx -s ./qt Hello2D -DCMAKE_PREFIX_PATH="${{env.QT_ROOT_DIR}}/lib/cmake" -DTGFX_BUILD_LAYERS=ON -DTGFX_BUILD_SVG=ON -DTGFX_BUILD_PDF=ON -o ./out/release/qt -a x64 | |
| - name: Save Third-Party Cache | |
| if: ${{ (github.event_name == 'push') && (steps.third-party-cache.outputs.cache-hit != 'true') }} | |
| uses: actions/cache/save@v4 | |
| with: | |
| path: | | |
| third_party | |
| key: third-party-qt-${{ hashFiles('DEPS') }}-${{ hashFiles('vendor.json') }} | |
| - name: Job Failed | |
| if: ${{ failure() }} | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: qt_build | |
| path: out | |
| ohos-opengles: | |
| name: ohos (opengles) | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Check Out Repo | |
| uses: actions/checkout@v4 | |
| - name: Get CLI Tools Cache | |
| id: cli-tools-cache | |
| uses: actions/cache/restore@v4 | |
| with: | |
| path: /opt/ohos-cmd-tools | |
| key: ohos-cli-6.0.0.868-linux-x64 | |
| - name: Install CLI Tools | |
| if: steps.cli-tools-cache.outputs.cache-hit != 'true' | |
| run: | | |
| TOOLS_URL="https://github.com/libpag/ohos-sdk/releases/download/6.0.0.868/commandline-tools-linux-x64-6.0.0.868.zip" | |
| curl -L -o /tmp/cmdtools.zip "$TOOLS_URL" | |
| unzip -q /tmp/cmdtools.zip -d /tmp | |
| sudo mv /tmp/command-line-tools /opt/ohos-cmd-tools | |
| - name: Save CLI Tools Cache | |
| if: ${{ (github.event_name == 'push') && (steps.cli-tools-cache.outputs.cache-hit != 'true') }} | |
| uses: actions/cache/save@v4 | |
| with: | |
| path: /opt/ohos-cmd-tools | |
| key: ohos-cli-6.0.0.868-linux-x64 | |
| - name: Configure Environment | |
| run: | | |
| CLI_DIR=/opt/ohos-cmd-tools | |
| echo "$CLI_DIR/sdk/default/openharmony/toolchains" >> $GITHUB_PATH | |
| echo "$CLI_DIR/ohpm/bin" >> $GITHUB_PATH | |
| echo "$CLI_DIR/hvigor/bin" >> $GITHUB_PATH | |
| echo "DEVECO_SDK_HOME=$CLI_DIR/sdk" >> $GITHUB_ENV | |
| echo "JAVA_HOME=$JAVA_HOME" >> $GITHUB_ENV | |
| - name: Setup JDK 17 | |
| uses: actions/setup-java@v4 | |
| with: | |
| distribution: temurin | |
| java-version: 17 | |
| - name: Setup pnpm | |
| run: | | |
| npm install -g pnpm@8.13.1 | |
| echo "$(npm prefix -g)/bin" >> $GITHUB_PATH | |
| - name: Cache hvigor & ohpm | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.hvigor | |
| ~/.ohpm | |
| key: hvigor-${{ runner.os }}-${{ hashFiles('ohos/**/oh-package.json5', 'ohos/**/hvigorfile.ts') }} | |
| restore-keys: | | |
| hvigor-${{ runner.os }}- | |
| - name: Cache Hvigor Build | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ohos/hello2d/build | |
| ohos/.hvigor | |
| key: ohos-hvigor-${{ runner.os }}-${{ hashFiles('ohos/**/*.ets', 'ohos/**/*.json5') }} | |
| restore-keys: | | |
| ohos-hvigor-${{ runner.os }}- | |
| - name: Get Third-Party Cache | |
| id: third-party-cache | |
| uses: actions/cache/restore@v4 | |
| with: | |
| path: third_party | |
| key: third-party-ohos-${{ hashFiles('DEPS') }}-${{ hashFiles('vendor.json') }} | |
| restore-keys: third-party-ohos- | |
| - name: Run depsync | |
| run: | | |
| npm install depsync -g | |
| depsync | |
| - name: Install ohpm dependencies | |
| run: | | |
| cd ohos | |
| ohpm config set registry https://ohpm.openharmony.cn/ohpm/ | |
| ohpm install --all | |
| - name: Setup ccache | |
| run: | | |
| sudo apt-get update && sudo apt-get install -y ccache | |
| ccache --version | |
| ccache --max-size=500M | |
| ccache --zero-stats | |
| - name: Restore ccache | |
| uses: actions/cache/restore@v4 | |
| with: | |
| path: ~/.cache/ccache | |
| key: ccache-ohos-opengles-${{ runner.os }}-main | |
| restore-keys: | | |
| ccache-ohos-opengles-${{ runner.os }}- | |
| - name: Build Harmony | |
| run: | | |
| cd ohos | |
| sed -i '/"abiFilters"/,/\]/{ /"x86_64"/d }' hello2d/build-profile.json5 | |
| sed -i 's/"arguments": "\(.*\)"/"arguments": "\1 -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache"/' hello2d/build-profile.json5 | |
| hvigorw assembleHap \ | |
| -Dohos.sdk.root=$DEVECO_SDK_HOME \ | |
| -p buildMode=release \ | |
| --parallel \ | |
| --no-daemon | |
| - name: Save ccache | |
| if: ${{ github.event_name == 'push' }} | |
| uses: actions/cache/save@v4 | |
| with: | |
| path: ~/.cache/ccache | |
| key: ccache-ohos-opengles-${{ runner.os }}-main | |
| - name: Save Third-Party Cache | |
| if: ${{ (github.event_name == 'push') && (steps.third-party-cache.outputs.cache-hit != 'true') }} | |
| uses: actions/cache/save@v4 | |
| with: | |
| path: third_party | |
| key: third-party-ohos-${{ hashFiles('DEPS') }}-${{ hashFiles('vendor.json') }} | |
| - name: Job Failed | |
| if: ${{ failure() }} | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: ohos_opengles_build | |
| path: ohos/out | |
| ohos-vulkan: | |
| name: ohos (vulkan) | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Check Out Repo | |
| uses: actions/checkout@v4 | |
| - name: Get CLI Tools Cache | |
| id: cli-tools-cache | |
| uses: actions/cache/restore@v4 | |
| with: | |
| path: /opt/ohos-cmd-tools | |
| key: ohos-cli-6.0.0.868-linux-x64 | |
| - name: Install CLI Tools | |
| if: steps.cli-tools-cache.outputs.cache-hit != 'true' | |
| run: | | |
| TOOLS_URL="https://github.com/libpag/ohos-sdk/releases/download/6.0.0.868/commandline-tools-linux-x64-6.0.0.868.zip" | |
| curl -L -o /tmp/cmdtools.zip "$TOOLS_URL" | |
| unzip -q /tmp/cmdtools.zip -d /tmp | |
| sudo mv /tmp/command-line-tools /opt/ohos-cmd-tools | |
| - name: Save CLI Tools Cache | |
| if: ${{ (github.event_name == 'push') && (steps.cli-tools-cache.outputs.cache-hit != 'true') }} | |
| uses: actions/cache/save@v4 | |
| with: | |
| path: /opt/ohos-cmd-tools | |
| key: ohos-cli-6.0.0.868-linux-x64 | |
| - name: Configure Environment | |
| run: | | |
| CLI_DIR=/opt/ohos-cmd-tools | |
| echo "$CLI_DIR/sdk/default/openharmony/toolchains" >> $GITHUB_PATH | |
| echo "$CLI_DIR/ohpm/bin" >> $GITHUB_PATH | |
| echo "$CLI_DIR/hvigor/bin" >> $GITHUB_PATH | |
| echo "DEVECO_SDK_HOME=$CLI_DIR/sdk" >> $GITHUB_ENV | |
| echo "JAVA_HOME=$JAVA_HOME" >> $GITHUB_ENV | |
| - name: Setup JDK 17 | |
| uses: actions/setup-java@v4 | |
| with: | |
| distribution: temurin | |
| java-version: 17 | |
| - name: Setup pnpm | |
| run: | | |
| npm install -g pnpm@8.13.1 | |
| echo "$(npm prefix -g)/bin" >> $GITHUB_PATH | |
| - name: Cache hvigor & ohpm | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.hvigor | |
| ~/.ohpm | |
| key: hvigor-${{ runner.os }}-${{ hashFiles('ohos/**/oh-package.json5', 'ohos/**/hvigorfile.ts') }} | |
| restore-keys: | | |
| hvigor-${{ runner.os }}- | |
| - name: Get Third-Party Cache | |
| id: third-party-cache | |
| uses: actions/cache/restore@v4 | |
| with: | |
| path: third_party | |
| key: third-party-ohos-${{ hashFiles('DEPS') }}-${{ hashFiles('vendor.json') }} | |
| restore-keys: third-party-ohos- | |
| - name: Run depsync | |
| run: | | |
| npm install depsync -g | |
| depsync | |
| - name: Install ohpm dependencies | |
| run: | | |
| cd ohos | |
| ohpm config set registry https://ohpm.openharmony.cn/ohpm/ | |
| ohpm install --all | |
| - name: Setup ccache | |
| run: | | |
| sudo apt-get update && sudo apt-get install -y ccache | |
| ccache --version | |
| ccache --max-size=500M | |
| ccache --zero-stats | |
| - name: Restore ccache | |
| uses: actions/cache/restore@v4 | |
| with: | |
| path: ~/.cache/ccache | |
| key: ccache-ohos-vulkan-${{ runner.os }}-main | |
| restore-keys: | | |
| ccache-ohos-vulkan-${{ runner.os }}- | |
| - name: Build Harmony | |
| run: | | |
| cd ohos | |
| sed -i '/"abiFilters"/,/\]/{ /"x86_64"/d }' hello2d/build-profile.json5 | |
| sed -i 's/"arguments": "\(.*\)"/"arguments": "\1 -DTGFX_USE_VULKAN=ON -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache"/' hello2d/build-profile.json5 | |
| hvigorw assembleHap \ | |
| -Dohos.sdk.root=$DEVECO_SDK_HOME \ | |
| -p buildMode=release \ | |
| --parallel \ | |
| --no-daemon | |
| - name: Save ccache | |
| if: ${{ github.event_name == 'push' }} | |
| uses: actions/cache/save@v4 | |
| with: | |
| path: ~/.cache/ccache | |
| key: ccache-ohos-vulkan-${{ runner.os }}-main | |
| - name: Save Third-Party Cache | |
| if: ${{ (github.event_name == 'push') && (steps.third-party-cache.outputs.cache-hit != 'true') }} | |
| uses: actions/cache/save@v4 | |
| with: | |
| path: third_party | |
| key: third-party-ohos-${{ hashFiles('DEPS') }}-${{ hashFiles('vendor.json') }} | |
| - name: Job Failed | |
| if: ${{ failure() }} | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: ohos_vulkan_build | |
| path: ohos/out |