dart_test.yml 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  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. flutter-version: '3.0.0'
  23. cache: true
  24. - name: Cache Cargo
  25. uses: actions/cache@v2
  26. with:
  27. path: |
  28. ~/.cargo
  29. key: ${{ runner.os }}-cargo-${{ steps.rust_toolchain.outputs.rustc_hash }}-${{ hashFiles('./frontend/rust-lib/Cargo.toml') }}
  30. - name: Cache Rust
  31. uses: actions/cache@v2
  32. with:
  33. path: |
  34. frontend/rust-lib/target
  35. shared-lib/target
  36. key: ${{ runner.os }}-rust-rust-lib-share-lib-${{ steps.rust_toolchain.outputs.rustc_hash }}-${{ hashFiles('./frontend/rust-lib/Cargo.toml') }}
  37. - name: Flutter Deps
  38. working-directory: frontend/app_flowy
  39. run: |
  40. flutter config --enable-linux-desktop
  41. - name: Rust Deps
  42. working-directory: frontend
  43. run: |
  44. cargo install cargo-make
  45. cargo make flowy_dev
  46. - name: Build FlowySDK
  47. working-directory: frontend
  48. run: |
  49. cargo make --profile development-linux-x86_64 flowy-sdk-dev
  50. - name: Code Generation
  51. working-directory: frontend/app_flowy
  52. run: |
  53. flutter packages pub get
  54. flutter packages pub run easy_localization:generate -f keys -o locale_keys.g.dart -S assets/translations -s en.json
  55. flutter packages pub run build_runner build --delete-conflicting-outputs
  56. - name: Run bloc tests
  57. working-directory: frontend/app_flowy
  58. run: |
  59. flutter pub get
  60. flutter test