flutter_ci.yaml 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  1. name: Flutter-CI
  2. on:
  3. push:
  4. branches:
  5. - "main"
  6. - "develop"
  7. - "release/*"
  8. paths:
  9. - ".github/workflows/flutter_ci.yaml"
  10. - "frontend/**"
  11. - "!frontend/appflowy_tauri/**"
  12. pull_request:
  13. branches:
  14. - "main"
  15. - "develop"
  16. - "release/*"
  17. paths:
  18. - ".github/workflows/flutter_ci.yaml"
  19. - "frontend/**"
  20. - "!frontend/appflowy_tauri/**"
  21. env:
  22. FLUTTER_VERSION: "3.10.1"
  23. RUST_TOOLCHAIN: "1.65"
  24. jobs:
  25. build:
  26. strategy:
  27. fail-fast: false
  28. matrix:
  29. os: [ubuntu-latest, macos-latest, windows-latest]
  30. include:
  31. - os: ubuntu-latest
  32. flutter_profile: development-linux-x86_64
  33. target: x86_64-unknown-linux-gnu
  34. - os: macos-latest
  35. flutter_profile: development-mac-x86_64
  36. target: x86_64-apple-darwin
  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. - uses: davidB/rust-cargo-make@v1
  63. with:
  64. version: '0.36.6'
  65. - name: Install prerequisites
  66. working-directory: frontend
  67. run: |
  68. cargo install --force duckscript_cli
  69. if [ "$RUNNER_OS" == "Linux" ]; then
  70. sudo wget -qO /etc/apt/trusted.gpg.d/dart_linux_signing_key.asc https://dl-ssl.google.com/linux/linux_signing_key.pub
  71. sudo wget -qO /etc/apt/sources.list.d/dart_stable.list https://storage.googleapis.com/download.dartlang.org/linux/debian/dart_stable.list
  72. sudo apt-get update
  73. sudo apt-get install -y dart curl build-essential libssl-dev clang cmake ninja-build pkg-config libgtk-3-dev
  74. sudo apt-get install keybinder-3.0
  75. elif [ "$RUNNER_OS" == "Windows" ]; then
  76. vcpkg integrate install
  77. elif [ "$RUNNER_OS" == "macOS" ]; then
  78. echo 'do nothing'
  79. fi
  80. cargo make appflowy-flutter-deps-tools
  81. shell: bash
  82. - name: Enable Flutter Desktop
  83. run: |
  84. if [ "$RUNNER_OS" == "Linux" ]; then
  85. flutter config --enable-linux-desktop
  86. elif [ "$RUNNER_OS" == "macOS" ]; then
  87. flutter config --enable-macos-desktop
  88. elif [ "$RUNNER_OS" == "Windows" ]; then
  89. git config --system core.longpaths true
  90. flutter config --enable-windows-desktop
  91. fi
  92. shell: bash
  93. - name: Build AppFlowy
  94. working-directory: frontend
  95. run: |
  96. cargo make --profile ${{ matrix.flutter_profile }} appflowy-dev
  97. - name: Flutter Analyzer
  98. working-directory: frontend/appflowy_flutter
  99. run: |
  100. flutter analyze .
  101. - name: Run Flutter unit tests
  102. working-directory: frontend
  103. run: |
  104. cargo make dart_unit_test