dart_test.yml 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. name: Frontend test
  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-04-07"
  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. 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 Test lib
  53. working-directory: frontend
  54. run: |
  55. cargo make --profile test-linux build-test-lib
  56. - name: Flutter 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