mobile_ci.yaml 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. name: Mobile-CI
  2. on:
  3. push:
  4. branches:
  5. - "main"
  6. paths:
  7. - ".github/workflows/mobile_ci.yaml"
  8. - "frontend/**"
  9. - "!frontend/appflowy_tauri/**"
  10. pull_request:
  11. branches:
  12. - "main"
  13. paths:
  14. - ".github/workflows/mobile_ci.yaml"
  15. - "frontend/**"
  16. - "!frontend/appflowy_tauri/**"
  17. env:
  18. FLUTTER_VERSION: "3.10.1"
  19. RUST_TOOLCHAIN: "1.70"
  20. concurrency:
  21. group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
  22. cancel-in-progress: true
  23. jobs:
  24. build:
  25. if: github.event.pull_request.draft != true
  26. strategy:
  27. fail-fast: false
  28. matrix:
  29. os: [ubuntu-latest]
  30. include:
  31. - os: ubuntu-latest
  32. target: aarch64-linux-android
  33. runs-on: ${{ matrix.os }}
  34. steps:
  35. # the following step is required to avoid running out of space
  36. - name: Maximize build space
  37. if: matrix.os == 'ubuntu-latest'
  38. run: |
  39. sudo rm -rf /usr/share/dotnet
  40. sudo rm -rf /opt/ghc
  41. sudo rm -rf "/usr/local/share/boost"
  42. sudo rm -rf "$AGENT_TOOLSDIRECTORY"
  43. - name: Checkout source code
  44. uses: actions/checkout@v2
  45. - name: Install Rust toolchain
  46. id: rust_toolchain
  47. uses: actions-rs/toolchain@v1
  48. with:
  49. toolchain: ${{ env.RUST_TOOLCHAIN }}
  50. target: ${{ matrix.target }}
  51. override: true
  52. profile: minimal
  53. - name: Install flutter
  54. id: flutter
  55. uses: subosito/flutter-action@v2
  56. with:
  57. channel: "stable"
  58. flutter-version: ${{ env.FLUTTER_VERSION }}
  59. cache: true
  60. - uses: nttld/setup-ndk@v1
  61. id: setup-ndk
  62. with:
  63. ndk-version: "r24"
  64. add-to-path: true
  65. - uses: Swatinem/rust-cache@v2
  66. with:
  67. prefix-key: ${{ matrix.os }}
  68. workspaces: |
  69. frontend/rust-lib
  70. - uses: davidB/rust-cargo-make@v1
  71. with:
  72. version: "0.36.6"
  73. - name: Install prerequisites
  74. working-directory: frontend
  75. run: |
  76. rustup target install aarch64-linux-android
  77. rustup target install x86_64-linux-android
  78. cargo install --force duckscript_cli
  79. cargo install cargo-ndk
  80. if [ "$RUNNER_OS" == "Linux" ]; then
  81. sudo wget -qO /etc/apt/trusted.gpg.d/dart_linux_signing_key.asc https://dl-ssl.google.com/linux/linux_signing_key.pub
  82. sudo wget -qO /etc/apt/sources.list.d/dart_stable.list https://storage.googleapis.com/download.dartlang.org/linux/debian/dart_stable.list
  83. sudo apt-get update
  84. sudo apt-get install -y dart curl build-essential libssl-dev clang cmake ninja-build pkg-config libgtk-3-dev
  85. sudo apt-get install keybinder-3.0 libnotify-dev
  86. sudo apt-get install gcc-multilib
  87. elif [ "$RUNNER_OS" == "Windows" ]; then
  88. vcpkg integrate install
  89. elif [ "$RUNNER_OS" == "macOS" ]; then
  90. echo 'do nothing'
  91. fi
  92. cargo make appflowy-flutter-deps-tools
  93. shell: bash
  94. - name: Build AppFlowy
  95. working-directory: frontend
  96. env:
  97. ANDROID_NDK_HOME: ${{ steps.setup-ndk.outputs.ndk-path }}
  98. run: |
  99. cargo make --profile development-android appflowy-android-dev