Skip to content

Instantly share code, notes, and snippets.

@okhiroyuki
Created March 14, 2020 08:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save okhiroyuki/bb28374f2fcf274e80cc06688f119a98 to your computer and use it in GitHub Desktop.
Save okhiroyuki/bb28374f2fcf274e80cc06688f119a98 to your computer and use it in GitHub Desktop.
Switch NDK on Android CI
name: Android CI
on:
pull_request:
types: [opened]
push:
branches: [ master ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: set up JDK 1.8
uses: actions/setup-java@v1
with:
java-version: 1.8
- name : install ndk
run: |
sudo curl --silent --show-error --location --fail --retry 3 \
--output /tmp/$NDK_VERSION.zip \
https://dl.google.com/android/repository/$NDK_VERSION-linux-x86_64.zip
sudo echo "$NDK_SHA /tmp/$NDK_VERSION.zip" > /tmp/$NDK_VERSION.zip.sha1
sha1sum -c /tmp/$NDK_VERSION.zip.sha1
sudo rm -rf $ANDROID_SDK_ROOT/ndk-bundle
sudo unzip -q /tmp/$NDK_VERSION.zip -d $ANDROID_SDK_ROOT
sudo mv $ANDROID_SDK_ROOT/$NDK_VERSION $ANDROID_SDK_ROOT/ndk-bundle
sudo chown -R root:root $ANDROID_SDK_ROOT/ndk-bundle
sudo rm -f /tmp/$NDK_VERSION*
if [[ -d $ANDROID_SDK_ROOT/ndk-bundle && \
-n "$(ls -A $ANDROID_SDK_ROOT/ndk-bundle)" ]]; then
echo "Android NDK installed"
else
echo "Android NDK did not install successfully"
exit 1
fi
env:
NDK_SHA: fd94d0be6017c6acbd193eb95e09cf4b6f61b834
NDK_VERSION: android-ndk-r19c
- name: Build with Gradle
run: ./gradlew build
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment