integration_test.yml 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  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.7.5"
  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. cargo install --force cargo-make
  50. cargo install --force duckscript_cli
  51. if [ "$RUNNER_OS" == "Linux" ]; then
  52. sudo wget -qO /etc/apt/trusted.gpg.d/dart_linux_signing_key.asc https://dl-ssl.google.com/linux/linux_signing_key.pub
  53. sudo wget -qO /etc/apt/sources.list.d/dart_stable.list https://storage.googleapis.com/download.dartlang.org/linux/debian/dart_stable.list
  54. sudo apt-get update
  55. sudo apt-get install -y dart curl build-essential libssl-dev clang cmake ninja-build pkg-config libgtk-3-dev
  56. sudo apt-get install keybinder-3.0
  57. elif [ "$RUNNER_OS" == "Windows" ]; then
  58. vcpkg integrate install
  59. elif [ "$RUNNER_OS" == "macOS" ]; then
  60. echo 'do nothing'
  61. fi
  62. shell: bash
  63. - if: steps.cache-cargo.outputs.cache-hit != 'true'
  64. name: Rust Deps
  65. working-directory: frontend
  66. run: |
  67. cargo install cargo-make
  68. cargo make appflowy-flutter-deps-tools
  69. - name: Config Flutter
  70. run: |
  71. if [ "$RUNNER_OS" == "Linux" ]; then
  72. flutter config --enable-linux-desktop
  73. elif [ "$RUNNER_OS" == "macOS" ]; then
  74. flutter config --enable-macos-desktop
  75. elif [ "$RUNNER_OS" == "Windows" ]; then
  76. flutter config --enable-windows-desktop
  77. fi
  78. shell: bash
  79. - name: Build Test lib
  80. working-directory: frontend
  81. run: |
  82. if [ "$RUNNER_OS" == "Linux" ]; then
  83. cargo make --profile development-linux-x86_64 appflowy-dev
  84. elif [ "$RUNNER_OS" == "macOS" ]; then
  85. cargo make --profile development-mac-x86_64 appflowy-dev
  86. elif [ "$RUNNER_OS" == "Windows" ]; then
  87. cargo make --profile development-windows-x86 appflowy-dev
  88. fi
  89. shell: bash
  90. - name: Run AppFlowy tests
  91. working-directory: frontend/appflowy_flutter
  92. run: |
  93. if [ "$RUNNER_OS" == "Linux" ]; then
  94. flutter test integration_test/runner.dart -d Linux --coverage
  95. elif [ "$RUNNER_OS" == "macOS" ]; then
  96. flutter test integration_test/runner.dart -d macOS --coverage
  97. elif [ "$RUNNER_OS" == "Windows" ]; then
  98. flutter test integration_test/runner.dart -d Windows --coverage
  99. fi
  100. shell: bash
  101. # - uses: codecov/codecov-action@v3
  102. # with:
  103. # name: appflowy
  104. # flags: appflowy
  105. # env_vars: ${{ matrix.os }}
  106. # fail_ci_if_error: true
  107. # verbose: true