Skip to content

Merge pull request #644 from cunarist/happy-clippy #661

Merge pull request #644 from cunarist/happy-clippy

Merge pull request #644 from cunarist/happy-clippy #661

Workflow file for this run

# Verify that the example app works properly.
name: Example App
on:
push:
branches:
- main
paths-ignore:
- "**.md"
pull_request:
paths-ignore:
- "**.md"
workflow_dispatch:
concurrency:
# Cancels the workflow
# when another event in the same context happens.
# If it's a PR, context is the pull request number.
# Otherwise, it uses the Git reference(branch or tag name).
group: >
${{ github.workflow }}
${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
build:
name: ${{ matrix.runner }} / ${{ matrix.target }}
runs-on: ${{ matrix.runner }}-latest
strategy:
fail-fast: false # Important
matrix:
runner: [ubuntu, windows, macos]
target: [android, web] # On all platforms
include:
# Specify targets for each platform
- runner: ubuntu
target: linux
- runner: windows
target: windows
- runner: macos
target: macos
- runner: macos
target: ios
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: true
- name: Cache dependencies
uses: actions/cache@v4
with:
path: |
~/.cargo/registry
target
~/.pub-cache
key: >
${{ matrix.runner }}-${{ matrix.target }}
${{ hashFiles('**/Cargo.toml', '**/pubspec.yaml') }}
restore-keys: |
${{ matrix.runner }}-${{ matrix.target }}
${{ matrix.runner }}
- name: Setup Flutter SDK
uses: subosito/flutter-action@v2
with:
channel: "stable"
- name: Setup Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt
- name: Setup Ninja and GTK3 toolchain (Only Linux target)
if: matrix.target == 'linux'
run: |
sudo apt-get update -y
sudo apt-get install -y ninja-build libgtk-3-dev
- name: Setup Java toolchain (Only Android target)
if: matrix.target == 'android'
uses: actions/setup-java@v4
with:
distribution: "zulu"
java-version: "17"
- name: Install the Python environment manager
uses: astral-sh/setup-uv@v6
with:
enable-cache: false
- name: Install the CLI tool
run: cargo install --path rust_crate_cli
- name: Prepare a Flutter app for testing
run: uv run automate prepare-example-app
- name: Build the example app
if: matrix.target == 'linux'
working-directory: flutter_package/example/
run: flutter build linux --verbose
- name: Build the example app
if: matrix.target == 'android'
working-directory: flutter_package/example/
run: |
flutter build apk --verbose
flutter build appbundle --verbose
- name: Build the example app
if: matrix.target == 'windows'
working-directory: flutter_package/example/
run: flutter build windows --verbose
- name: Build the example app
if: matrix.target == 'macos'
working-directory: flutter_package/example/
run: flutter build macos --verbose
- name: Build the example app
if: matrix.target == 'ios'
working-directory: flutter_package/example/
run: flutter build ios --verbose --no-codesign
- name: Build the example app
if: matrix.target == 'web'
working-directory: flutter_package/example/
run: |
rinf wasm --release
flutter build web --verbose
- name: Run unit tests
if: >
matrix.target == 'linux'
|| matrix.target == 'windows'
|| matrix.target == 'macos'
working-directory: flutter_package/example/
run: flutter test