User App #14640
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
# Verify that the documentation steps function as intended | |
# when users utilize released versions | |
# instead of the code from the repository. | |
name: User App | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: "*/30 * * * *" | |
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@v3 | |
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 | |
- 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@v5 | |
- name: Install the CLI tool | |
run: cargo install rinf_cli | |
- name: Prepare a Flutter app for testing | |
run: uv run automate prepare-user-app | |
- name: Build the example app | |
if: matrix.target == 'linux' | |
working-directory: user_app/ | |
run: flutter build linux --verbose | |
- name: Build the example app | |
if: matrix.target == 'android' | |
working-directory: user_app/ | |
run: | | |
flutter build apk --verbose | |
flutter build appbundle --verbose | |
- name: Build the example app | |
if: matrix.target == 'windows' | |
working-directory: user_app/ | |
run: flutter build windows --verbose | |
- name: Build the example app | |
if: matrix.target == 'macos' | |
working-directory: user_app/ | |
run: flutter build macos --verbose | |
- name: Build the example app | |
if: matrix.target == 'ios' | |
working-directory: user_app/ | |
run: flutter build ios --verbose --no-codesign | |
- name: Build the example app | |
if: matrix.target == 'web' | |
working-directory: user_app/ | |
run: | | |
rinf wasm --release | |
flutter build web --verbose |