ci.yaml 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. name: CI
  2. on:
  3. push:
  4. branches:
  5. - "main"
  6. - "release/*"
  7. pull_request:
  8. branches:
  9. - "main"
  10. - "release/*"
  11. jobs:
  12. build:
  13. strategy:
  14. matrix:
  15. os: [ubuntu-latest, macos-latest, windows-latest]
  16. include:
  17. - os: ubuntu-latest
  18. flutter_profile: development-linux-x86_64
  19. - os: macos-latest
  20. flutter_profile: development-mac-x86_64
  21. - os: windows-latest
  22. flutter_profile: development-windows-x86
  23. runs-on: ${{ matrix.os }}
  24. steps:
  25. - uses: actions/checkout@v2
  26. - id: rust_toolchain
  27. uses: actions-rs/toolchain@v1
  28. with:
  29. toolchain: "stable-2022-04-07"
  30. - id: flutter
  31. uses: subosito/flutter-action@v2
  32. with:
  33. channel: "stable"
  34. cache: true
  35. flutter-version: "3.0.5"
  36. - name: Cache Cargo
  37. id: cache-cargo
  38. uses: actions/cache@v2
  39. with:
  40. path: |
  41. ~/.cargo
  42. key: ${{ runner.os }}-cargo-${{ steps.rust_toolchain.outputs.rustc_hash }}-${{ hashFiles('./frontend/rust-lib/Cargo.toml') }}
  43. - name: Cache Rust
  44. uses: actions/cache@v2
  45. with:
  46. path: |
  47. frontend/rust-lib/target
  48. shared-lib/target
  49. key: ${{ runner.os }}-rust-rust-lib-share-lib-${{ steps.rust_toolchain.outputs.rustc_hash }}-${{ hashFiles('./frontend/rust-lib/Cargo.toml') }}
  50. - name: Setup Environment
  51. run: |
  52. if [ "$RUNNER_OS" == "Linux" ]; then
  53. sudo wget -qO /etc/apt/trusted.gpg.d/dart_linux_signing_key.asc https://dl-ssl.google.com/linux/linux_signing_key.pub
  54. sudo wget -qO /etc/apt/sources.list.d/dart_stable.list https://storage.googleapis.com/download.dartlang.org/linux/debian/dart_stable.list
  55. sudo apt-get update
  56. sudo apt-get install -y dart curl build-essential libsqlite3-dev libssl-dev clang cmake ninja-build pkg-config libgtk-3-dev
  57. sudo apt-get install keybinder-3.0
  58. elif [ "$RUNNER_OS" == "Windows" ]; then
  59. vcpkg integrate install
  60. elif [ "$RUNNER_OS" == "macOS" ]; then
  61. echo 'do nothing'
  62. fi
  63. shell: bash
  64. - if: steps.cache-cargo.outputs.cache-hit != 'true'
  65. name: Deps
  66. working-directory: frontend
  67. run: |
  68. cargo install cargo-make
  69. cargo install duckscript_cli
  70. - name: Cargo make appflowy-deps-tools
  71. working-directory: frontend
  72. run: |
  73. cargo make appflowy-deps-tools
  74. - name: Config Flutter
  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
  85. working-directory: frontend
  86. run: |
  87. cargo make --profile ${{ matrix.flutter_profile }} appflowy-dev