Fix JavaScript bindings on the web #323
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 example app works properly. | |
name: example-app | |
on: | |
push: | |
branches: | |
- main | |
paths-ignore: | |
- "**.md" | |
- "**.html" | |
pull_request: | |
paths-ignore: | |
- "**.md" | |
- "**.html" | |
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 }} | |
strategy: | |
fail-fast: false # Important | |
matrix: | |
runner: [ubuntu-latest, windows-latest, macos-latest] | |
target: [android, web] # On all platforms | |
include: | |
# Specify targets for each platform | |
- runner: ubuntu-latest | |
target: linux | |
- runner: windows-latest | |
target: windows | |
- runner: macos-latest | |
target: macos | |
- runner: macos-latest | |
target: ios | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
with: | |
submodules: true | |
- 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: Setup Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: "3.11" | |
- name: Install the CLI tool | |
working-directory: rust_crate/ | |
run: cargo install --path ./ | |
- name: Prepare a Flutter app for testing | |
run: python 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 |