ANGLE #188
Workflow file for this run
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: ANGLE | |
| on: | |
| workflow_dispatch: | |
| jobs: | |
| build: | |
| strategy: | |
| matrix: | |
| arch: ["x64", "arm", "arm64", "arm64-fastdebug"] # x86在较新的ndk上不受支持 | |
| fail-fast: false | |
| name: "Build for Android ${{matrix.arch}}" | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@main | |
| with: | |
| fetch-depth: 1 | |
| # ---------- 缓存 depot_tools ---------- | |
| - name: Cache depot_tools | |
| id: cache-depot-tools | |
| uses: actions/cache@main | |
| with: | |
| path: depot_tools | |
| key: depot-tools-${{ runner.os }}-${{ hashFiles('.gclient') }} | |
| restore-keys: | | |
| depot-tools-${{ runner.os }}- | |
| - name: Setup depot_tools | |
| if: steps.cache-depot-tools.outputs.cache-hit != 'true' | |
| shell: bash | |
| run: | | |
| # 清理磁盘空间(原有) | |
| sudo rm -rf /usr/share/dotnet | |
| sudo rm -rf /opt/ghc | |
| sudo rm -rf /usr/local/share/boost | |
| sudo rm -rf "$AGENT_TOOLSDIRECTORY" | |
| sudo rm -rf JAVA_HOME_8_X64 | |
| sudo rm -rf JAVA_HOME_11_X64 | |
| sudo rm -rf JAVA_HOME_17_X64 | |
| sudo rm -rf JAVA_HOME_21_X64 | |
| sudo rm -rf JAVA_HOME_25_X64 | |
| sudo rm -rf /usr/share/miniconda | |
| sudo rm -rf /usr/local/share/vcpkg | |
| sudo rm -rf /usr/local/lib/android/sdk/ndk/27.3.13750724 | |
| git clone --depth 1 https://chromium.googlesource.com/chromium/tools/depot_tools.git | |
| - name: Cache ANGLE dependencies | |
| id: cache-deps | |
| uses: actions/cache@main | |
| with: | |
| path: | | |
| build/linux | |
| third_party/llvm-build | |
| third_party/rust-toolchain | |
| tools/glslang | |
| tools/flex-bison | |
| key: deps-${{ runner.os }}-${{ hashFiles('DEPS') }} | |
| restore-keys: | | |
| deps-${{ runner.os }}- | |
| - name: Run gclient sync | |
| shell: bash | |
| run: | | |
| # 确保 PATH 包含 depot_tools | |
| export PATH=`pwd`/depot_tools:$PATH | |
| # 如果 .gclient 不存在,则先运行 bootstrap 创建(缓存恢复后可能缺失) | |
| if [ ! -f .gclient ]; then | |
| vpython3 scripts/bootstrap.py | |
| fi | |
| COMMIT_COUNT=$(git ls-remote origin | wc -l) | |
| echo "ANGLE_COMMIT_COUNT=$COMMIT_COUNT" >> $GITHUB_ENV | |
| echo "DEPOT_TOOLS_COMMIT=$(git -C depot_tools rev-parse HEAD)" >> $GITHUB_ENV | |
| echo $PATH | |
| gclient sync --no-history --shallow --reset --force | |
| - name: ccache | |
| uses: hendrikmuhs/ccache-action@main | |
| with: | |
| key: angle-ccache | |
| max-size: 5G | |
| - name: Setup ccache path | |
| shell: bash | |
| run: | | |
| echo "$HOME/.local/bin" >> $GITHUB_PATH | |
| echo "/usr/lib/ccache" >> $GITHUB_PATH | |
| which ccache || echo "ccache not found" | |
| ccache --version | |
| - name: Build ANGLE | |
| shell: bash | |
| run: | | |
| COMMIT_COUNT=$(git ls-remote origin | wc -l) | |
| echo "ANGLE_COMMIT_COUNT=$COMMIT_COUNT" >> $GITHUB_ENV | |
| echo "DEPOT_TOOLS_COMMIT=$(git -C depot_tools rev-parse HEAD)" >> $GITHUB_ENV | |
| export PATH=`pwd`/depot_tools:$PATH | |
| echo $PATH | |
| gn gen out/Android-${{matrix.arch}} --threads=$(nproc) | |
| gn args out/Android-${{ matrix.arch }} --list --short | |
| autoninja -C out/Android-${{matrix.arch}} -j $(nproc) | |
| - name: Dump logs on failure | |
| if: failure() | |
| shell: bash | |
| run: | | |
| find out/Android-${{matrix.arch}} -name "siso_output" -exec cat {} \; | |
| chmod +x ./out/Android-${{matrix.arch}}/siso_failed_commands.sh | |
| ./out/Android-${{matrix.arch}}/siso_failed_commands.sh | |
| - name: Upload angle | |
| uses: actions/upload-artifact@main | |
| with: | |
| name: angle-${{matrix.arch}}-${{ github.run_number }} | |
| path: out/Android-${{matrix.arch}}/*.so |