integration_test.yml 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
  1. name: integration test
  2. on:
  3. push:
  4. branches:
  5. - "main"
  6. - "release/*"
  7. paths:
  8. - ".github/workflows/integration_test.yml"
  9. - "frontend/**"
  10. - "!frontend/appflowy_tauri/**"
  11. pull_request:
  12. branches:
  13. - "main"
  14. - "release/*"
  15. paths:
  16. - ".github/workflows/integration_test.yml"
  17. - "frontend/**"
  18. - "!frontend/appflowy_tauri/**"
  19. env:
  20. CARGO_TERM_COLOR: always
  21. FLUTTER_VERSION: "3.10.1"
  22. RUST_TOOLCHAIN: "1.70"
  23. concurrency:
  24. group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
  25. cancel-in-progress: true
  26. jobs:
  27. build:
  28. if: github.event.pull_request.draft != true
  29. strategy:
  30. fail-fast: false
  31. matrix:
  32. os: [ubuntu-latest, windows-latest]
  33. include:
  34. - os: ubuntu-latest
  35. flutter_profile: development-linux-x86_64
  36. target: x86_64-unknown-linux-gnu
  37. - os: windows-latest
  38. flutter_profile: development-windows-x86
  39. target: x86_64-pc-windows-msvc
  40. runs-on: ${{ matrix.os }}
  41. steps:
  42. - name: Checkout source code
  43. uses: actions/checkout@v2
  44. - name: Install Rust toolchain
  45. id: rust_toolchain
  46. uses: actions-rs/toolchain@v1
  47. with:
  48. toolchain: ${{ env.RUST_TOOLCHAIN }}
  49. target: ${{ matrix.target }}
  50. override: true
  51. profile: minimal
  52. - name: Install flutter
  53. id: flutter
  54. uses: subosito/flutter-action@v2
  55. with:
  56. channel: "stable"
  57. flutter-version: ${{ env.FLUTTER_VERSION }}
  58. cache: true
  59. - uses: Swatinem/rust-cache@v2
  60. with:
  61. prefix-key: ${{ matrix.os }}
  62. workspaces: |
  63. frontend/rust-lib
  64. cache-all-crates: true
  65. - uses: davidB/rust-cargo-make@v1
  66. with:
  67. version: '0.36.6'
  68. - name: Install prerequisites
  69. working-directory: frontend
  70. run: |
  71. cargo install --force duckscript_cli
  72. if [ "$RUNNER_OS" == "Linux" ]; then
  73. sudo wget -qO /etc/apt/trusted.gpg.d/dart_linux_signing_key.asc https://dl-ssl.google.com/linux/linux_signing_key.pub
  74. sudo wget -qO /etc/apt/sources.list.d/dart_stable.list https://storage.googleapis.com/download.dartlang.org/linux/debian/dart_stable.list
  75. sudo apt-get update
  76. sudo apt-get install -y dart curl build-essential libssl-dev clang cmake ninja-build pkg-config libgtk-3-dev
  77. sudo apt-get install keybinder-3.0
  78. elif [ "$RUNNER_OS" == "Windows" ]; then
  79. vcpkg integrate install
  80. elif [ "$RUNNER_OS" == "macOS" ]; then
  81. echo 'do nothing'
  82. fi
  83. cargo make appflowy-flutter-deps-tools
  84. shell: bash
  85. - name: Enable Flutter Desktop
  86. run: |
  87. if [ "$RUNNER_OS" == "Linux" ]; then
  88. flutter config --enable-linux-desktop
  89. elif [ "$RUNNER_OS" == "macOS" ]; then
  90. flutter config --enable-macos-desktop
  91. elif [ "$RUNNER_OS" == "Windows" ]; then
  92. git config --system core.longpaths true
  93. flutter config --enable-windows-desktop
  94. fi
  95. shell: bash
  96. - name: Build AppFlowy
  97. working-directory: frontend
  98. run: |
  99. cargo make --profile ${{ matrix.flutter_profile }} appflowy-dev
  100. - name: Run Flutter integration tests
  101. working-directory: frontend/appflowy_flutter
  102. run: |
  103. if [ "$RUNNER_OS" == "Linux" ]; then
  104. export DISPLAY=:99
  105. sudo Xvfb -ac :99 -screen 0 1280x1024x24 > /dev/null 2>&1 &
  106. sudo apt-get install network-manager
  107. flutter test integration_test/runner.dart -d Linux --coverage
  108. elif [ "$RUNNER_OS" == "macOS" ]; then
  109. flutter test integration_test/runner.dart -d macOS --coverage
  110. elif [ "$RUNNER_OS" == "Windows" ]; then
  111. flutter test integration_test/runner.dart -d Windows --coverage
  112. fi
  113. shell: bash
  114. - name: Upload coverage to Codecov
  115. uses: Wandalen/[email protected]
  116. with:
  117. action: codecov/codecov-action@v3
  118. with: |
  119. name: appflowy
  120. flags: appflowy_flutter_integrateion_test
  121. fail_ci_if_error: true
  122. verbose: true
  123. os: ${{ matrix.os }}
  124. attempt_limit: 20
  125. attempt_delay: 10000