This repository has been archived by the owner on Oct 3, 2023. It is now read-only.
ci: Update the bindgen invocation #503
Workflow file for this run
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
on: [push] | |
name: CI | |
jobs: | |
setup: | |
name: build and test | |
runs-on: ubuntu-latest | |
steps: | |
# | |
# Setup | |
# | |
- uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
- uses: subosito/flutter-action@v2 | |
with: | |
channel: 'stable' | |
cache: true | |
# Cache rust artifacts | |
- uses: actions/cache@v3 | |
with: | |
path: | | |
~/.cargo/bin/ | |
~/.cargo/registry/index/ | |
~/.cargo/registry/cache/ | |
~/.cargo/git/db/ | |
ouisync/target/ | |
key: ${{ runner.os }}-cargo-${{ hashFiles('ouisync/**/Cargo.toml') }} | |
- name: Get dependencies | |
run: | | |
sudo apt-get install libfuse-dev | |
flutter pub get | |
- name: Generate bindings | |
run: dart run util/bindgen.dart | |
# | |
# Test | |
# | |
- name: Building ouisync library for the test | |
# Building without `--release` because debug is required for `flutter test` | |
run: cd ouisync && cargo build -p ouisync-ffi # --verbose | |
- name: Analyze | |
run: flutter analyze | |
- name: Run tests | |
env: | |
RUST_LOG: ouisync=debug,sqlx=warn | |
run: flutter test | |
# | |
# Build | |
# | |
- name: Add android targets | |
run: rustup target add x86_64-linux-android # armv7-linux-androideabi aarch64-linux-android i686-linux-android | |
- name: Tell the build process where Android NDK is located | |
run: echo "ndk.dir=$ANDROID_NDK_ROOT" >> android/local.properties | |
# HACK: x86_64-linux-android-ar was removed from the recent NDKs in favor of llvm-ar, but some | |
# rust crates still expect it there. | |
- name: Work around missing tool | |
run: cd $ANDROID_NDK_ROOT/toolchains/llvm/prebuilt/linux-x86_64/bin && ln -s llvm-ar x86_64-linux-android-ar | |
- name: Build AAR | |
run: flutter build aar --target-platform=android-x64 --no-release --debug --no-profile | |