New ensureFinalized
Dart function
#268
Workflow file for this run
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
name: build-test | |
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 }} | |
timeout-minutes: 60 | |
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@v3 | |
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 Protobuf compiler | |
uses: arduino/setup-protoc@v2 | |
with: | |
repo-token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Install shorthand CLI tool | |
run: cargo install --path shorthand/ | |
- name: Create a Flutter app for testing | |
run: flutter create test_app | |
- 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@v3 | |
with: | |
distribution: "zulu" | |
java-version: "11" | |
- name: Fetch Flutter dependencies | |
working-directory: test_app/ | |
run: flutter pub get | |
- name: Add this framework as a dependency | |
working-directory: test_app/ | |
run: dart pub add "rust_in_flutter:{'path':'../'}" | |
- name: Apply Rust template | |
working-directory: test_app/ | |
run: rifs template | |
- name: Generate message files | |
working-directory: test_app/ | |
run: rifs message | |
- name: Build the example app | |
if: matrix.target == 'linux' | |
working-directory: test_app/ | |
run: flutter build linux | |
- name: Build the example app | |
if: matrix.target == 'android' | |
working-directory: test_app/ | |
run: | | |
flutter build apk | |
flutter build appbundle | |
- name: Build the example app | |
if: matrix.target == 'windows' | |
working-directory: test_app/ | |
run: flutter build windows | |
- name: Build the example app | |
if: matrix.target == 'macos' | |
working-directory: test_app/ | |
run: flutter build macos | |
- name: Build the example app | |
if: matrix.target == 'ios' | |
working-directory: test_app/ | |
run: flutter build ios --no-codesign | |
- name: Build the example app | |
if: matrix.target == 'web' | |
working-directory: test_app/ | |
run: | | |
rifs wasm --release | |
flutter build web |