Skip to content

Commit

Permalink
feat: Add an Android testing job
Browse files Browse the repository at this point in the history
  • Loading branch information
editso committed Aug 18, 2024
1 parent 7278d3e commit 95a22e1
Showing 1 changed file with 56 additions and 0 deletions.
56 changes: 56 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,61 @@ jobs:
- run: cargo test ${{ matrix.args }}
shell: alpine.sh {0}

test-android:
name: Test on Android
strategy:
matrix:
include:
- rust-target: aarch64-linux-android
os-arch: amd64

runs-on: ubuntu-20.04

env:
CARGO_BUILD_TARGET: ${{ matrix.rust-target }}
CARGO_TERM_VERBOSE: 'true'

steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
submodules: recursive

- name: Install system dependencies
run: |
sudo apt-get update
sudo apt-get -y install \
gawk \
flex \
bison \
clang \
automake \
autopoint \
gcc-multilib \
build-essential
- name: Install Rust stable for ${{ matrix.rust-target }}
uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.rust-target }}

- name: Install Android NDK
uses: nttld/setup-ndk@v1
id: setup-ndk
with:
ndk-version: r26d
# local-cache: true
# add-to-path: false

- name: Cargo test no run
run: cargo test --no-run
if: matrix.rust-target == 'aarch64-linux-android'
env:
RUSTFLAGS: -C linker=${{ steps.setup-ndk.outputs.ndk-path }}/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android30-clang
AR_aarch64_linux_android: ${{ steps.setup-ndk.outputs.ndk-path }}/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-ar
CC_aarch64_linux_android: ${{ steps.setup-ndk.outputs.ndk-path }}/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android30-clang
CXX_aarch64_linux_android: ${{ steps.setup-ndk.outputs.ndk-path }}/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android30-clang++

test-libbpf-rs:
# check that libbpf-rs, one of the main consumers of the library, works with
# this version of libbpf-sys
Expand Down Expand Up @@ -157,6 +212,7 @@ jobs:
needs:
- test-gnu
- test-musl
- test-android
- test-libbpf-rs
runs-on: ubuntu-22.04
steps:
Expand Down

0 comments on commit 95a22e1

Please sign in to comment.