This repository has been archived by the owner on Oct 20, 2024. It is now read-only.
fix: remove log module #1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build Level Hash | |
on: | |
push: | |
branches: ["main"] | |
pull_request: | |
branches: ["main"] | |
env: | |
CARGO_TERM_COLOR: always | |
jobs: | |
build_android: | |
name: Build for Android | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: true | |
matrix: | |
target: | |
- aarch64-linux-android | |
- x86_64-linux-android | |
platform: | |
- 21 | |
- 26 | |
env: | |
NDK_VERSION: r27 | |
ANDROID_PLATFORM: ${{ matrix.platform }} | |
steps: | |
- name: Cancel previous runs | |
uses: styfle/cancel-workflow-action@0.12.1 | |
with: | |
access_token: ${{ github.token }} | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
submodules: "recursive" | |
- name: Setup Rust | |
run: | | |
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y && \ | |
rustup install nightly && \ | |
rustup default nightly && \ | |
rustup target add ${{ matrix.target }} | |
- name: Install packages | |
run: | | |
sudo apt-get install -y \ | |
libclang-dev \ | |
llvm-dev \ | |
clang \ | |
lld \ | |
cmake \ | |
gcc-multilib | |
- name: Setup Android NDK | |
run: | | |
wget -q https://dl.google.com/android/repository/android-ndk-${NDK_VERSION}-linux.zip -O /tmp/android-ndk.zip | |
unzip -q -d ~/ /tmp/android-ndk.zip | |
export ANDROID_NDK_HOME=~/android-ndk-${NDK_VERSION} | |
export NDK=${ANDROID_NDK_HOME} | |
export PATH=$PATH:${NDK}/toolchains/llvm/prebuilt/linux-x86_64/bin | |
echo "ANDROID_NDK_HOME=${ANDROID_NDK_HOME}" >> $GITHUB_ENV | |
echo "NDK=${NDK}" >> $GITHUB_ENV | |
echo "CARGO_TARGET_AARCH64_LINUX_ANDROID_LINKER=$(which aarch64-linux-android${ANDROID_PLATFORM}-clang)" >> $GITHUB_ENV | |
echo "CARGO_TARGET_X86_64_LINUX_ANDROID_LINKER=$(which x86_64-linux-android${ANDROID_PLATFORM}-clang)" >> $GITHUB_ENV | |
- name: Build | |
run: | | |
cargo build --target ${{ matrix.target }} | |
- name: Upload artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: ${{ matrix.target }}-${{ matrix.platform }} | |
path: | | |
target/${{ matrix.target }}/debug/liblevel_hash.so | |
build_linux: | |
name: Build for Linux | |
runs-on: ubuntu-latest | |
env: | |
RUSTFLAGS: "-C target-cpu=native" | |
steps: | |
- name: Cancel previous runs | |
uses: styfle/cancel-workflow-action@0.12.1 | |
with: | |
access_token: ${{ github.token }} | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
submodules: "recursive" | |
- name: Setup Rust | |
run: | | |
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y | |
rustup install nightly | |
rustup default nightly | |
- name: Install packages | |
run: | | |
sudo apt-get install -y gcc-aarch64-linux-gnu \ | |
gcc-arm-linux-gnueabi \ | |
gcc-i686-linux-gnu | |
- name: Build | |
run: cargo build | |
- name: Check | |
run: cargo check | |
- name: Run tests | |
run: cargo test | |
- name: Upload artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: x86_64-unknown-linux-gnu | |
path: | | |
target/debug/liblevel_hash.so |