-
-
Notifications
You must be signed in to change notification settings - Fork 0
83 lines (66 loc) · 2.06 KB
/
CI.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
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
working-directory: rust
- 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