forked from equalitie/ouisync
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: Test dart bindings on linux and windows
- Loading branch information
Showing
2 changed files
with
111 additions
and
92 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -84,83 +84,99 @@ jobs: | |
if: matrix.name == 'linux' | ||
run: ${{ matrix.cargo-command }} test --package ouisync-cli --test cli | ||
|
||
check_kotlin_bindings: | ||
name: check kotlin bindings | ||
runs-on: ubuntu-24.04 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Add rust targets | ||
run: rustup target add x86_64-linux-android armv7-linux-androideabi aarch64-linux-android | ||
|
||
- name: Setup java | ||
uses: actions/setup-java@v3 | ||
with: | ||
distribution: 'temurin' | ||
java-version: '17' | ||
|
||
- name: Setup gradle | ||
uses: gradle/[email protected] | ||
|
||
- name: Install system dependencies | ||
# NOTE: fuse isn't used by the bindings themselves but it's required for the unit tests | ||
# because they use the linux version of the ouisync_service library, not the android one | ||
# and the linux version does currently unconditionally depend on fuse. | ||
run: sudo apt-get install libfuse-dev | ||
|
||
# - name: Install NDK | ||
# uses: nttld/setup-ndk@v1 | ||
# with: | ||
# ndk-version: r27c | ||
# link-to-sdk: true | ||
# local-cache: true | ||
|
||
- name: Cache cargo artifacts | ||
uses: actions/cache@v3 | ||
with: | ||
path: | | ||
~/.cargo/bin/ | ||
~/.cargo/registry/index/ | ||
~/.cargo/registry/cache/ | ||
~/.cargo/git/db/ | ||
target/ | ||
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.toml') }} | ||
restore-keys: | | ||
${{ runner.os }}-cargo- | ||
- name: Cache gradle artifacts | ||
uses: actions/cache@v3 | ||
with: | ||
path: | | ||
~/.gradle/caches | ||
~/.gradle/wrapper | ||
key: ${{ runner.os }}-gradle-${{ hashFiles('bindings/kotlin/**/*.gradle*', 'bindings/kotlin/**/gradle-wrapper.properties') }} | ||
restore-keys: | | ||
${{ runner.os }}-gradle- | ||
- name: Create local.properties | ||
working-directory: bindings/kotlin | ||
run: echo "useLocalLib=true" > local.properties | ||
|
||
- name: Run spotless | ||
working-directory: bindings/kotlin | ||
run: ./gradlew --stacktrace spotlessCheck | ||
# TODO: The kotlin bindings need to be updated to the new service architecture, disabled for now | ||
# check_kotlin_bindings: | ||
# name: check kotlin bindings | ||
# runs-on: ubuntu-24.04 | ||
# steps: | ||
# - uses: actions/checkout@v4 | ||
|
||
# - name: Add rust targets | ||
# run: rustup target add x86_64-linux-android armv7-linux-androideabi aarch64-linux-android | ||
|
||
# - name: Setup java | ||
# uses: actions/setup-java@v3 | ||
# with: | ||
# distribution: 'temurin' | ||
# java-version: '17' | ||
|
||
# - name: Setup gradle | ||
# uses: gradle/[email protected] | ||
|
||
# - name: Install system dependencies | ||
# # NOTE: fuse isn't used by the bindings themselves but it's required for the unit tests | ||
# # because they use the linux version of the ouisync_service library, not the android one | ||
# # and the linux version does currently unconditionally depend on fuse. | ||
# run: sudo apt-get install libfuse-dev | ||
|
||
# # - name: Install NDK | ||
# # uses: nttld/setup-ndk@v1 | ||
# # with: | ||
# # ndk-version: r27c | ||
# # link-to-sdk: true | ||
# # local-cache: true | ||
|
||
# - name: Cache cargo artifacts | ||
# uses: actions/cache@v3 | ||
# with: | ||
# path: | | ||
# ~/.cargo/bin/ | ||
# ~/.cargo/registry/index/ | ||
# ~/.cargo/registry/cache/ | ||
# ~/.cargo/git/db/ | ||
# target/ | ||
# key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.toml') }} | ||
# restore-keys: | | ||
# ${{ runner.os }}-cargo- | ||
|
||
# - name: Cache gradle artifacts | ||
# uses: actions/cache@v3 | ||
# with: | ||
# path: | | ||
# ~/.gradle/caches | ||
# ~/.gradle/wrapper | ||
# key: ${{ runner.os }}-gradle-${{ hashFiles('bindings/kotlin/**/*.gradle*', 'bindings/kotlin/**/gradle-wrapper.properties') }} | ||
# restore-keys: | | ||
# ${{ runner.os }}-gradle- | ||
|
||
# - name: Create local.properties | ||
# working-directory: bindings/kotlin | ||
# run: echo "useLocalLib=true" > local.properties | ||
|
||
# - name: Run spotless | ||
# working-directory: bindings/kotlin | ||
# run: ./gradlew --stacktrace spotlessCheck | ||
|
||
# - name: Run lint | ||
# working-directory: bindings/kotlin | ||
# run: ./gradlew --stacktrace lint | ||
|
||
# - name: Run unit tests | ||
# working-directory: bindings/kotlin | ||
# run: ./gradlew --stacktrace lib:testDebugUnitTest | ||
|
||
# - name: Build the example app | ||
# working-directory: bindings/kotlin | ||
# run: ./gradlew --stacktrace example:assembleDebug | ||
|
||
- name: Run lint | ||
working-directory: bindings/kotlin | ||
run: ./gradlew --stacktrace lint | ||
check_dart_bindings: | ||
name: check dart bindings on ${{ matrix.name }} | ||
runs-on: ${{ matrix.os }} | ||
|
||
- name: Run unit tests | ||
working-directory: bindings/kotlin | ||
run: ./gradlew --stacktrace lib:testDebugUnitTest | ||
strategy: | ||
matrix: | ||
name: [linux, windows] | ||
include: | ||
- name: linux | ||
os: ubuntu-24.04 | ||
cargo-dir: ~/.cargo | ||
ouisync_lib: ../../target/debug/libouisync_service.so | ||
|
||
- name: Build the example app | ||
working-directory: bindings/kotlin | ||
run: ./gradlew --stacktrace example:assembleDebug | ||
- name: windows | ||
os: windows-latest | ||
cargo-dir: ~\cargo | ||
ouisync_lib: ..\..\target\debug\ouisync_service.dll | ||
|
||
check_dart_bindings: | ||
name: check dart bindings | ||
runs-on: ubuntu-24.04 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
|
@@ -173,14 +189,15 @@ jobs: | |
- uses: actions/cache@v3 | ||
with: | ||
path: | | ||
~/.cargo/bin/ | ||
~/.cargo/registry/index/ | ||
~/.cargo/registry/cache/ | ||
~/.cargo/git/db/ | ||
ouisync/target/ | ||
${{ matrix.cargo-dir }}/bin/ | ||
${{ matrix.cargo-dir }}/registry/index/ | ||
${{ matrix.cargo-dir }}/registry/cache/ | ||
${{ matrix.cargo-dir }}/git/db/ | ||
target/ | ||
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.toml') }} | ||
|
||
- name: Install system dependencies | ||
if: matrix.name == 'linux' | ||
run: sudo apt-get install libfuse-dev | ||
|
||
- name: Get dart dependencies | ||
|
@@ -192,17 +209,21 @@ jobs: | |
run: dart run util/bindgen.dart | ||
|
||
- name: Analyze | ||
# analyze should be the same on all platforms so run it on just one to save time | ||
if: matrix.name == 'linux' | ||
working-directory: bindings/dart | ||
run: | | ||
dart analyze lib | ||
dart analyze test | ||
dart analyze example | ||
- name: Building the ouisync service library for tests | ||
- name: Build the ouisync service library for tests | ||
run: cargo build -p ouisync-service --lib | ||
|
||
- name: Run tests | ||
working-directory: bindings/dart | ||
env: | ||
RUST_LOG: ouisync=debug,sqlx=warn | ||
OUISYNC_LIB: ${{ matrix.ouisync_lib }} | ||
run: flutter test | ||
|
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