Skip to content

ci: Test dart bindings on linux and windows #462

ci: Test dart bindings on linux and windows

ci: Test dart bindings on linux and windows #462

Workflow file for this run

name: CI
on: [push]
env:
PROPTEST_CASES: 32
jobs:
# check_rust_crates:
# name: check rust crates on ${{ matrix.name }}
# runs-on: ${{ matrix.os }}
# strategy:
# matrix:
# name: [android, linux, windows]
# include:
# - name: android
# os: ubuntu-24.04
# cargo-command: cross
# cargo-dir: ~/.cargo
# target: aarch64-linux-android
# - name: linux
# os: ubuntu-24.04
# cargo-command: cargo
# cargo-dir: ~/.cargo
# - name: windows
# os: windows-latest
# cargo-command: cargo
# cargo-dir: ~\cargo
# steps:
# - uses: actions/checkout@v4
# - name: Show rustc version
# run: rustc --version
# - name: Add rust target
# if: matrix.target != ''
# run: rustup target add ${{ matrix.target }}
# - uses: actions/cache@v3
# with:
# path: |
# ${{ 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'
# # NOTE: libfuse-dev is required only to build and run the ouisync
# # application. It is not required for building and using the ouisync
# # library.
# run: sudo apt-get install libfuse-dev
# - name: Install cross
# if: matrix.cargo-command == 'cross'
# run: cargo install cross --force --git https://github.com/cross-rs/cross
# - name: Run clippy
# run: >
# ${{ matrix.cargo-command }} clippy
# --package ouisync --package ouisync-bridge --package ouisync-service
# ${{ matrix.target != '' && format('--target {0}', matrix.target) || '' }}
# --all-targets
# --no-deps
# -- -Dwarnings
# - name: Run unit tests
# if: matrix.name == 'linux'
# run: ${{ matrix.cargo-command }} test --lib
# - name: Run lib integration tests
# if: matrix.name == 'linux'
# run: ${{ matrix.cargo-command }} test --package ouisync --test gc --test network --test sync
# env:
# RUST_LOG: ouisync=debug,gc=debug,network=debug,sync=debug
# - name: Run cli integration tests
# 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
# - 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
check_dart_bindings:
name: check dart bindings on ${{ matrix.name }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
# name: [linux, windows]
name: [windows]
include:
# - name: linux
# os: ubuntu-24.04
# cargo-dir: ~/.cargo
- name: windows
os: windows-latest
cargo-dir: ~\cargo
steps:
- uses: actions/checkout@v4
- uses: subosito/flutter-action@v2
with:
channel: 'stable'
cache: true
- name: DEBUG
run: ls
# Cache rust artifacts
- uses: actions/cache@v3
with:
path: |
${{ 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
working-directory: bindings/dart
run: flutter pub get
- name: Generate bindings
working-directory: bindings/dart
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: Build the ouisync service library for tests
run: cargo build -p ouisync-service --lib
- name: DEBUG
run: "dir /s /b"
- name: Run tests
working-directory: bindings/dart
env:
RUST_LOG: ouisync=debug,sqlx=warn
run: flutter test