flutter_ci.yaml 3.2 KB

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