Skip to content

Merge pull request #183 from acterglobal/kumar/sheet-bugs-fixes #496

Merge pull request #183 from acterglobal/kumar/sheet-bugs-fixes

Merge pull request #183 from acterglobal/kumar/sheet-bugs-fixes #496

Workflow file for this run

name: CI
on:
push:
branches: [ main, develop ]
pull_request:
workflow_dispatch:
env:
FLUTTER_VERSION: '3.35.2'
# Disable precompiled binaries in CI to ensure we test actual compilation
CARGOKIT_DISABLE_PRECOMPILED_BINARIES: '1'
# Optimize Rust builds for CI
CARGO_INCREMENTAL: '0'
CARGO_NET_RETRY: '10'
RUST_BACKTRACE: '1'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
# Test and build for Android
android:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- uses: jlumbroso/free-disk-space@main
name: Free Disk Space
with:
tool-cache: true
android: false
- name: Setup Java
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '17'
- name: Setup Android SDK
uses: android-actions/setup-android@v3
- name: Setup Rust for Android
uses: acterglobal/zoe-relay/.github/actions/setup-rust-cross-platform@main
with:
targets: aarch64-linux-android
workspace_path: 'packages/zoe_native/rust'
install_android_ndk: true
- name: Setup Flutter
uses: subosito/flutter-action@v2
with:
flutter-version: ${{ env.FLUTTER_VERSION }}
channel: 'stable'
cache: true
- name: Install Flutter dependencies
run: flutter pub get
- name: Setup Android environment
run: |
echo "ANDROID_NDK_HOME=$ANDROID_NDK_LATEST_HOME" >> $GITHUB_ENV
echo "ANDROID_NDK_ROOT=$ANDROID_NDK_LATEST_HOME" >> $GITHUB_ENV
- name: Build for Android
run: |
# Set Rust optimization for faster builds
export CARGO_PROFILE_DEV_DEBUG=1
export CARGO_PROFILE_DEV_OPT_LEVEL=1
# Build only for essential architectures to save time and space
flutter build -v apk --debug --target-platform android-arm64
# Test and build for iOS
ios:
runs-on: macos-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Rust for iOS
uses: acterglobal/zoe-relay/.github/actions/setup-rust-cross-platform@main
with:
targets: 'aarch64-apple-ios,x86_64-apple-ios,aarch64-apple-ios-sim'
workspace_path: 'packages/zoe_native/rust'
- name: Setup Flutter
uses: subosito/flutter-action@v2
with:
flutter-version: ${{ env.FLUTTER_VERSION }}
channel: 'stable'
cache: true
- name: Install Flutter dependencies
run: flutter pub get
- name: Build for iOS
run: |
flutter build -v ios --debug --no-codesign
env:
# Ensure iOS SDK paths are available for Rust compilation
DEVELOPER_DIR: /Applications/Xcode_16.4.app/Contents/Developer
# Set minimum iOS deployment target to avoid warnings
IPHONEOS_DEPLOYMENT_TARGET: "12.0"
# Test and build for Linux
linux:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Rust for Linux
uses: acterglobal/zoe-relay/.github/actions/setup-rust-cross-platform@main
with:
workspace_path: 'packages/zoe_native/rust'
- uses: jlumbroso/free-disk-space@main
name: Free Disk Space
- name: Install Linux dependencies
run: |
sudo apt update
sudo apt install -y \
cmake \
clang \
ninja-build \
pkg-config \
libgtk-3-dev \
liblzma-dev \
libstdc++-12-dev \
libgstreamer1.0-dev \
libgstreamer-plugins-base1.0-dev \
libsecret-1-dev
- name: Setup Flutter
uses: subosito/flutter-action@v2
with:
flutter-version: ${{ env.FLUTTER_VERSION }}
channel: 'stable'
cache: true
- name: Enable Linux desktop
run: flutter config --enable-linux-desktop
- name: Install Flutter dependencies
run: flutter pub get
- name: Build for Linux
run: |
flutter build -v linux --debug
# Test and build for macOS
macos:
runs-on: macos-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Rust for macOS
uses: acterglobal/zoe-relay/.github/actions/setup-rust-cross-platform@main
with:
targets: 'x86_64-apple-darwin,aarch64-apple-darwin'
workspace_path: 'packages/zoe_native/rust'
- name: Setup Flutter
uses: subosito/flutter-action@v2
with:
flutter-version: ${{ env.FLUTTER_VERSION }}
channel: 'stable'
cache: true
- name: Enable macOS desktop
run: flutter config --enable-macos-desktop
- name: Install Flutter dependencies
run: flutter pub get
- name: Create CI xcconfig to disable code signing
run: |
cat > macos/Runner/Configs/CI.xcconfig << EOF
#include "Debug.xcconfig"
CODE_SIGN_IDENTITY =
CODE_SIGNING_REQUIRED = NO
CODE_SIGNING_ALLOWED = NO
DEVELOPMENT_TEAM =
EOF
- name: Build for macOS
run: |
# Temporarily modify the project to use our CI config
sed -i.bak 's/Debug\.xcconfig/CI.xcconfig/g' macos/Runner.xcodeproj/project.pbxproj
flutter build -v macos --debug
# Restore the original project file
mv macos/Runner.xcodeproj/project.pbxproj.bak macos/Runner.xcodeproj/project.pbxproj
# Test and build for Windows
windows:
runs-on: windows-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Rust for Windows
uses: acterglobal/zoe-relay/.github/actions/setup-rust-cross-platform@main
with:
targets: 'x86_64-pc-windows-msvc'
workspace_path: 'packages/zoe_native/rust'
- name: Setup Flutter
uses: subosito/flutter-action@v2
with:
flutter-version: ${{ env.FLUTTER_VERSION }}
channel: 'stable'
cache: true
- name: Enable Windows desktop
run: flutter config --enable-windows-desktop
- name: Install Flutter dependencies
run: flutter pub get
- name: Build for Windows
run: |
flutter build -v windows --debug
# Run tests
test:
runs-on: ubuntu-latest
continue-on-error: true
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Rust for testing
uses: acterglobal/zoe-relay/.github/actions/setup-rust-cross-platform@main
with:
workspace_path: 'packages/zoe_native/rust'
- name: Setup Flutter
uses: subosito/flutter-action@v2
with:
flutter-version: ${{ env.FLUTTER_VERSION }}
channel: 'stable'
cache: true
- name: Install Flutter dependencies
run: flutter pub get
- name: Run Flutter tests
run: flutter test
- name: Run Flutter analyze
run: flutter analyze lib
# Check code formatting
format:
runs-on: ubuntu-latest
continue-on-error: true
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Rust for formatting
uses: acterglobal/zoe-relay/.github/actions/setup-rust-cross-platform@main
with:
workspace_path: 'packages/zoe_native/rust'
components: 'rustfmt'
- name: Setup Flutter
uses: subosito/flutter-action@v2
with:
flutter-version: ${{ env.FLUTTER_VERSION }}
channel: 'stable'
cache: true
- name: Check Rust formatting
working-directory: packages/zoe_native
run: cargo fmt --check
- name: Check Dart formatting
run: dart format --set-exit-if-changed .
# Test zoe_native plugin - comprehensive testing for the native FFI plugin
# This job tests the zoe_native plugin independently to ensure it builds,
# passes all tests, and follows code quality standards
zoe_native_plugin:
name: Test zoe_native plugin
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Rust for zoe_native
uses: acterglobal/zoe-relay/.github/actions/setup-rust-cross-platform@main
with:
workspace_path: 'packages/zoe_native/rust'
- name: Setup Flutter
uses: subosito/flutter-action@v2
with:
flutter-version: ${{ env.FLUTTER_VERSION }}
channel: 'stable'
cache: true
- name: Enable Linux desktop
run: flutter config --enable-linux-desktop
- name: Install zoe_native plugin dependencies
working-directory: packages/zoe_native
run: flutter pub get
- name: Install Rust dependencies for zoe_native
working-directory: packages/zoe_native
run: cargo fetch
- name: Run zoe_native Rust tests
working-directory: packages/zoe_native
run: cargo test
- name: Run zoe_native Flutter tests
working-directory: packages/zoe_native
run: flutter test
- name: Run zoe_native Flutter analyze
working-directory: packages/zoe_native
run: flutter analyze lib
- name: Build zoe_native Rust library
working-directory: packages/zoe_native
run: cargo build
- name: Check zoe_native Rust formatting
working-directory: packages/zoe_native
run: cargo fmt --check
- name: Check zoe_native Dart formatting
working-directory: packages/zoe_native
run: dart format --set-exit-if-changed lib