flutter_ci.yaml 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. name: Flutter-CI
  2. on:
  3. push:
  4. branches:
  5. - "main"
  6. - "develop"
  7. - "release/*"
  8. paths:
  9. - "frontend/**"
  10. - "!frontend/appflowy_tauri/**"
  11. pull_request:
  12. branches:
  13. - "main"
  14. - "develop"
  15. - "release/*"
  16. paths:
  17. - "frontend/**"
  18. - "!frontend/appflowy_tauri/**"
  19. env:
  20. FLUTTER_VERSION: "3.7.5"
  21. RUST_TOOLCHAIN: "1.65"
  22. jobs:
  23. build:
  24. strategy:
  25. fail-fast: false
  26. matrix:
  27. os: [ubuntu-latest, macos-latest, windows-latest]
  28. include:
  29. - os: ubuntu-latest
  30. flutter_profile: development-linux-x86_64
  31. target: x86_64-unknown-linux-gnu
  32. - os: macos-latest
  33. flutter_profile: development-mac-x86_64
  34. target: x86_64-apple-darwin
  35. - os: windows-latest
  36. flutter_profile: development-windows-x86
  37. target: x86_64-pc-windows-msvc
  38. runs-on: ${{ matrix.os }}
  39. steps:
  40. - name: Checkout source code
  41. uses: actions/checkout@v2
  42. - name: Install Rust toolchain
  43. id: rust_toolchain
  44. uses: actions-rs/toolchain@v1
  45. with:
  46. toolchain: ${{ env.RUST_TOOLCHAIN }}
  47. target: ${{ matrix.target }}
  48. override: true
  49. profile: minimal
  50. - name: Install flutter
  51. id: flutter
  52. uses: subosito/flutter-action@v2
  53. with:
  54. channel: "stable"
  55. flutter-version: ${{ env.FLUTTER_VERSION }}
  56. cache: true
  57. - uses: Swatinem/rust-cache@v2
  58. with:
  59. prefix-key: ${{ matrix.job.os }}
  60. - name: Install prerequisites
  61. working-directory: frontend
  62. run: |
  63. cargo install --force cargo-make
  64. cargo install --force duckscript_cli
  65. if [ "$RUNNER_OS" == "Linux" ]; then
  66. sudo wget -qO /etc/apt/trusted.gpg.d/dart_linux_signing_key.asc https://dl-ssl.google.com/linux/linux_signing_key.pub
  67. sudo wget -qO /etc/apt/sources.list.d/dart_stable.list https://storage.googleapis.com/download.dartlang.org/linux/debian/dart_stable.list
  68. sudo apt-get update
  69. sudo apt-get install -y dart curl build-essential libssl-dev clang cmake ninja-build pkg-config libgtk-3-dev
  70. sudo apt-get install keybinder-3.0
  71. elif [ "$RUNNER_OS" == "Windows" ]; then
  72. vcpkg integrate install
  73. elif [ "$RUNNER_OS" == "macOS" ]; then
  74. echo 'do nothing'
  75. fi
  76. cargo make appflowy-flutter-deps-tools
  77. shell: bash
  78. - name: Enable Flutter Desktop
  79. run: |
  80. if [ "$RUNNER_OS" == "Linux" ]; then
  81. flutter config --enable-linux-desktop
  82. elif [ "$RUNNER_OS" == "macOS" ]; then
  83. flutter config --enable-macos-desktop
  84. elif [ "$RUNNER_OS" == "Windows" ]; then
  85. flutter config --enable-windows-desktop
  86. fi
  87. shell: bash
  88. - name: Build AppFlowy
  89. working-directory: frontend
  90. run: |
  91. cargo make --profile ${{ matrix.flutter_profile }} appflowy-dev
  92. - name: Flutter Analyzer
  93. working-directory: frontend/appflowy_flutter
  94. run: |
  95. flutter analyze .
  96. - name: Run Flutter unit tests
  97. working-directory: frontend
  98. run: |
  99. cargo make dart_unit_test