napi-rs/.github/workflows/android.yml
LongYinan 9f3fbaa8e0
fix(napi): race issues with Node.js worker_thread (#1081)
Co-authored-by: Jan Piotrowski <piotrowski+github@gmail.com>
2022-03-05 14:14:32 +08:00

69 lines
1.8 KiB
YAML

name: Android-aarch64
on:
push:
branches:
- main
pull_request:
env:
DEBUG: 'napi:*'
jobs:
build-android-aarch64:
name: Build - Android - aarch64
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup node
uses: actions/setup-node@v3
with:
node-version: 16
cache: 'yarn'
check-latest: true
- name: List NDK Home
run: ls -R "${ANDROID_NDK_HOME}"
- name: Install
uses: actions-rs/toolchain@v1
with:
toolchain: stable
profile: minimal
override: true
target: 'aarch64-linux-android'
- name: Generate Cargo.lock
uses: actions-rs/cargo@v1
with:
command: generate-lockfile
- name: Cache cargo registry
uses: actions/cache@v2
with:
path: ~/.cargo/registry
key: stable-linux-android-node@16-cargo-registry-trimmed-${{ hashFiles('**/Cargo.lock') }}
- name: Cache cargo index
uses: actions/cache@v2
with:
path: ~/.cargo/git
key: stable-linux-android-node@16-cargo-index-trimmed-${{ hashFiles('**/Cargo.lock') }}
- name: Cache NPM dependencies
uses: actions/cache@v2
with:
path: node_modules
key: npm-cache-linux-android-node@16-${{ hashFiles('yarn.lock') }}
- name: Install dependencies
run: yarn install --immutable --network-timeout 300000
- name: 'Build TypeScript'
run: yarn build
- name: Cross build native tests
run: |
export CARGO_TARGET_AARCH64_LINUX_ANDROID_LINKER="${ANDROID_NDK_HOME}/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android24-clang"
yarn build:test:android