dart_test.yml 2.1 KB

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