Skip to content

Commit

Permalink
Refine CI tasks (#2611)
Browse files Browse the repository at this point in the history
  • Loading branch information
wcandillon authored Sep 5, 2024
1 parent 5a683bf commit 9e8c3f5
Show file tree
Hide file tree
Showing 3 changed files with 78 additions and 90 deletions.
76 changes: 0 additions & 76 deletions .github/workflows/android-ubuntu.yml

This file was deleted.

78 changes: 78 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ jobs:
with:
github_token: ${{ secrets.GITHUB_TOKEN }}

- uses: actions/setup-python@v1
- run: pip install cpplint
- 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

- name: Clang Format
working-directory: packages/skia
run: yarn clang-format
Expand Down Expand Up @@ -66,6 +70,80 @@ jobs:
- name: Build package
run: yarn build

build-android-ubuntu:
runs-on: ubuntu-latest
continue-on-error: true
env:
TURBO_CACHE_DIR: .turbo/android
steps:
- name: Checkout
uses: actions/checkout@v3
with:
submodules: recursive

- name: Setup
uses: ./.github/actions/setup
with:
github_token: ${{ secrets.GITHUB_TOKEN }}

- name: Cache turborepo for Android
uses: actions/cache@v3
with:
path: ${{ env.TURBO_CACHE_DIR }}
key: ${{ runner.os }}-turborepo-android-${{ hashFiles('yarn.lock') }}
restore-keys: |
${{ runner.os }}-turborepo-android
- name: Check turborepo cache for Android
run: |
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")
if [[ $TURBO_CACHE_STATUS == "HIT" ]]; then
echo "turbo_cache_hit=1" >> $GITHUB_ENV
fi
- name: Install JDK
if: env.turbo_cache_hit != 1
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: '17'

- name: Install NDK
if: env.turbo_cache_hit != 1
uses: nttld/setup-ndk@v1
id: setup-ndk
with:
ndk-version: r26d

- name: Set ANDROID_NDK
run: echo "ANDROID_NDK=$ANDROID_HOME/ndk-bundle" >> $GITHUB_ENV

- name: Finalize Android SDK
if: env.turbo_cache_hit != 1
run: |
/bin/bash -c "yes | $ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager --licenses > /dev/null"
- name: Install Android SDK
run: |
echo "sdk.dir=$ANDROID_HOME" > $GITHUB_WORKSPACE/apps/paper/android/local.properties
- name: Cache Gradle
if: env.turbo_cache_hit != 1
uses: actions/cache@v3
with:
path: |
~/.gradle/wrapper
~/.gradle/caches
key: ${{ runner.os }}-gradle-${{ hashFiles('./apps/paper/android/gradle/wrapper/gradle-wrapper.properties') }}
${{ runner.os }}-gradle-

- name: Build example for Android
env:
JAVA_OPTS: "-XX:MaxHeapSize=6g"
run: |
yarn turbo run build:android --cache-dir="${{ env.TURBO_CACHE_DIR }}" --concurrency 1 --filter=paper
build-android:
runs-on: macos-latest-large
continue-on-error: true
Expand Down
14 changes: 0 additions & 14 deletions .github/workflows/cpplint.yml

This file was deleted.

0 comments on commit 9e8c3f5

Please sign in to comment.