dart_test.yml 2.1 KB

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