dart_test.yml 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. name: Unit test(Flutter)
  2. on:
  3. push:
  4. branches:
  5. - 'main'
  6. pull_request:
  7. branches:
  8. - 'main'
  9. env:
  10. CARGO_TERM_COLOR: always
  11. jobs:
  12. tests:
  13. runs-on: ubuntu-latest
  14. steps:
  15. - uses: actions/checkout@v2
  16. - uses: actions-rs/toolchain@v1
  17. with:
  18. toolchain: 'stable-2022-01-20'
  19. - uses: subosito/flutter-action@v2
  20. with:
  21. channel: 'stable'
  22. cache: true
  23. - name: Cache Cargo
  24. uses: actions/cache@v2
  25. with:
  26. path: |
  27. ~/.cargo
  28. key: ${{ runner.os }}-cargo-${{ steps.rust_toolchain.outputs.rustc_hash }}-${{ hashFiles('./frontend/rust-lib/Cargo.toml') }}
  29. - name: Cache Rust
  30. uses: actions/cache@v2
  31. with:
  32. path: |
  33. frontend/rust-lib/target
  34. shared-lib/target
  35. key: ${{ runner.os }}-rust-rust-lib-share-lib-${{ steps.rust_toolchain.outputs.rustc_hash }}-${{ hashFiles('./frontend/rust-lib/Cargo.toml') }}
  36. - name: Deps Flutter
  37. working-directory: frontend/app_flowy
  38. run: |
  39. flutter config --enable-linux-desktop
  40. - name: Deps Rust
  41. working-directory: frontend
  42. run: |
  43. cargo install cargo-make
  44. cargo install duckscript_cli
  45. cargo make flowy_dev
  46. - name: Code Generation
  47. working-directory: frontend/app_flowy
  48. run: |
  49. flutter packages pub get
  50. flutter packages pub run easy_localization:generate -S ./assets/translations -f keys -O lib/generated -o locale_keys.g.dart
  51. flutter packages pub run build_runner build --delete-conflicting-outputs
  52. - name: Build FlowySDK
  53. working-directory: frontend
  54. run: |
  55. cargo make --profile development-linux-x86 flowy-sdk-dev
  56. - name: Run bloc tests
  57. working-directory: frontend/app_flowy
  58. run: |
  59. flutter pub get
  60. flutter test