integration_test.yml 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150
  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. # the following step is required to avoid running out of space
  43. - name: Maximize build space
  44. if: matrix.os == 'ubuntu-latest'
  45. run: |
  46. sudo rm -rf /usr/share/dotnet
  47. sudo rm -rf /opt/ghc
  48. sudo rm -rf /usr/local/share/boost
  49. df -h
  50. - name: Checkout source code
  51. uses: actions/checkout@v2
  52. - name: Install Rust toolchain
  53. id: rust_toolchain
  54. uses: actions-rs/toolchain@v1
  55. with:
  56. toolchain: ${{ env.RUST_TOOLCHAIN }}
  57. target: ${{ matrix.target }}
  58. override: true
  59. profile: minimal
  60. - name: Install flutter
  61. id: flutter
  62. uses: subosito/flutter-action@v2
  63. with:
  64. channel: "stable"
  65. flutter-version: ${{ env.FLUTTER_VERSION }}
  66. cache: true
  67. - uses: Swatinem/rust-cache@v2
  68. with:
  69. prefix-key: ${{ matrix.os }}
  70. workspaces: |
  71. frontend/rust-lib
  72. cache-all-crates: true
  73. - uses: davidB/rust-cargo-make@v1
  74. with:
  75. version: '0.36.6'
  76. - name: Install prerequisites
  77. working-directory: frontend
  78. run: |
  79. cargo install --force duckscript_cli
  80. if [ "$RUNNER_OS" == "Linux" ]; then
  81. sudo wget -qO /etc/apt/trusted.gpg.d/dart_linux_signing_key.asc https://dl-ssl.google.com/linux/linux_signing_key.pub
  82. sudo wget -qO /etc/apt/sources.list.d/dart_stable.list https://storage.googleapis.com/download.dartlang.org/linux/debian/dart_stable.list
  83. sudo apt-get update
  84. sudo apt-get install -y dart curl build-essential libssl-dev clang cmake ninja-build pkg-config libgtk-3-dev
  85. sudo apt-get install keybinder-3.0 libnotify-dev
  86. elif [ "$RUNNER_OS" == "Windows" ]; then
  87. vcpkg integrate install
  88. elif [ "$RUNNER_OS" == "macOS" ]; then
  89. echo 'do nothing'
  90. fi
  91. cargo make appflowy-flutter-deps-tools
  92. shell: bash
  93. - name: Enable Flutter Desktop
  94. run: |
  95. if [ "$RUNNER_OS" == "Linux" ]; then
  96. flutter config --enable-linux-desktop
  97. elif [ "$RUNNER_OS" == "macOS" ]; then
  98. flutter config --enable-macos-desktop
  99. elif [ "$RUNNER_OS" == "Windows" ]; then
  100. git config --system core.longpaths true
  101. flutter config --enable-windows-desktop
  102. fi
  103. shell: bash
  104. - name: Build AppFlowy
  105. working-directory: frontend
  106. run: |
  107. cargo make --profile ${{ matrix.flutter_profile }} appflowy-dev
  108. - name: Run Flutter integration tests
  109. working-directory: frontend/appflowy_flutter
  110. run: |
  111. if [ "$RUNNER_OS" == "Linux" ]; then
  112. export DISPLAY=:99
  113. sudo Xvfb -ac :99 -screen 0 1280x1024x24 > /dev/null 2>&1 &
  114. sudo apt-get install network-manager
  115. flutter test integration_test/runner.dart -d Linux --coverage
  116. elif [ "$RUNNER_OS" == "macOS" ]; then
  117. flutter test integration_test/runner.dart -d macOS --coverage
  118. elif [ "$RUNNER_OS" == "Windows" ]; then
  119. flutter test integration_test/runner.dart -d Windows --coverage
  120. fi
  121. shell: bash
  122. - name: Upload coverage to Codecov
  123. uses: Wandalen/[email protected]
  124. with:
  125. action: codecov/codecov-action@v3
  126. with: |
  127. name: appflowy
  128. flags: appflowy_flutter_integrateion_test
  129. fail_ci_if_error: true
  130. verbose: true
  131. os: ${{ matrix.os }}
  132. token: ${{ secrets.CODECOV_TOKEN }}
  133. attempt_limit: 20
  134. attempt_delay: 10000