2023-01-03 14:34:55 +00:00
|
|
|
name: Rust-CI
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- "main"
|
|
|
|
- "release/*"
|
|
|
|
paths:
|
|
|
|
- "frontend/rust-lib/**"
|
|
|
|
- "shared-lib/**"
|
|
|
|
|
|
|
|
pull_request:
|
|
|
|
branches:
|
|
|
|
- "main"
|
|
|
|
- "release/*"
|
|
|
|
paths:
|
|
|
|
- "frontend/rust-lib/**"
|
|
|
|
- "shared-lib/**"
|
|
|
|
|
|
|
|
env:
|
|
|
|
CARGO_TERM_COLOR: always
|
|
|
|
RUST_TOOLCHAIN: "1.65"
|
2023-04-04 04:48:56 +00:00
|
|
|
FLUTTER_VERSION: "3.7.5"
|
2023-01-03 14:34:55 +00:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
test-on-ubuntu:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2023-01-03 14:55:30 +00:00
|
|
|
- name: Checkout source code
|
|
|
|
uses: actions/checkout@v2
|
|
|
|
|
2023-01-03 14:34:55 +00:00
|
|
|
- name: Install Rust toolchain
|
|
|
|
id: rust_toolchain
|
|
|
|
uses: actions-rs/toolchain@v1
|
|
|
|
with:
|
|
|
|
toolchain: ${{ env.RUST_TOOLCHAIN }}
|
|
|
|
override: true
|
|
|
|
components: rustfmt, clippy
|
|
|
|
profile: minimal
|
|
|
|
|
2023-01-03 15:10:11 +00:00
|
|
|
- name: Install flutter
|
|
|
|
id: flutter
|
|
|
|
uses: subosito/flutter-action@v2
|
|
|
|
with:
|
|
|
|
channel: "stable"
|
|
|
|
flutter-version: ${{ env.FLUTTER_VERSION }}
|
|
|
|
cache: true
|
|
|
|
|
2023-01-03 14:34:55 +00:00
|
|
|
- name: Install prerequisites
|
|
|
|
working-directory: frontend
|
|
|
|
run: |
|
|
|
|
cargo install --force cargo-make
|
|
|
|
cargo install --force duckscript_cli
|
|
|
|
|
|
|
|
- uses: Swatinem/rust-cache@v2
|
|
|
|
with:
|
|
|
|
prefix-key: ${{ matrix.job.os }}
|
|
|
|
|
|
|
|
- name: Build FlowySDK
|
|
|
|
working-directory: frontend
|
|
|
|
run: |
|
2023-02-02 15:02:49 +00:00
|
|
|
cargo make --profile development-linux-x86_64 appflowy-core-dev
|
2023-01-03 14:34:55 +00:00
|
|
|
|
|
|
|
- name: rustfmt rust-lib
|
|
|
|
run: cargo fmt --all -- --check
|
|
|
|
working-directory: frontend/rust-lib/
|
|
|
|
|
|
|
|
- name: clippy rust-lib
|
2023-01-12 05:09:08 +00:00
|
|
|
run: cargo clippy --features="rev-sqlite"
|
2023-01-03 14:34:55 +00:00
|
|
|
working-directory: frontend/rust-lib
|
|
|
|
|
|
|
|
- name: Run rust-lib tests
|
|
|
|
working-directory: frontend/rust-lib
|
2023-01-12 05:09:08 +00:00
|
|
|
run: RUST_LOG=info cargo test --no-default-features --features="sync,rev-sqlite"
|
2023-01-03 14:34:55 +00:00
|
|
|
|
|
|
|
- name: rustfmt shared-lib
|
|
|
|
run: cargo fmt --all -- --check
|
|
|
|
working-directory: shared-lib
|
|
|
|
|
|
|
|
- name: clippy shared-lib
|
2023-01-12 05:09:08 +00:00
|
|
|
run: cargo clippy -- -D warnings
|
2023-01-03 14:34:55 +00:00
|
|
|
working-directory: shared-lib
|
|
|
|
|
|
|
|
- name: Run shared-lib tests
|
|
|
|
working-directory: shared-lib
|
|
|
|
run: RUST_LOG=info cargo test --no-default-features
|