Skip to content

Commit 9e8c3f5

Browse files
authored
Refine CI tasks (#2611)
1 parent 5a683bf commit 9e8c3f5

File tree

3 files changed

+78
-90
lines changed

3 files changed

+78
-90
lines changed

.github/workflows/android-ubuntu.yml

Lines changed: 0 additions & 76 deletions
This file was deleted.

.github/workflows/ci.yml

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,10 @@ jobs:
2424
with:
2525
github_token: ${{ secrets.GITHUB_TOKEN }}
2626

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+
2731
- name: Clang Format
2832
working-directory: packages/skia
2933
run: yarn clang-format
@@ -66,6 +70,80 @@ jobs:
6670
- name: Build package
6771
run: yarn build
6872

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+
69147
build-android:
70148
runs-on: macos-latest-large
71149
continue-on-error: true

.github/workflows/cpplint.yml

Lines changed: 0 additions & 14 deletions
This file was deleted.

0 commit comments

Comments
 (0)