integration_test.yml 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  1. name: integration test
  2. on:
  3. push:
  4. branches:
  5. - "main"
  6. - "release/*"
  7. paths:
  8. - "frontend/appflowy_flutter/**"
  9. pull_request:
  10. branches:
  11. - "main"
  12. - "release/*"
  13. paths:
  14. - "frontend/appflowy_flutter/**"
  15. env:
  16. CARGO_TERM_COLOR: always
  17. jobs:
  18. tests:
  19. strategy:
  20. matrix:
  21. os: [macos-latest]
  22. runs-on: ${{ matrix.os }}
  23. steps:
  24. - uses: actions/checkout@v2
  25. - uses: actions-rs/toolchain@v1
  26. with:
  27. toolchain: "stable-2022-04-07"
  28. - uses: subosito/flutter-action@v2
  29. with:
  30. channel: "stable"
  31. flutter-version: "3.3.9"
  32. cache: true
  33. - name: Cache Cargo
  34. uses: actions/cache@v2
  35. with:
  36. path: |
  37. ~/.cargo
  38. key: ${{ runner.os }}-cargo-${{ steps.rust_toolchain.outputs.rustc_hash }}-${{ hashFiles('./frontend/rust-lib/Cargo.toml') }}
  39. - name: Cache Rust
  40. id: cache-rust-target
  41. uses: actions/cache@v2
  42. with:
  43. path: |
  44. frontend/rust-lib/target
  45. shared-lib/target
  46. key: ${{ runner.os }}-rust-rust-lib-share-lib-${{ steps.rust_toolchain.outputs.rustc_hash }}-${{ hashFiles('./frontend/rust-lib/Cargo.toml') }}
  47. - name: Setup Environment
  48. run: |
  49. if [ "$RUNNER_OS" == "Linux" ]; then
  50. sudo wget -qO /etc/apt/trusted.gpg.d/dart_linux_signing_key.asc https://dl-ssl.google.com/linux/linux_signing_key.pub
  51. sudo wget -qO /etc/apt/sources.list.d/dart_stable.list https://storage.googleapis.com/download.dartlang.org/linux/debian/dart_stable.list
  52. sudo apt-get update
  53. sudo apt-get install -y dart curl build-essential libsqlite3-dev libssl-dev clang cmake ninja-build pkg-config libgtk-3-dev
  54. sudo apt-get install keybinder-3.0
  55. elif [ "$RUNNER_OS" == "Windows" ]; then
  56. vcpkg integrate install
  57. cargo install --force duckscript_cli
  58. elif [ "$RUNNER_OS" == "macOS" ]; then
  59. echo 'do nothing'
  60. fi
  61. shell: bash
  62. - if: steps.cache-cargo.outputs.cache-hit != 'true'
  63. name: Rust Deps
  64. working-directory: frontend
  65. run: |
  66. cargo install cargo-make
  67. cargo make appflowy-flutter-deps-tools
  68. - name: Build Test lib
  69. working-directory: frontend
  70. run: |
  71. if [ "$RUNNER_OS" == "Linux" ]; then
  72. cargo make --profile production-linux-x86_64 appflowy
  73. elif [ "$RUNNER_OS" == "macOS" ]; then
  74. cargo make --profile production-mac-x86_64 appflowy
  75. elif [ "$RUNNER_OS" == "Windows" ]; then
  76. cargo make --profile production-windows-x86 appflowy
  77. fi
  78. - name: Config Flutter
  79. run: |
  80. if [ "$RUNNER_OS" == "Linux" ]; then
  81. flutter config --enable-linux-desktop
  82. elif [ "$RUNNER_OS" == "macOS" ]; then
  83. flutter config --enable-macos-desktop
  84. elif [ "$RUNNER_OS" == "Windows" ]; then
  85. flutter config --enable-windows-desktop
  86. fi
  87. shell: bash
  88. - name: Flutter Code Generation
  89. working-directory: frontend/appflowy_flutter
  90. run: |
  91. flutter packages pub get
  92. flutter packages pub run easy_localization:generate -f keys -o locale_keys.g.dart -S assets/translations -s en.json
  93. flutter packages pub run build_runner build --delete-conflicting-outputs
  94. - name: Run AppFlowy tests
  95. working-directory: frontend/appflowy_flutter
  96. run: |
  97. if [ "$RUNNER_OS" == "Linux" ]; then
  98. flutter test integration_test -d Linux --coverage
  99. elif [ "$RUNNER_OS" == "macOS" ]; then
  100. flutter test integration_test -d macOS --coverage
  101. elif [ "$RUNNER_OS" == "Windows" ]; then
  102. flutter test integration_test -d Windows --coverage
  103. fi
  104. shell: bash
  105. # - uses: codecov/codecov-action@v3
  106. # with:
  107. # name: appflowy
  108. # flags: appflowy
  109. # env_vars: ${{ matrix.os }}
  110. # fail_ci_if_error: true
  111. # verbose: true