|
24 | 24 | with:
|
25 | 25 | github_token: ${{ secrets.GITHUB_TOKEN }}
|
26 | 26 |
|
| 27 | + - uses: actions/setup-python@v1 |
| 28 | + - run: pip install cpplint |
| 29 | + - run: cpplint --linelength=230 --filter=-legal/copyright,-whitespace/indent,-whitespace/comments,-whitespace/ending_newline,-build/include_order,-runtime/references,-readability/todo,-whitespace/blank_line,-whitespace/todo,-runtime/int,-build/c++11,-whitespace/parens --exclude=package/cpp/skia --exclude=package/ios --exclude=package/android/build --exclude=package/node_modules --recursive package |
| 30 | + |
27 | 31 | - name: Clang Format
|
28 | 32 | working-directory: packages/skia
|
29 | 33 | run: yarn clang-format
|
|
66 | 70 | - name: Build package
|
67 | 71 | run: yarn build
|
68 | 72 |
|
| 73 | + build-android-ubuntu: |
| 74 | + runs-on: ubuntu-latest |
| 75 | + continue-on-error: true |
| 76 | + env: |
| 77 | + TURBO_CACHE_DIR: .turbo/android |
| 78 | + steps: |
| 79 | + - name: Checkout |
| 80 | + uses: actions/checkout@v3 |
| 81 | + with: |
| 82 | + submodules: recursive |
| 83 | + |
| 84 | + - name: Setup |
| 85 | + uses: ./.github/actions/setup |
| 86 | + with: |
| 87 | + github_token: ${{ secrets.GITHUB_TOKEN }} |
| 88 | + |
| 89 | + - name: Cache turborepo for Android |
| 90 | + uses: actions/cache@v3 |
| 91 | + with: |
| 92 | + path: ${{ env.TURBO_CACHE_DIR }} |
| 93 | + key: ${{ runner.os }}-turborepo-android-${{ hashFiles('yarn.lock') }} |
| 94 | + restore-keys: | |
| 95 | + ${{ runner.os }}-turborepo-android |
| 96 | +
|
| 97 | + - name: Check turborepo cache for Android |
| 98 | + run: | |
| 99 | + TURBO_CACHE_STATUS=$(node -p "($(yarn turbo run build:android --cache-dir="${{ env.TURBO_CACHE_DIR }}" --dry=json)).tasks.find(t => t.task === 'build:android').cache.status") |
| 100 | +
|
| 101 | + if [[ $TURBO_CACHE_STATUS == "HIT" ]]; then |
| 102 | + echo "turbo_cache_hit=1" >> $GITHUB_ENV |
| 103 | + fi |
| 104 | +
|
| 105 | + - name: Install JDK |
| 106 | + if: env.turbo_cache_hit != 1 |
| 107 | + uses: actions/setup-java@v3 |
| 108 | + with: |
| 109 | + distribution: 'zulu' |
| 110 | + java-version: '17' |
| 111 | + |
| 112 | + - name: Install NDK |
| 113 | + if: env.turbo_cache_hit != 1 |
| 114 | + uses: nttld/setup-ndk@v1 |
| 115 | + id: setup-ndk |
| 116 | + with: |
| 117 | + ndk-version: r26d |
| 118 | + |
| 119 | + - name: Set ANDROID_NDK |
| 120 | + run: echo "ANDROID_NDK=$ANDROID_HOME/ndk-bundle" >> $GITHUB_ENV |
| 121 | + |
| 122 | + - name: Finalize Android SDK |
| 123 | + if: env.turbo_cache_hit != 1 |
| 124 | + run: | |
| 125 | + /bin/bash -c "yes | $ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager --licenses > /dev/null" |
| 126 | +
|
| 127 | + - name: Install Android SDK |
| 128 | + run: | |
| 129 | + echo "sdk.dir=$ANDROID_HOME" > $GITHUB_WORKSPACE/apps/paper/android/local.properties |
| 130 | +
|
| 131 | + - name: Cache Gradle |
| 132 | + if: env.turbo_cache_hit != 1 |
| 133 | + uses: actions/cache@v3 |
| 134 | + with: |
| 135 | + path: | |
| 136 | + ~/.gradle/wrapper |
| 137 | + ~/.gradle/caches |
| 138 | + key: ${{ runner.os }}-gradle-${{ hashFiles('./apps/paper/android/gradle/wrapper/gradle-wrapper.properties') }} |
| 139 | + ${{ runner.os }}-gradle- |
| 140 | + |
| 141 | + - name: Build example for Android |
| 142 | + env: |
| 143 | + JAVA_OPTS: "-XX:MaxHeapSize=6g" |
| 144 | + run: | |
| 145 | + yarn turbo run build:android --cache-dir="${{ env.TURBO_CACHE_DIR }}" --concurrency 1 --filter=paper |
| 146 | +
|
69 | 147 | build-android:
|
70 | 148 | runs-on: macos-latest-large
|
71 | 149 | continue-on-error: true
|
|
0 commit comments