Skip to content

Sync with core ffb4a4509: window full-screen events #13

Sync with core ffb4a4509: window full-screen events

Sync with core ffb4a4509: window full-screen events #13

Workflow file for this run

name: Dart CI
on:
push:
branches: [ main, ohos-main ]
paths:
- "bindings/dart/**"
- "core"
- "examples/dart_*/**"
- "examples/flutter_*/**"
- "pubspec.yaml"
- ".github/workflows/dart-ci.yml"
pull_request:
branches: [ main, ohos-main ]
paths:
- "bindings/dart/**"
- "core"
- "examples/dart_*/**"
- "examples/flutter_*/**"
- "pubspec.yaml"
- ".github/workflows/dart-ci.yml"
jobs:
lint:
name: Lint & Analyze
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Checkout core
run: git submodule update --init core
- name: Setup Flutter
uses: subosito/flutter-action@v2
with:
flutter-version: '3.47.5'
channel: 'stable'
cache: true
- name: Install melos
run: dart pub global activate melos
- name: Add melos to PATH
run: echo "$HOME/.pub-cache/bin" >> $GITHUB_PATH
- name: Verify melos installation
run: dart pub global run melos --version
- name: Bootstrap melos
run: dart pub global run melos bootstrap
- name: Check code formatting
run: dart pub global run melos run format
- name: Analyze code
run: dart pub global run melos run analyze
test:
name: Test (${{ matrix.os }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Checkout core
run: git submodule update --init core
- name: Setup Flutter
uses: subosito/flutter-action@v2
with:
flutter-version: '3.47.5'
channel: 'stable'
cache: true
- name: Install melos
run: dart pub global activate melos
- name: Add melos to PATH
shell: bash
run: |
if [[ "$RUNNER_OS" == "Windows" ]]; then
echo "$USERPROFILE/.pub-cache/bin" >> $GITHUB_PATH
else
echo "$HOME/.pub-cache/bin" >> $GITHUB_PATH
fi
- name: Verify melos installation
run: dart pub global run melos --version
- name: Bootstrap melos
run: dart pub global run melos bootstrap
# cnativeapi's build hook compiles core, which needs GTK 3, X11 and Xi on Linux.
- name: Install Linux dependencies
if: runner.os == 'Linux'
run: sudo apt-get update && sudo apt-get install -y cmake pkg-config libgtk-3-dev libx11-dev libxi-dev
- name: Run tests
run: dart pub global run melos run test
# Android build
build-android:
name: Build Android
runs-on: ubuntu-latest
needs: [lint]
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Checkout core
run: git submodule update --init core
- name: Setup Flutter
uses: subosito/flutter-action@v2
with:
flutter-version: '3.47.5'
channel: 'stable'
cache: true
- name: Install melos
run: dart pub global activate melos
- name: Add melos to PATH
run: echo "$HOME/.pub-cache/bin" >> $GITHUB_PATH
- name: Bootstrap melos
run: dart pub global run melos bootstrap
- name: Setup Java
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '17'
- name: Build nativeapi example Android
run: |
cd bindings/dart/nativeapi_flutter/example
flutter build apk --release
# iOS build
build-ios:
name: Build iOS
runs-on: macos-latest
needs: [lint]
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Checkout core
run: git submodule update --init core
- name: Setup Flutter
uses: subosito/flutter-action@v2
with:
flutter-version: '3.47.5'
channel: 'stable'
cache: true
- name: Install melos
run: dart pub global activate melos
- name: Add melos to PATH
run: echo "$HOME/.pub-cache/bin" >> $GITHUB_PATH
- name: Bootstrap melos
run: dart pub global run melos bootstrap
- name: Build nativeapi example iOS
run: |
cd bindings/dart/nativeapi_flutter/example
flutter build ios --release --no-codesign
# Linux build
build-linux:
name: Build Linux
runs-on: ubuntu-latest
needs: [lint]
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Checkout core
run: git submodule update --init core
- name: Setup Flutter
uses: subosito/flutter-action@v2
with:
flutter-version: '3.47.5'
channel: 'stable'
cache: true
- name: Install melos
run: dart pub global activate melos
- name: Add melos to PATH
run: echo "$HOME/.pub-cache/bin" >> $GITHUB_PATH
- name: Bootstrap melos
run: dart pub global run melos bootstrap
- name: Install Linux dependencies
run: |
sudo apt-get update
sudo apt-get install -y \
libgtk-3-dev \
libblkid-dev \
liblzma-dev \
pkg-config \
cmake \
ninja-build \
clang \
libx11-dev \
libxi-dev
# cnativeapi is a plain Dart package: its build hook compiles core.
- name: Run cnativeapi example Linux
working-directory: bindings/dart/cnativeapi
run: dart run example/cnativeapi_example.dart
- name: Build nativeapi example Linux
run: |
cd bindings/dart/nativeapi_flutter/example
flutter build linux --release
# macOS build
build-macos:
name: Build macOS
runs-on: macos-latest
needs: [lint]
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Checkout core
run: git submodule update --init core
- name: Setup Flutter
uses: subosito/flutter-action@v2
with:
flutter-version: '3.47.5'
channel: 'stable'
cache: true
- name: Install melos
run: dart pub global activate melos
- name: Add melos to PATH
run: echo "$HOME/.pub-cache/bin" >> $GITHUB_PATH
- name: Bootstrap melos
run: dart pub global run melos bootstrap
# cnativeapi is a plain Dart package: its build hook compiles core.
- name: Run cnativeapi example macOS
working-directory: bindings/dart/cnativeapi
run: dart run example/cnativeapi_example.dart
- name: Build nativeapi example macOS
run: |
cd bindings/dart/nativeapi_flutter/example
flutter build macos --release
# Windows build
build-windows:
name: Build Windows
runs-on: windows-latest
needs: [lint]
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Checkout core
run: git submodule update --init core
- name: Setup Flutter
uses: subosito/flutter-action@v2
with:
flutter-version: '3.47.5'
channel: 'stable'
cache: true
- name: Install melos
run: dart pub global activate melos
- name: Add melos to PATH
shell: bash
run: echo "$USERPROFILE/.pub-cache/bin" >> $GITHUB_PATH
- name: Bootstrap melos
run: dart pub global run melos bootstrap
# cnativeapi is a plain Dart package: its build hook compiles core.
- name: Run cnativeapi example Windows
working-directory: bindings/dart/cnativeapi
run: dart run example/cnativeapi_example.dart
- name: Build nativeapi example Windows
run: |
cd bindings/dart/nativeapi_flutter/example
flutter build windows --release