Skip to content

[WIP] NDK r27

[WIP] NDK r27 #79

name: Build jsc-android and test
on:
workflow_dispatch: {}
push:
branches: [main]
pull_request:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: 🔨 Use JDK 17
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '17'
- name: ⬢ Setup Node
uses: actions/setup-node@v4
with:
node-version: 18
- name: Install packages
run: |
sudo apt-get update
sudo apt-get install coreutils curl git wget python3 ruby gperf -y
shell: bash
- name: Install Android packages
run: |
export PATH=$PATH:$ANDROID_HOME/cmdline-tools/latest/bin:$ANDROID_HOME/platform-tools
yes | sdkmanager --licenses || true
sdkmanager \
"cmake;3.22.1" \
"ndk;27.1.12297006"
# move out builtin icu headers from ndk and prevent icu build errors
mv "${ANDROID_HOME}/ndk/27.1.12297006/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include/unicode" "${ANDROID_HOME}/ndk/27.1.12297006/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include/unicode2"
echo "ANDROID_NDK=$ANDROID_HOME/ndk/27.1.12297006" >> $GITHUB_ENV
echo "PATH=$PATH:$ANDROID_HOME/cmdline-tools/latest/bin:$ANDROID_HOME/platform-tools" >> $GITHUB_ENV
shell: bash
- name: Build
run: |
yarn install --frozen-lockfile
yarn clean
yarn download
yarn start
shell: bash
- name: Archive
run: |
mkdir -p archive
mv dist archive/
mv dist.unstripped archive/
shell: bash
- uses: actions/upload-artifact@v4
with:
name: archive
path: archive
test:
needs: build
runs-on: macOS-latest
steps:
- uses: actions/checkout@v4
- name: 🔨 Use JDK 17
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '17'
- uses: actions/download-artifact@v4
with:
name: archive
path: archive
- name: Install node packages
run: yarn install --frozen-lockfile
working-directory: test
- name: Run test
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: 21
arch: x86_64
disable-animations: false
script: mv archive/dist . && cd test && yarn && cd android && ./gradlew :app:assembleRelease :app:assembleAndroidTest :app:connectedAndroidTest