try fix #63
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 and Test | |
on: | |
push: | |
branches: [ "main", "master" ] | |
pull_request: | |
env: | |
CARGO_TERM_COLOR: always | |
FLUTTER_VERSION: "3.27.3" | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Install Rust toolchain | |
uses: actions-rs/toolchain@v1 | |
with: | |
profile: minimal | |
toolchain: stable | |
override: true | |
components: rustfmt, clippy | |
- name: Rust cache | |
uses: Swatinem/rust-cache@v2 | |
- name: Install Flutter | |
uses: subosito/flutter-action@v2 | |
with: | |
flutter-version: ${{ env.FLUTTER_VERSION }} | |
channel: 'stable' | |
- name: Install cargo-binstall | |
uses: cargo-bins/[email protected] | |
- name: Install flutter_rust_bridge_codegen and cargo-expand and fvm | |
run: | | |
set -eux -o pipefail | |
curl -fsSL https://fvm.app/install.sh | bash | |
cargo binstall --no-confirm --no-symlinks --force cargo-expand | |
cargo binstall --no-confirm --no-symlinks --force flutter_rust_bridge_codegen --version "2.7.1" | |
- name: lint lib before codegen | |
run: | | |
set -eux -o pipefail | |
pushd rust | |
cargo clippy -- -D warnings | |
cargo fmt -- --check | |
- name: Generate bridge code | |
run: | | |
set -eux -o pipefail | |
mkdir -p lib/src/rust | |
flutter_rust_bridge_codegen generate | |
# just ensure the version | |
sed -i --debug "s/2.7.1/2.7.0/g" rust/src/frb_generated.rs | |
- name: Flutter pub get | |
run: flutter pub get | |
- name: build lib | |
run: | | |
set -eux -o pipefail | |
pushd rust | |
cargo build --release | |
- name: Debugging with tmate | |
uses: mxschmitt/[email protected] | |
- name: test | |
run: | | |
dart run lib/example.dart | |
dart run lib/migrate.dart | |
dart run lib/schedule.dart | |
# dart run lib/optimize.dart | |
# - name: Flutter analyze | |
# run: flutter analyze |