flutter_ci.yaml 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. name: Flutter-CI
  2. on:
  3. push:
  4. branches:
  5. - "main"
  6. - "release/*"
  7. paths:
  8. - "frontend/**"
  9. pull_request:
  10. branches:
  11. - "main"
  12. - "release/*"
  13. paths:
  14. - "frontend/**"
  15. env:
  16. FLUTTER_VERSION: "3.3.9"
  17. RUST_TOOLCHAIN: "1.65"
  18. jobs:
  19. build:
  20. strategy:
  21. fail-fast: false
  22. matrix:
  23. os: [ubuntu-latest, macos-latest, windows-latest]
  24. include:
  25. - os: ubuntu-latest
  26. flutter_profile: development-linux-x86_64
  27. target: x86_64-unknown-linux-gnu
  28. - os: macos-latest
  29. flutter_profile: development-mac-x86_64
  30. target: x86_64-apple-darwin
  31. - os: windows-latest
  32. flutter_profile: development-windows-x86
  33. target: x86_64-pc-windows-msvc
  34. runs-on: ${{ matrix.os }}
  35. steps:
  36. - name: Checkout source code
  37. uses: actions/checkout@v2
  38. - name: Install Rust toolchain
  39. id: rust_toolchain
  40. uses: actions-rs/toolchain@v1
  41. with:
  42. toolchain: ${{ env.RUST_TOOLCHAIN }}
  43. target: ${{ matrix.target }}
  44. override: true
  45. profile: minimal
  46. - name: Install flutter
  47. id: flutter
  48. uses: subosito/flutter-action@v2
  49. with:
  50. channel: "stable"
  51. flutter-version: ${{ env.FLUTTER_VERSION }}
  52. cache: true
  53. - uses: Swatinem/rust-cache@v2
  54. with:
  55. prefix-key: ${{ matrix.job.os }}
  56. - name: Install prerequisites
  57. working-directory: frontend
  58. run: |
  59. cargo install --force cargo-make
  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: Enable Flutter Desktop
  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. shell: bash
  84. - name: Build AppFlowy
  85. working-directory: frontend
  86. run: |
  87. cargo make --profile ${{ matrix.flutter_profile }} appflowy-dev
  88. - name: Flutter Analyzer
  89. working-directory: frontend/appflowy_flutter
  90. run: flutter analyze
  91. - name: Run Flutter unit tests
  92. working-directory: frontend
  93. run: |
  94. cargo make dart_unit_test