integration_test.yml 4.1 KB

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