dart_test.yml 2.1 KB

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