2022-02-19 15:19:33 +00:00
|
|
|
name: Unit test(Flutter)
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
2022-03-01 07:43:42 +00:00
|
|
|
branches:
|
|
|
|
- 'main'
|
|
|
|
|
2022-02-19 15:19:33 +00:00
|
|
|
pull_request:
|
2022-03-01 07:43:42 +00:00
|
|
|
branches:
|
|
|
|
- 'main'
|
2022-07-13 10:46:38 +00:00
|
|
|
- 'feat/flowy_editor'
|
2022-02-19 15:19:33 +00:00
|
|
|
|
|
|
|
env:
|
|
|
|
CARGO_TERM_COLOR: always
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
tests:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2022-03-01 07:43:42 +00:00
|
|
|
- uses: actions/checkout@v2
|
|
|
|
|
2022-02-19 15:26:38 +00:00
|
|
|
- uses: actions-rs/toolchain@v1
|
|
|
|
with:
|
2022-03-01 07:43:42 +00:00
|
|
|
toolchain: 'stable-2022-01-20'
|
|
|
|
|
|
|
|
- uses: subosito/flutter-action@v2
|
|
|
|
with:
|
|
|
|
channel: 'stable'
|
2022-08-09 05:11:39 +00:00
|
|
|
flutter-version: '3.0.5'
|
2022-03-01 07:43:42 +00:00
|
|
|
cache: true
|
|
|
|
|
|
|
|
- name: Cache Cargo
|
|
|
|
uses: actions/cache@v2
|
|
|
|
with:
|
|
|
|
path: |
|
|
|
|
~/.cargo
|
|
|
|
key: ${{ runner.os }}-cargo-${{ steps.rust_toolchain.outputs.rustc_hash }}-${{ hashFiles('./frontend/rust-lib/Cargo.toml') }}
|
|
|
|
|
|
|
|
- name: Cache Rust
|
|
|
|
uses: actions/cache@v2
|
|
|
|
with:
|
|
|
|
path: |
|
|
|
|
frontend/rust-lib/target
|
|
|
|
shared-lib/target
|
|
|
|
key: ${{ runner.os }}-rust-rust-lib-share-lib-${{ steps.rust_toolchain.outputs.rustc_hash }}-${{ hashFiles('./frontend/rust-lib/Cargo.toml') }}
|
|
|
|
|
2022-06-15 12:55:55 +00:00
|
|
|
- name: Flutter Deps
|
2022-03-01 07:43:42 +00:00
|
|
|
working-directory: frontend/app_flowy
|
2022-02-25 03:37:14 +00:00
|
|
|
run: |
|
|
|
|
flutter config --enable-linux-desktop
|
2022-03-01 07:43:42 +00:00
|
|
|
|
2022-06-15 12:31:28 +00:00
|
|
|
- name: Rust Deps
|
2022-02-19 15:26:38 +00:00
|
|
|
working-directory: frontend
|
|
|
|
run: |
|
2022-03-01 07:43:42 +00:00
|
|
|
cargo install cargo-make
|
2022-02-19 15:26:38 +00:00
|
|
|
cargo make flowy_dev
|
2022-06-15 13:08:29 +00:00
|
|
|
- name: Build FlowySDK
|
|
|
|
working-directory: frontend
|
|
|
|
run: |
|
2022-07-08 15:20:42 +00:00
|
|
|
cargo make --profile development-linux-x86_64 flowy-sdk-dev
|
2022-06-15 13:08:29 +00:00
|
|
|
|
2022-02-24 07:40:48 +00:00
|
|
|
- name: Code Generation
|
2022-02-19 15:19:33 +00:00
|
|
|
working-directory: frontend/app_flowy
|
2022-02-23 13:32:53 +00:00
|
|
|
run: |
|
2022-02-25 03:37:14 +00:00
|
|
|
flutter packages pub get
|
2022-04-28 13:18:42 +00:00
|
|
|
flutter packages pub run easy_localization:generate -f keys -o locale_keys.g.dart -S assets/translations -s en.json
|
2022-02-23 13:32:53 +00:00
|
|
|
flutter packages pub run build_runner build --delete-conflicting-outputs
|
2022-03-01 07:43:42 +00:00
|
|
|
|
2022-02-19 23:22:39 +00:00
|
|
|
- name: Run bloc tests
|
2022-02-19 15:19:33 +00:00
|
|
|
working-directory: frontend/app_flowy
|
|
|
|
run: |
|
2022-02-25 03:37:14 +00:00
|
|
|
flutter pub get
|
2022-02-19 15:19:33 +00:00
|
|
|
flutter test
|
|
|
|
|
2022-07-13 10:46:38 +00:00
|
|
|
- name: Run FlowyEditor tests
|
|
|
|
working-directory: frontend/app_flowy/packages/flowy_editor
|
|
|
|
run: |
|
|
|
|
flutter pub get
|
|
|
|
flutter test
|