integration_test.yml 4.2 KB

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