name: CI for Android
# https://github.com/google/mozc/blob/master/docs/build_mozc_in_docker.md

# Run on push.
on: push

# Prevent previous workflows from running.
concurrency:
  group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
  cancel-in-progress: true

jobs:
  build:
    # https://github.com/actions/virtual-environments/blob/main/images/linux/Ubuntu2004-Readme.md
    runs-on: ubuntu-20.04
    timeout-minutes: 60

    steps:
      - name: checkout
        uses: actions/checkout@v2
        with:
          submodules: 'recursive'

      - name: setup
        run: |
          # Change the default Android NDK version.
          # https://github.com/actions/virtual-environments/issues/5595
          ANDROID_ROOT=/usr/local/lib/android
          ANDROID_SDK_ROOT=${ANDROID_ROOT}/sdk
          ANDROID_NDK_ROOT=${ANDROID_SDK_ROOT}/ndk-bundle
          ln -sfn $ANDROID_SDK_ROOT/ndk/21.4.7075529 $ANDROID_NDK_ROOT

      - name: build
        working-directory: ./src
        run: |
          bazel build --config oss_android package

name: CI for Android
# https://github.com/google/mozc/blob/master/docs/build_mozc_in_docker.md

# Run on push.
on: push

# Prevent previous workflows from running.
concurrency:
  group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
  cancel-in-progress: true

jobs:
  build:
    # https://github.com/actions/virtual-environments/blob/main/images/linux/Ubuntu2004-Readme.md
    runs-on: ubuntu-20.04
    timeout-minutes: 60

    steps:
      - name: checkout
        uses: actions/checkout@v2
        with:
          submodules: 'recursive'

      - name: setup
        run: |
          # Android NDK
          # Bazel has not yet supported Android NDK 22 or later.
          # https://github.com/bazelbuild/bazel/issues/12889
          # Install Android NDK 21.
          # https://github.com/actions/runner-images/issues/5930
          ANDROID_SDK_ROOT=/usr/local/lib/android/sdk
          SDKMANAGER=${ANDROID_SDK_ROOT}/cmdline-tools/latest/bin/sdkmanager
          echo "y" | $SDKMANAGER "ndk;21.4.7075529"
          echo "ANDROID_NDK_HOME=$ANDROID_SDK_ROOT/ndk/21.4.7075529" >> $GITHUB_ENV

      - name: build
        working-directory: ./src
        run: |
          bazel build --config oss_android package

Use Android NDK 21 in GitHub Actions.
Use Android NDK 21 in GitHub Actions.

* This will fix the current build error for GitHub Actions.

PiperOrigin-RevId: 467605371
