integration_test.yml 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139
  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. tests:
  28. if: github.event.pull_request.draft != true
  29. strategy:
  30. matrix:
  31. os: [ubuntu-latest]
  32. runs-on: ${{ matrix.os }}
  33. steps:
  34. - uses: actions/checkout@v2
  35. - uses: actions-rs/toolchain@v1
  36. with:
  37. toolchain: "stable-2022-04-07"
  38. - name: Install Rust toolchain
  39. id: rust_toolchain
  40. uses: actions-rs/toolchain@v1
  41. with:
  42. toolchain: ${{ env.RUST_TOOLCHAIN }}
  43. override: true
  44. profile: minimal
  45. - name: Install flutter
  46. id: flutter
  47. uses: subosito/flutter-action@v2
  48. with:
  49. channel: "stable"
  50. flutter-version: ${{ env.FLUTTER_VERSION }}
  51. cache: true
  52. - uses: Swatinem/rust-cache@v2
  53. with:
  54. prefix-key: ${{ matrix.os }}
  55. workspaces: |
  56. frontend/rust-lib
  57. - uses: davidB/rust-cargo-make@v1
  58. with:
  59. version: '0.36.6'
  60. - name: Install prerequisites
  61. working-directory: frontend
  62. run: |
  63. cargo install --force duckscript_cli
  64. if [ "$RUNNER_OS" == "Linux" ]; then
  65. sudo wget -qO /etc/apt/trusted.gpg.d/dart_linux_signing_key.asc https://dl-ssl.google.com/linux/linux_signing_key.pub
  66. sudo wget -qO /etc/apt/sources.list.d/dart_stable.list https://storage.googleapis.com/download.dartlang.org/linux/debian/dart_stable.list
  67. sudo apt-get update
  68. sudo apt-get install -y dart curl build-essential libssl-dev clang cmake ninja-build pkg-config libgtk-3-dev
  69. sudo apt-get install keybinder-3.0
  70. elif [ "$RUNNER_OS" == "Windows" ]; then
  71. vcpkg integrate install
  72. elif [ "$RUNNER_OS" == "macOS" ]; then
  73. echo 'do nothing'
  74. fi
  75. cargo make appflowy-flutter-deps-tools
  76. shell: bash
  77. - name: Config Flutter
  78. run: |
  79. if [ "$RUNNER_OS" == "Linux" ]; then
  80. flutter config --enable-linux-desktop
  81. elif [ "$RUNNER_OS" == "macOS" ]; then
  82. flutter config --enable-macos-desktop
  83. elif [ "$RUNNER_OS" == "Windows" ]; then
  84. flutter config --enable-windows-desktop
  85. fi
  86. shell: bash
  87. - name: Build Test lib
  88. working-directory: frontend
  89. run: |
  90. if [ "$RUNNER_OS" == "Linux" ]; then
  91. cargo make --profile development-linux-x86_64 appflowy-dev
  92. elif [ "$RUNNER_OS" == "macOS" ]; then
  93. cargo make --profile development-mac-x86_64 appflowy-dev
  94. elif [ "$RUNNER_OS" == "Windows" ]; then
  95. cargo make --profile development-windows-x86 appflowy-dev
  96. fi
  97. shell: bash
  98. - name: Run AppFlowy tests
  99. working-directory: frontend/appflowy_flutter
  100. run: |
  101. if [ "$RUNNER_OS" == "Linux" ]; then
  102. export DISPLAY=:99
  103. sudo Xvfb -ac :99 -screen 0 1280x1024x24 > /dev/null 2>&1 &
  104. sudo apt-get install network-manager
  105. flutter test integration_test/runner.dart -d Linux --coverage
  106. elif [ "$RUNNER_OS" == "macOS" ]; then
  107. flutter test integration_test/runner.dart -d macOS --coverage
  108. elif [ "$RUNNER_OS" == "Windows" ]; then
  109. flutter test integration_test/runner.dart -d Windows --coverage
  110. fi
  111. shell: bash
  112. - name: Upload coverage to Codecov
  113. uses: Wandalen/[email protected]
  114. with:
  115. action: codecov/codecov-action@v3
  116. with: |
  117. name: appflowy
  118. flags: appflowy_flutter_integrateion_test
  119. fail_ci_if_error: true
  120. verbose: true
  121. os: ${{ matrix.os }}
  122. attempt_limit: 5
  123. attempt_delay: 10000