|
| 1 | +name: CI (android) |
| 2 | + |
| 3 | +on: |
| 4 | + workflow_dispatch: # allows manual triggering |
| 5 | + push: |
| 6 | + branches: |
| 7 | + - master |
| 8 | + paths: ['.github/workflows/build-android.yml', |
| 9 | + '**/CMakeLists.txt', |
| 10 | + '**/*.h', |
| 11 | + '**/*.hpp', |
| 12 | + '**/*.c', |
| 13 | + '**/*.cpp', |
| 14 | + '**/*.java'] |
| 15 | + |
| 16 | + pull_request: |
| 17 | + types: [opened, synchronize, reopened] |
| 18 | + paths-ignore: |
| 19 | + - 'bindings/ruby/**' # handled by bindings-ruby.yml |
| 20 | + - 'bindings/go/**' # handled by bindings-go.yml |
| 21 | + - 'examples/addon.node/**' # handled by examples.yml |
| 22 | + |
| 23 | +concurrency: |
| 24 | + group: ${{ github.workflow }}-${{ github.head_ref && github.ref || github.run_id }} |
| 25 | + cancel-in-progress: true |
| 26 | + |
| 27 | +jobs: |
| 28 | + android: |
| 29 | + runs-on: ubuntu-22.04 |
| 30 | + |
| 31 | + steps: |
| 32 | + - name: Clone |
| 33 | + uses: actions/checkout@v6 |
| 34 | + with: |
| 35 | + path: whisper |
| 36 | + |
| 37 | + - name: Install Java |
| 38 | + uses: actions/setup-java@v5 |
| 39 | + with: |
| 40 | + distribution: zulu |
| 41 | + java-version: 21 |
| 42 | + |
| 43 | + - name: Setup Android SDK |
| 44 | + uses: android-actions/setup-android@v3 |
| 45 | + |
| 46 | + - name: Build |
| 47 | + run: | |
| 48 | + cd whisper/examples/whisper.android |
| 49 | + ./gradlew assembleRelease --no-daemon |
| 50 | +
|
| 51 | + - name: Build with external ggml |
| 52 | + run: | |
| 53 | + export PATH_TO_GGML=$PWD/ggml |
| 54 | + cd whisper/examples/whisper.android |
| 55 | + ./gradlew assembleRelease --no-daemon |
| 56 | +
|
| 57 | + android_java: |
| 58 | + runs-on: ubuntu-22.04 |
| 59 | + |
| 60 | + steps: |
| 61 | + - name: Clone |
| 62 | + uses: actions/checkout@v6 |
| 63 | + |
| 64 | + - name: set up JDK 11 |
| 65 | + uses: actions/setup-java@v5 |
| 66 | + with: |
| 67 | + java-version: '11' |
| 68 | + distribution: 'temurin' |
| 69 | + cache: gradle |
| 70 | + |
| 71 | + - name: Setup Android SDK |
| 72 | + uses: android-actions/setup-android@v3 |
| 73 | + with: |
| 74 | + cmdline-tools-version: 9.0 |
| 75 | + |
| 76 | + - name: Build |
| 77 | + run: | |
| 78 | + cd examples/whisper.android.java |
| 79 | + chmod +x ./gradlew |
| 80 | + ./gradlew assembleRelease |
0 commit comments