Skip to content

Commit

Permalink
Add CI for Android
Browse files Browse the repository at this point in the history
  • Loading branch information
inikulin committed Jan 26, 2024
1 parent 61d607a commit c93f63f
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 2 deletions.
14 changes: 14 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,16 +51,20 @@ jobs:
thing:
- x86_64-linux
- aarch64-linux
- arm64-android
- x86_64-macos
include:
- apt_packages: ""
- custom_env: {}
- build_only: false

- thing: x86_64-linux
target: x86_64-unknown-linux-gnu
rust: stable
os: ubuntu-latest

- thing: aarch64-linux
build_only: true
target: aarch64-unknown-linux-gnu
rust: stable
os: ubuntu-latest
Expand All @@ -69,11 +73,18 @@ jobs:
CC: aarch64-linux-gnu-gcc
CXX: aarch64-linux-gnu-g++
CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER: aarch64-linux-gnu-g++

- thing: arm64-android
target: aarch64-linux-android
rust: stable
os: ubuntu-latest
build_only: true

- thing: x86_64-macos
target: x86_64-apple-darwin
rust: stable
os: macos-latest

steps:
- uses: actions/checkout@v2
with:
Expand All @@ -86,6 +97,9 @@ jobs:
run: sudo apt update && sudo apt install -y ${{ matrix.apt_packages }}
shell: bash
- run: rustup target add ${{ matrix.target }}
- name: Set Android Linker path
if: endsWith(matrix.thing, '-android')
run: echo "CARGO_TARGET_$(echo ${{ matrix.target }} | tr \\-a-z _A-Z)_LINKER=$ANDROID_NDK/toolchains/llvm/prebuilt/linux-x86_64/bin/$(echo ${{ matrix.target }} | sed s/armv7/armv7a/)21-clang++" >> "$GITHUB_ENV"
- name: Build tests
# We `build` because we want the linker to verify we are cross-compiling correctly for check-only targets.
run: cargo build --target ${{ matrix.target }}
Expand Down
2 changes: 1 addition & 1 deletion foundations/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ pub mod reexports_for_macros {
/// be embedded in your binary.
///
/// [jemalloc]: https://github.com/jemalloc/jemalloc
#[cfg(feature = "jemalloc")]
#[cfg(all(feature = "jemalloc", not(target_os = "android")))]
#[global_allocator]
pub static JEMALLOC_MEMORY_ALLOCATOR: tikv_jemallocator::Jemalloc = tikv_jemallocator::Jemalloc;

Expand Down
2 changes: 1 addition & 1 deletion foundations/src/telemetry/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ pub mod metrics;
#[cfg(feature = "tracing")]
pub mod tracing;

#[cfg(all(target_os = "linux", feature = "memory-profiling"))]
#[cfg(all(target_os = "linux", not(target_os = "android"), feature = "memory-profiling"))]
mod memory_profiler;

pub mod settings;
Expand Down

0 comments on commit c93f63f

Please sign in to comment.