dart_test.yml 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  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: Deps Flutter
  38. working-directory: frontend/app_flowy
  39. run: |
  40. flutter config --enable-linux-desktop
  41. - name: Deps Rust
  42. working-directory: frontend
  43. run: |
  44. cargo install cargo-make
  45. cargo install duckscript_cli
  46. cargo make flowy_dev
  47. - name: Code Generation
  48. working-directory: frontend/app_flowy
  49. run: |
  50. flutter packages pub get
  51. flutter packages pub run easy_localization:generate -f keys -o locale_keys.g.dart -S assets/translations -s en.json
  52. flutter packages pub run build_runner build --delete-conflicting-outputs
  53. - name: Build FlowySDK
  54. working-directory: frontend
  55. run: |
  56. cargo make --profile development-linux-x86 flowy-sdk-dev
  57. - name: Run bloc tests
  58. working-directory: frontend/app_flowy
  59. run: |
  60. flutter pub get
  61. flutter test