dart_test.yml 2.1 KB

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